diff --git a/Documentation/html/_9_hardware_8markdown.html b/Documentation/html/_9_hardware_8markdown.html index ea8ea88..ed62975 100644 --- a/Documentation/html/_9_hardware_8markdown.html +++ b/Documentation/html/_9_hardware_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_9_hardware_8markdown.html',''); initR diff --git a/Documentation/html/_9_software_8markdown.html b/Documentation/html/_9_software_8markdown.html index 1cd5425..05d2a26 100644 --- a/Documentation/html/_9_software_8markdown.html +++ b/Documentation/html/_9_software_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_9_software_8markdown.html',''); initR diff --git a/Documentation/html/_design_01_choices_8markdown.html b/Documentation/html/_design_01_choices_8markdown.html index 80689e8..e9d79bc 100644 --- a/Documentation/html/_design_01_choices_8markdown.html +++ b/Documentation/html/_design_01_choices_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_design_01_choices_8markdown.html','') diff --git a/Documentation/html/_device_01_specifications_8markdown.html b/Documentation/html/_device_01_specifications_8markdown.html index f8b1024..140d5c9 100644 --- a/Documentation/html/_device_01_specifications_8markdown.html +++ b/Documentation/html/_device_01_specifications_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_device_01_specifications_8markdown.ht diff --git a/Documentation/html/_documentation_01_guide_8markdown.html b/Documentation/html/_documentation_01_guide_8markdown.html index d128319..dc99b23 100644 --- a/Documentation/html/_documentation_01_guide_8markdown.html +++ b/Documentation/html/_documentation_01_guide_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_documentation_01_guide_8markdown.html diff --git a/Documentation/html/_r_e_a_d_m_e_8markdown.html b/Documentation/html/_r_e_a_d_m_e_8markdown.html index 4904ced..06d02b6 100644 --- a/Documentation/html/_r_e_a_d_m_e_8markdown.html +++ b/Documentation/html/_r_e_a_d_m_e_8markdown.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('_r_e_a_d_m_e_8markdown.html',''); init diff --git a/Documentation/html/adc10__a_8c.html b/Documentation/html/adc10__a_8c.html new file mode 100644 index 0000000..efab54e --- /dev/null +++ b/Documentation/html/adc10__a_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc10_a.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc10_a.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/adc10__a_8c_source.html b/Documentation/html/adc10__a_8c_source.html new file mode 100644 index 0000000..ee40ec8 --- /dev/null +++ b/Documentation/html/adc10__a_8c_source.html @@ -0,0 +1,316 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc10_a.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc10_a.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // adc10_a.c - Driver for the adc10_a Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_ADC10_A__
+
17 #include "adc10_a.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 bool ADC10_A_init (uint16_t baseAddress,
+
22  uint16_t sampleHoldSignalSourceSelect,
+
23  uint8_t clockSourceSelect,
+
24  uint16_t clockSourceDivider)
+
25 {
+
26  bool retVal = STATUS_SUCCESS;
+
27 
+
28  //Turn OFF ADC10_A Module & Clear Interrupt Registers
+
29  HWREG16(baseAddress + OFS_ADC10IFG) &= 0x0000; //Reset ALL interrupt flags
+
30 
+
31  //Set ADC10_A Control 1
+
32  HWREG16(baseAddress + OFS_ADC10CTL1) =
+
33  sampleHoldSignalSourceSelect //Setup the Sample-and-Hold Source
+
34  + (clockSourceDivider & ADC10DIV_7) //Set Clock Divider
+
35  + clockSourceSelect; //Setup Clock Source
+
36 
+
37  //Set ADC10_A Control 2
+
38  HWREG16(baseAddress + OFS_ADC10CTL2) =
+
39  (clockSourceDivider & (ADC10PDIV_1 | ADC10PDIV_2)) //Set Clock Pre-Divider
+
40  + ADC10RES; //Default resolution to 10-bits
+
41 
+
42  return ( retVal) ;
+
43 }
+
44 
+
45 void ADC10_A_enable (uint16_t baseAddress)
+
46 {
+
47  //Reset the ADC10ON bit to enable the ADC10_A Module
+
48  HWREG16(baseAddress + OFS_ADC10CTL0) |= ADC10ON;
+
49 }
+
50 
+
51 void ADC10_A_disable (uint16_t baseAddress)
+
52 {
+
53  //Set the ADC10ON bit to disable the ADC10_A Module
+
54  HWREG16(baseAddress + OFS_ADC10CTL0) &= ~ADC10ON;
+
55 }
+
56 
+
57 void ADC10_A_setupSamplingTimer (uint16_t baseAddress,
+
58  uint16_t clockCycleHoldCount,
+
59  uint16_t multipleSamplesEnabled)
+
60 {
+
61  HWREG16(baseAddress + OFS_ADC10CTL1) |= ADC10SHP;
+
62 
+
63  //Reset and Set CB Control 0 Bits
+
64  HWREG16(baseAddress + OFS_ADC10CTL0) &= ~(ADC10SHT_15 + ADC10MSC);
+
65  HWREG16(baseAddress + OFS_ADC10CTL0) |= clockCycleHoldCount
+
66  + multipleSamplesEnabled;
+
67 }
+
68 
+
69 void ADC10_A_disableSamplingTimer (uint16_t baseAddress)
+
70 {
+
71  HWREG16(baseAddress + OFS_ADC10CTL1) &= ~(ADC10SHP);
+
72 }
+
73 
+
74 void ADC10_A_configureMemory (uint16_t baseAddress,
+
75  uint8_t inputSourceSelect,
+
76  uint8_t positiveRefVoltageSourceSelect,
+
77  uint8_t negativeRefVoltageSourceSelect)
+
78 {
+
79  //Make sure the ENC bit is cleared before configuring a Memory Buffer Control
+
80  assert( !(HWREG16(baseAddress + OFS_ADC10CTL0) & ADC10ENC) );
+
81 
+
82  if(!(HWREG16(baseAddress + OFS_ADC10CTL0) & ADC10ENC))
+
83  {
+
84  assert(inputSourceSelect <= ADC10_A_INPUT_A15);
+
85  assert(positiveRefVoltageSourceSelect <= ADC10_A_VREFPOS_INT);
+
86  assert(negativeRefVoltageSourceSelect <= ADC10_A_VREFNEG_EXT);
+
87 
+
88  //Reset and Set the Memory Buffer Control Bits
+
89  HWREG8(baseAddress + OFS_ADC10MCTL0) = inputSourceSelect
+
90  + positiveRefVoltageSourceSelect +
+
91  negativeRefVoltageSourceSelect;
+
92  }
+
93 }
+
94 
+
95 void ADC10_A_enableInterrupt (uint16_t baseAddress,
+
96  uint8_t interruptMask)
+
97 {
+
98  HWREG16(baseAddress + OFS_ADC10IE) |= interruptMask;
+
99 }
+
100 
+
101 void ADC10_A_disableInterrupt (uint16_t baseAddress,
+
102  uint8_t interruptMask)
+
103 {
+
104  HWREG16(baseAddress + OFS_ADC10IE) &= ~(interruptMask);
+
105 }
+
106 
+
107 void ADC10_A_clearInterrupt (uint16_t baseAddress,
+
108  uint8_t interruptFlagMask)
+
109 {
+
110  HWREG16(baseAddress + OFS_ADC10IFG) &= ~(interruptFlagMask);
+
111 }
+
112 
+
113 uint16_t ADC10_A_getInterruptStatus (uint16_t baseAddress,
+
114  uint8_t interruptFlagMask)
+
115 {
+
116  return ( HWREG16(baseAddress + OFS_ADC10IFG) & interruptFlagMask );
+
117 }
+
118 
+
119 void ADC10_A_startConversion (uint16_t baseAddress,
+
120  uint8_t conversionSequenceModeSelect)
+
121 {
+
122  //Reset the ENC bit to set the conversion mode sequence
+
123  HWREG16(baseAddress + OFS_ADC10CTL0) &= ~(ADC10ENC);
+
124 
+
125  HWREG16(baseAddress + OFS_ADC10CTL1) |= conversionSequenceModeSelect;
+
126  HWREG16(baseAddress + OFS_ADC10CTL0) |= ADC10ENC + ADC10SC;
+
127 }
+
128 
+
129 void ADC10_A_disableConversions (uint16_t baseAddress, bool preempt)
+
130 {
+
131  if (ADC10_A_PREEMPTCONVERSION == preempt){
+
132  HWREG16(baseAddress + OFS_ADC10CTL1) &= ~(ADC10CONSEQ_3);
+
133  //Reset conversion sequence mode to single-channel, single-conversion
+
134  } else if ( ~(HWREG16(baseAddress + OFS_ADC10CTL1) & ADC10CONSEQ_3) ){
+
135  //To prevent preemoption of a single-channel, single-conversion we must
+
136  //wait for the ADC core to finish the conversion.
+
137  while (HWREG16(baseAddress + OFS_ADC10CTL1) & ADC10BUSY) ;
+
138  }
+
139 
+
140  HWREG16(baseAddress + OFS_ADC10CTL0) &= ~(ADC10ENC);
+
141 }
+
142 
+
143 int16_t ADC10_A_getResults (uint16_t baseAddress)
+
144 {
+
145  return ( HWREG16(baseAddress + OFS_ADC10MEM0) );
+
146 }
+
147 
+
148 void ADC10_A_setResolution (uint16_t baseAddress,
+
149  uint8_t resolutionSelect)
+
150 {
+
151  HWREG16(baseAddress + OFS_ADC10CTL2) &= ~(ADC10RES);
+
152  HWREG16(baseAddress + OFS_ADC10CTL2) |= resolutionSelect;
+
153 }
+
154 
+
155 void ADC10_A_setSampleHoldSignalInversion (uint16_t baseAddress,
+
156  uint16_t invertedSignal)
+
157 {
+
158  HWREG16(baseAddress + OFS_ADC10CTL1) &= ~(ADC10ISSH);
+
159  HWREG16(baseAddress + OFS_ADC10CTL1) |= invertedSignal;
+
160 }
+
161 
+
162 void ADC10_A_setDataReadBackFormat (uint16_t baseAddress,
+
163  uint16_t readBackFormat)
+
164 {
+
165  HWREG16(baseAddress + OFS_ADC10CTL2) &= ~(ADC10DF);
+
166  HWREG16(baseAddress + OFS_ADC10CTL2) |= readBackFormat;
+
167 }
+
168 
+
169 void ADC10_A_enableReferenceBurst (uint16_t baseAddress)
+
170 {
+
171  HWREG16(baseAddress + OFS_ADC10CTL2) |= ADC10REFBURST;
+
172 }
+
173 
+
174 void ADC10_A_disableReferenceBurst (uint16_t baseAddress)
+
175 {
+
176  HWREG16(baseAddress + OFS_ADC10CTL2) &= ~(ADC10REFBURST);
+
177 }
+
178 
+
179 void ADC10_A_setReferenceBufferSamplingRate (uint16_t baseAddress,
+
180  uint16_t samplingRateSelect)
+
181 {
+
182  HWREG16(baseAddress + OFS_ADC10CTL2) &= ~(ADC10SR);
+
183  HWREG16(baseAddress + OFS_ADC10CTL2) |= samplingRateSelect;
+
184 }
+
185 
+
186 void ADC10_A_setWindowComp (uint16_t baseAddress,
+
187  uint16_t highThreshold,
+
188  uint16_t lowThreshold)
+
189 {
+
190  HWREG16(baseAddress + OFS_ADC10HI) = highThreshold;
+
191  HWREG16(baseAddress + OFS_ADC10LO) = lowThreshold;
+
192 }
+
193 
+
194 uint32_t ADC10_A_getMemoryAddressForDMA (uint16_t baseAddress)
+
195 {
+
196  return ( baseAddress + OFS_ADC10MEM0 );
+
197 }
+
198 
+
199 uint16_t ADC10_A_isBusy (uint16_t baseAddress)
+
200 {
+
201  return (HWREG16(baseAddress + OFS_ADC10CTL1) & ADC10BUSY);
+
202 }
+
203 
+
204 #endif
+
205 //*****************************************************************************
+
206 //
+
209 //
+
210 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/adc10__a_8h.html b/Documentation/html/adc10__a_8h.html new file mode 100644 index 0000000..0795703 --- /dev/null +++ b/Documentation/html/adc10__a_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc10_a.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc10_a.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/adc10__a_8h_source.html b/Documentation/html/adc10__a_8h_source.html new file mode 100644 index 0000000..7ed411b --- /dev/null +++ b/Documentation/html/adc10__a_8h_source.html @@ -0,0 +1,516 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc10_a.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc10_a.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // adc10_a.h - Driver for the ADC10_A Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_ADC10_A_H__
+
8 #define __MSP430WARE_ADC10_A_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_ADC10_A__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // The following are values that can be passed to the clockSourceSelect
+
28 // parameter for functions: ADC10_A_init().
+
29 //
+
30 //*****************************************************************************
+
31 #define ADC10_A_CLOCKSOURCE_ADC10OSC (ADC10SSEL_0)
+
32 #define ADC10_A_CLOCKSOURCE_ACLK (ADC10SSEL_1)
+
33 #define ADC10_A_CLOCKSOURCE_MCLK (ADC10SSEL_2)
+
34 #define ADC10_A_CLOCKSOURCE_SMCLK (ADC10SSEL_3)
+
35 
+
36 //*****************************************************************************
+
37 //
+
38 // The following are values that can be passed to the clockSourceDivider
+
39 // parameter for functions: ADC10_A_init().
+
40 //
+
41 //*****************************************************************************
+
42 #define ADC10_A_CLOCKDIVIDER_1 (ADC10DIV_0 + ADC10PDIV_0)
+
43 #define ADC10_A_CLOCKDIVIDER_2 (ADC10DIV_1 + ADC10PDIV_0)
+
44 #define ADC10_A_CLOCKDIVIDER_3 (ADC10DIV_2 + ADC10PDIV_0)
+
45 #define ADC10_A_CLOCKDIVIDER_4 (ADC10DIV_3 + ADC10PDIV_0)
+
46 #define ADC10_A_CLOCKDIVIDER_5 (ADC10DIV_4 + ADC10PDIV_0)
+
47 #define ADC10_A_CLOCKDIVIDER_6 (ADC10DIV_5 + ADC10PDIV_0)
+
48 #define ADC10_A_CLOCKDIVIDER_7 (ADC10DIV_6 + ADC10PDIV_0)
+
49 #define ADC10_A_CLOCKDIVIDER_8 (ADC10DIV_7 + ADC10PDIV_0)
+
50 #define ADC10_A_CLOCKDIVIDER_12 (ADC10DIV_2 + ADC10PDIV_1)
+
51 #define ADC10_A_CLOCKDIVIDER_16 (ADC10DIV_3 + ADC10PDIV_1)
+
52 #define ADC10_A_CLOCKDIVIDER_20 (ADC10DIV_4 + ADC10PDIV_1)
+
53 #define ADC10_A_CLOCKDIVIDER_24 (ADC10DIV_5 + ADC10PDIV_1)
+
54 #define ADC10_A_CLOCKDIVIDER_28 (ADC10DIV_6 + ADC10PDIV_1)
+
55 #define ADC10_A_CLOCKDIVIDER_32 (ADC10DIV_7 + ADC10PDIV_1)
+
56 #define ADC10_A_CLOCKDIVIDER_64 (ADC10DIV_0 + ADC10PDIV_2)
+
57 #define ADC10_A_CLOCKDIVIDER_128 (ADC10DIV_1 + ADC10PDIV_2)
+
58 #define ADC10_A_CLOCKDIVIDER_192 (ADC10DIV_2 + ADC10PDIV_2)
+
59 #define ADC10_A_CLOCKDIVIDER_256 (ADC10DIV_3 + ADC10PDIV_2)
+
60 #define ADC10_A_CLOCKDIVIDER_320 (ADC10DIV_4 + ADC10PDIV_2)
+
61 #define ADC10_A_CLOCKDIVIDER_384 (ADC10DIV_5 + ADC10PDIV_2)
+
62 #define ADC10_A_CLOCKDIVIDER_448 (ADC10DIV_6 + ADC10PDIV_2)
+
63 #define ADC10_A_CLOCKDIVIDER_512 (ADC10DIV_7 + ADC10PDIV_2)
+
64 
+
65 //*****************************************************************************
+
66 //
+
67 // The following are values that can be passed to the
+
68 // sampleHoldSignalSourceSelect parameter for functions: ADC10_A_init().
+
69 //
+
70 //*****************************************************************************
+
71 #define ADC10_A_SAMPLEHOLDSOURCE_SC (ADC10SHS_0)
+
72 #define ADC10_A_SAMPLEHOLDSOURCE_1 (ADC10SHS_1)
+
73 #define ADC10_A_SAMPLEHOLDSOURCE_2 (ADC10SHS_2)
+
74 #define ADC10_A_SAMPLEHOLDSOURCE_3 (ADC10SHS_3)
+
75 
+
76 //*****************************************************************************
+
77 //
+
78 // The following are values that can be passed to the multipleSamplesEnabled
+
79 // parameter for functions: ADC10_A_setupSamplingTimer().
+
80 //
+
81 //*****************************************************************************
+
82 #define ADC10_A_MULTIPLESAMPLESDISABLE (!(ADC10MSC))
+
83 #define ADC10_A_MULTIPLESAMPLESENABLE (ADC10MSC)
+
84 
+
85 //*****************************************************************************
+
86 //
+
87 // The following are values that can be passed to the clockCycleHoldCount
+
88 // parameter for functions: ADC10_A_setupSamplingTimer().
+
89 //
+
90 //*****************************************************************************
+
91 #define ADC10_A_CYCLEHOLD_4_CYCLES (ADC10SHT_0)
+
92 #define ADC10_A_CYCLEHOLD_8_CYCLES (ADC10SHT_1)
+
93 #define ADC10_A_CYCLEHOLD_16_CYCLES (ADC10SHT_2)
+
94 #define ADC10_A_CYCLEHOLD_32_CYCLES (ADC10SHT_3)
+
95 #define ADC10_A_CYCLEHOLD_64_CYCLES (ADC10SHT_4)
+
96 #define ADC10_A_CYCLEHOLD_96_CYCLES (ADC10SHT_5)
+
97 #define ADC10_A_CYCLEHOLD_128_CYCLES (ADC10SHT_6)
+
98 #define ADC10_A_CYCLEHOLD_192_CYCLES (ADC10SHT_7)
+
99 #define ADC10_A_CYCLEHOLD_256_CYCLES (ADC10SHT_8)
+
100 #define ADC10_A_CYCLEHOLD_384_CYCLES (ADC10SHT_9)
+
101 #define ADC10_A_CYCLEHOLD_512_CYCLES (ADC10SHT_10)
+
102 #define ADC10_A_CYCLEHOLD_768_CYCLES (ADC10SHT_11)
+
103 #define ADC10_A_CYCLEHOLD_1024_CYCLES (ADC10SHT_12)
+
104 
+
105 //*****************************************************************************
+
106 //
+
107 // The following are values that can be passed to the
+
108 // positiveRefVoltageSourceSelect parameter for functions:
+
109 // ADC10_A_configureMemory().
+
110 //
+
111 //*****************************************************************************
+
112 #define ADC10_A_VREFPOS_AVCC (!(ADC10SREF0 + ADC10SREF1))
+
113 #define ADC10_A_VREFPOS_EXT (ADC10SREF1)
+
114 #define ADC10_A_VREFPOS_INT (ADC10SREF0)
+
115 
+
116 //*****************************************************************************
+
117 //
+
118 // The following are values that can be passed to the inputSourceSelect
+
119 // parameter for functions: ADC10_A_configureMemory().
+
120 //
+
121 //*****************************************************************************
+
122 #define ADC10_A_INPUT_A0 (ADC10INCH_0)
+
123 #define ADC10_A_INPUT_A1 (ADC10INCH_1)
+
124 #define ADC10_A_INPUT_A2 (ADC10INCH_2)
+
125 #define ADC10_A_INPUT_A3 (ADC10INCH_3)
+
126 #define ADC10_A_INPUT_A4 (ADC10INCH_4)
+
127 #define ADC10_A_INPUT_A5 (ADC10INCH_5)
+
128 #define ADC10_A_INPUT_A6 (ADC10INCH_6)
+
129 #define ADC10_A_INPUT_A7 (ADC10INCH_7)
+
130 #define ADC10_A_INPUT_A8 (ADC10INCH_8)
+
131 #define ADC10_A_INPUT_A9 (ADC10INCH_9)
+
132 #define ADC10_A_INPUT_TEMPSENSOR (ADC10INCH_10)
+
133 #define ADC10_A_INPUT_BATTERYMONITOR (ADC10INCH_11)
+
134 #define ADC10_A_INPUT_A12 (ADC10INCH_12)
+
135 #define ADC10_A_INPUT_A13 (ADC10INCH_13)
+
136 #define ADC10_A_INPUT_A14 (ADC10INCH_14)
+
137 #define ADC10_A_INPUT_A15 (ADC10INCH_15)
+
138 
+
139 //*****************************************************************************
+
140 //
+
141 // The following are values that can be passed to the
+
142 // negativeRefVoltageSourceSelect parameter for functions:
+
143 // ADC10_A_configureMemory().
+
144 //
+
145 //*****************************************************************************
+
146 #define ADC10_A_VREFNEG_AVSS (!(ADC10SREF2))
+
147 #define ADC10_A_VREFNEG_EXT (ADC10SREF2)
+
148 
+
149 //*****************************************************************************
+
150 //
+
151 // The following are values that can be passed to the interruptMask parameter
+
152 // for functions: ADC10_A_enableInterrupt(), and ADC10_A_disableInterrupt().
+
153 //
+
154 //*****************************************************************************
+
155 #define ADC10_A_TIMEOVERFLOW_INT (ADC10TOVIE)
+
156 #define ADC10_A_OVERFLOW_INT (ADC10OVIE)
+
157 #define ADC10_A_ABOVETHRESHOLD_INT (ADC10HIIE)
+
158 #define ADC10_A_BELOWTHRESHOLD_INT (ADC10LOIE)
+
159 #define ADC10_A_INSIDEWINDOW_INT (ADC10INIE)
+
160 #define ADC10_A_COMPLETED_INT (ADC10IE0)
+
161 
+
162 //*****************************************************************************
+
163 //
+
164 // The following are values that can be passed to the interruptFlagMask
+
165 // parameter for functions: ADC10_A_clearInterrupt(), and
+
166 // ADC10_A_getInterruptStatus().
+
167 //
+
168 //*****************************************************************************
+
169 #define ADC10_A_TIMEOVERFLOW_INTFLAG (ADC10TOVIFG)
+
170 #define ADC10_A_OVERFLOW_INTFLAG (ADC10OVIFG)
+
171 #define ADC10_A_ABOVETHRESHOLD_INTFLAG (ADC10HIIFG)
+
172 #define ADC10_A_BELOWTHRESHOLD_INTFLAG (ADC10LOIFG)
+
173 #define ADC10_A_INSIDEWINDOW_INTFLAG (ADC10INIFG)
+
174 #define ADC10_A_COMPLETED_INTFLAG (ADC10IFG0)
+
175 
+
176 //*****************************************************************************
+
177 //
+
178 // The following are values that can be passed to the
+
179 // conversionSequenceModeSelect parameter for functions:
+
180 // ADC10_A_startConversion().
+
181 //
+
182 //*****************************************************************************
+
183 #define ADC10_A_SINGLECHANNEL (ADC10CONSEQ_0)
+
184 #define ADC10_A_SEQOFCHANNELS (ADC10CONSEQ_1)
+
185 #define ADC10_A_REPEATED_SINGLECHANNEL (ADC10CONSEQ_2)
+
186 #define ADC10_A_REPEATED_SEQOFCHANNELS (ADC10CONSEQ_3)
+
187 
+
188 //*****************************************************************************
+
189 //
+
190 // The following are values that can be passed to the preempt parameter for
+
191 // functions: ADC10_A_disableConversions().
+
192 //
+
193 //*****************************************************************************
+
194 #define ADC10_A_COMPLETECONVERSION false
+
195 #define ADC10_A_PREEMPTCONVERSION true
+
196 
+
197 //*****************************************************************************
+
198 //
+
199 // The following are values that can be passed to the resolutionSelect
+
200 // parameter for functions: ADC10_A_setResolution().
+
201 //
+
202 //*****************************************************************************
+
203 #define ADC10_A_RESOLUTION_8BIT (!(ADC10RES))
+
204 #define ADC10_A_RESOLUTION_10BIT (ADC10RES)
+
205 
+
206 //*****************************************************************************
+
207 //
+
208 // The following are values that can be passed to the invertedSignal parameter
+
209 // for functions: ADC10_A_setSampleHoldSignalInversion().
+
210 //
+
211 //*****************************************************************************
+
212 #define ADC10_A_NONINVERTEDSIGNAL (!(ADC10ISSH))
+
213 #define ADC10_A_INVERTEDSIGNAL (ADC10ISSH)
+
214 
+
215 //*****************************************************************************
+
216 //
+
217 // The following are values that can be passed to the readBackFormat parameter
+
218 // for functions: ADC10_A_setDataReadBackFormat().
+
219 //
+
220 //*****************************************************************************
+
221 #define ADC10_A_UNSIGNED_BINARY (!(ADC10DF))
+
222 #define ADC10_A_SIGNED_2SCOMPLEMENT (ADC10DF)
+
223 
+
224 //*****************************************************************************
+
225 //
+
226 // The following are values that can be passed to the samplingRateSelect
+
227 // parameter for functions: ADC10_A_setReferenceBufferSamplingRate().
+
228 //
+
229 //*****************************************************************************
+
230 #define ADC10_A_MAXSAMPLINGRATE_200KSPS (!(ADC10SR))
+
231 #define ADC10_A_MAXSAMPLINGRATE_50KSPS (ADC10SR)
+
232 
+
233 //*****************************************************************************
+
234 //
+
235 // The following are values that can be passed toThe following are values that
+
236 // can be returned by the ADC10_A_isBusy() function.
+
237 //
+
238 //*****************************************************************************
+
239 #define ADC10_A_BUSY ADC10BUSY
+
240 #define ADC10_A_NOTBUSY 0x00
+
241 
+
242 //*****************************************************************************
+
243 //
+
244 // Prototypes for the APIs.
+
245 //
+
246 //*****************************************************************************
+
247 
+
248 //*****************************************************************************
+
249 //
+
313 //
+
314 //*****************************************************************************
+
315 extern bool ADC10_A_init(uint16_t baseAddress,
+
316  uint16_t sampleHoldSignalSourceSelect,
+
317  uint8_t clockSourceSelect,
+
318  uint16_t clockSourceDivider);
+
319 
+
320 //*****************************************************************************
+
321 //
+
331 //
+
332 //*****************************************************************************
+
333 extern void ADC10_A_enable(uint16_t baseAddress);
+
334 
+
335 //*****************************************************************************
+
336 //
+
346 //
+
347 //*****************************************************************************
+
348 extern void ADC10_A_disable(uint16_t baseAddress);
+
349 
+
350 //*****************************************************************************
+
351 //
+
391 //
+
392 //*****************************************************************************
+
393 extern void ADC10_A_setupSamplingTimer(uint16_t baseAddress,
+
394  uint16_t clockCycleHoldCount,
+
395  uint16_t multipleSamplesEnabled);
+
396 
+
397 //*****************************************************************************
+
398 //
+
408 //
+
409 //*****************************************************************************
+
410 extern void ADC10_A_disableSamplingTimer(uint16_t baseAddress);
+
411 
+
412 //*****************************************************************************
+
413 //
+
463 //
+
464 //*****************************************************************************
+
465 extern void ADC10_A_configureMemory(uint16_t baseAddress,
+
466  uint8_t inputSourceSelect,
+
467  uint8_t positiveRefVoltageSourceSelect,
+
468  uint8_t negativeRefVoltageSourceSelect);
+
469 
+
470 //*****************************************************************************
+
471 //
+
498 //
+
499 //*****************************************************************************
+
500 extern void ADC10_A_enableInterrupt(uint16_t baseAddress,
+
501  uint8_t interruptMask);
+
502 
+
503 //*****************************************************************************
+
504 //
+
531 //
+
532 //*****************************************************************************
+
533 extern void ADC10_A_disableInterrupt(uint16_t baseAddress,
+
534  uint8_t interruptMask);
+
535 
+
536 //*****************************************************************************
+
537 //
+
566 //
+
567 //*****************************************************************************
+
568 extern void ADC10_A_clearInterrupt(uint16_t baseAddress,
+
569  uint8_t interruptFlagMask);
+
570 
+
571 //*****************************************************************************
+
572 //
+
597 //
+
598 //*****************************************************************************
+
599 extern uint16_t ADC10_A_getInterruptStatus(uint16_t baseAddress,
+
600  uint8_t interruptFlagMask);
+
601 
+
602 //*****************************************************************************
+
603 //
+
644 //
+
645 //*****************************************************************************
+
646 extern void ADC10_A_startConversion(uint16_t baseAddress,
+
647  uint8_t conversionSequenceModeSelect);
+
648 
+
649 //*****************************************************************************
+
650 //
+
678 //
+
679 //*****************************************************************************
+
680 extern void ADC10_A_disableConversions(uint16_t baseAddress,
+
681  bool preempt);
+
682 
+
683 //*****************************************************************************
+
684 //
+
697 //
+
698 //*****************************************************************************
+
699 extern int16_t ADC10_A_getResults(uint16_t baseAddress);
+
700 
+
701 //*****************************************************************************
+
702 //
+
716 //
+
717 //*****************************************************************************
+
718 extern void ADC10_A_setResolution(uint16_t baseAddress,
+
719  uint8_t resolutionSelect);
+
720 
+
721 //*****************************************************************************
+
722 //
+
742 //
+
743 //*****************************************************************************
+
744 extern void ADC10_A_setSampleHoldSignalInversion(uint16_t baseAddress,
+
745  uint16_t invertedSignal);
+
746 
+
747 //*****************************************************************************
+
748 //
+
767 //
+
768 //*****************************************************************************
+
769 extern void ADC10_A_setDataReadBackFormat(uint16_t baseAddress,
+
770  uint16_t readBackFormat);
+
771 
+
772 //*****************************************************************************
+
773 //
+
783 //
+
784 //*****************************************************************************
+
785 extern void ADC10_A_enableReferenceBurst(uint16_t baseAddress);
+
786 
+
787 //*****************************************************************************
+
788 //
+
797 //
+
798 //*****************************************************************************
+
799 extern void ADC10_A_disableReferenceBurst(uint16_t baseAddress);
+
800 
+
801 //*****************************************************************************
+
802 //
+
817 //
+
818 //*****************************************************************************
+
819 extern void ADC10_A_setReferenceBufferSamplingRate(uint16_t baseAddress,
+
820  uint16_t samplingRateSelect);
+
821 
+
822 //*****************************************************************************
+
823 //
+
836 //
+
837 //*****************************************************************************
+
838 extern void ADC10_A_setWindowComp(uint16_t baseAddress,
+
839  uint16_t highThreshold,
+
840  uint16_t lowThreshold);
+
841 
+
842 //*****************************************************************************
+
843 //
+
852 //
+
853 //*****************************************************************************
+
854 extern uint32_t ADC10_A_getMemoryAddressForDMA(uint16_t baseAddress);
+
855 
+
856 //*****************************************************************************
+
857 //
+
869 //
+
870 //*****************************************************************************
+
871 extern uint16_t ADC10_A_isBusy(uint16_t baseAddress);
+
872 
+
873 //*****************************************************************************
+
874 //
+
875 // Mark the end of the C bindings section for C++ compilers.
+
876 //
+
877 //*****************************************************************************
+
878 #ifdef __cplusplus
+
879 }
+
880 #endif
+
881 
+
882 #endif
+
883 #endif // __MSP430WARE_ADC10_A_H__
+ +
+
+ + + + diff --git a/Documentation/html/adc12__a_8c.html b/Documentation/html/adc12__a_8c.html new file mode 100644 index 0000000..511d7a0 --- /dev/null +++ b/Documentation/html/adc12__a_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc12_a.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc12_a.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/adc12__a_8c_source.html b/Documentation/html/adc12__a_8c_source.html new file mode 100644 index 0000000..ec8d171 --- /dev/null +++ b/Documentation/html/adc12__a_8c_source.html @@ -0,0 +1,347 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc12_a.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc12_a.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // adc12_a.c - Driver for the adc12_a Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_ADC12_PLUS__
+
17 #include "adc12_a.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 bool ADC12_A_init (uint16_t baseAddress,
+
22  uint16_t sampleHoldSignalSourceSelect,
+
23  uint8_t clockSourceSelect,
+
24  uint16_t clockSourceDivider)
+
25 {
+
26  //Make sure the ENC bit is cleared before initializing the ADC12_A
+
27  HWREG8(baseAddress + OFS_ADC12CTL0_L) &= ~ADC12ENC;
+
28 
+
29  bool retVal = STATUS_SUCCESS;
+
30 
+
31  //Turn OFF ADC12_A Module & Clear Interrupt Registers
+
32  HWREG16(baseAddress + OFS_ADC12CTL0) &= ~(ADC12ON + ADC12OVIE + ADC12TOVIE
+
33  + ADC12ENC + ADC12SC);
+
34  HWREG16(baseAddress + OFS_ADC12IE) &= 0x0000; //Reset ALL interrupt enables
+
35  HWREG16(baseAddress + OFS_ADC12IFG) &= 0x0000; //Reset ALL interrupt flags
+
36 
+
37  //Set ADC12_A Control 1
+
38  HWREG16(baseAddress + OFS_ADC12CTL1) =
+
39  sampleHoldSignalSourceSelect //Setup the Sample-and-Hold Source
+
40  + (clockSourceDivider & ADC12DIV_7) //Set Clock Divider
+
41  + clockSourceSelect; //Setup Clock Source
+
42 
+
43  //Set ADC12_A Control 2
+
44  HWREG16(baseAddress + OFS_ADC12CTL2) =
+
45  (clockSourceDivider & ADC12PDIV) //Set Clock Pre-Divider
+
46  + ADC12RES_2; //Default resolution to 12-bits
+
47 
+
48  return ( retVal) ;
+
49 }
+
50 
+
51 void ADC12_A_enable (uint16_t baseAddress)
+
52 {
+
53  //Enable the ADC12_A Module
+
54  HWREG8(baseAddress + OFS_ADC12CTL0_L) |= ADC12ON;
+
55 }
+
56 
+
57 void ADC12_A_disable (uint16_t baseAddress)
+
58 {
+
59  //Disable ADC12_A module
+
60  HWREG8(baseAddress + OFS_ADC12CTL0_L) &= ~ADC12ON;
+
61 }
+
62 
+
63 void ADC12_A_setupSamplingTimer (uint16_t baseAddress,
+
64  uint16_t clockCycleHoldCountLowMem,
+
65  uint16_t clockCycleHoldCountHighMem,
+
66  uint16_t multipleSamplesEnabled)
+
67 {
+
68  HWREG16(baseAddress + OFS_ADC12CTL1) |= ADC12SHP;
+
69 
+
70  //Reset clock cycle hold counts and msc bit before setting them
+
71  HWREG16(baseAddress + OFS_ADC12CTL0) &=
+
72  ~(ADC12SHT0_15 + ADC12SHT1_15 + ADC12MSC);
+
73 
+
74  //Set clock cycle hold counts and msc bit
+
75  HWREG16(baseAddress + OFS_ADC12CTL0) |= clockCycleHoldCountLowMem
+
76  + (clockCycleHoldCountHighMem << 4)
+
77  + multipleSamplesEnabled;
+
78 }
+
79 
+
80 
+
81 void ADC12_A_disableSamplingTimer (uint16_t baseAddress)
+
82 {
+
83  HWREG16(baseAddress + OFS_ADC12CTL1) &= ~(ADC12SHP);
+
84 }
+
85 
+
86 
+
87 void ADC12_A_configureMemory(uint16_t baseAddress,
+
88  ADC12_A_configureMemoryParam *param)
+
89 {
+
90  //Make sure the ENC bit is cleared before configuring a Memory Buffer Control
+
91  assert( !(HWREG16(baseAddress + OFS_ADC12CTL0) & ADC12ENC) );
+
92 
+
93  if(!(HWREG16(baseAddress + OFS_ADC12CTL0) & ADC12ENC))
+
94  {
+
95  //Set the offset in respect to ADC12MCTL0
+
96  uint16_t memoryBufferControlOffset =
+
97  (OFS_ADC12MCTL0 + param->memoryBufferControlIndex);
+
98 
+
99  //Reset the memory buffer control and Set the input source
+
100  HWREG8(baseAddress + memoryBufferControlOffset) =
+
101  param->inputSourceSelect //Set Input Source
+
102  + param->positiveRefVoltageSourceSelect //Set Vref+
+
103  + param->negativeRefVoltageSourceSelect //Set Vref-
+
104  + param->endOfSequence; //Set End of Sequence
+
105  }
+
106 }
+
107 void ADC12_A_enableInterrupt (uint16_t baseAddress,
+
108  uint32_t interruptMask)
+
109 {
+
110  if (interruptMask & ADC12_A_CONVERSION_TIME_OVERFLOW_IE) {
+
111  HWREG16(baseAddress + OFS_ADC12CTL0) |= ADC12TOVIE;
+
112  interruptMask &= ~ADC12_A_CONVERSION_TIME_OVERFLOW_IE;
+
113  }
+
114  if (interruptMask & ADC12_A_OVERFLOW_IE) {
+
115  HWREG16(baseAddress + OFS_ADC12CTL0) |= ADC12OVIE;
+
116  interruptMask &= ~ADC12_A_OVERFLOW_IE;
+
117  }
+
118 
+
119  HWREG16(baseAddress + OFS_ADC12IE) |= interruptMask;
+
120 }
+
121 
+
122 void ADC12_A_disableInterrupt (uint16_t baseAddress,
+
123  uint32_t interruptMask)
+
124 {
+
125  if (interruptMask & ADC12_A_CONVERSION_TIME_OVERFLOW_IE) {
+
126  HWREG16(baseAddress + OFS_ADC12CTL0) &= ~(ADC12TOVIE);
+
127  interruptMask &= ~ADC12_A_CONVERSION_TIME_OVERFLOW_IE;
+
128  }
+
129  if (interruptMask & ADC12_A_OVERFLOW_IE) {
+
130  HWREG16(baseAddress + OFS_ADC12CTL0) &= ~(ADC12OVIE);
+
131  interruptMask &= ~ADC12_A_OVERFLOW_IE;
+
132  }
+
133 
+
134  HWREG16(baseAddress + OFS_ADC12IE) &= ~(interruptMask);
+
135 }
+
136 
+
137 void ADC12_A_clearInterrupt (uint16_t baseAddress,
+
138  uint16_t memoryInterruptFlagMask)
+
139 {
+
140  HWREG16(baseAddress + OFS_ADC12IFG) &= ~(memoryInterruptFlagMask);
+
141 }
+
142 
+
143 uint16_t ADC12_A_getInterruptStatus (uint16_t baseAddress,
+
144  uint16_t memoryInterruptFlagMask)
+
145 {
+
146  return ( HWREG16(baseAddress + OFS_ADC12IFG) & memoryInterruptFlagMask );
+
147 }
+
148 
+
149 void ADC12_A_startConversion (uint16_t baseAddress,
+
150  uint16_t startingMemoryBufferIndex,
+
151  uint8_t conversionSequenceModeSelect)
+
152 {
+
153  //Reset the ENC bit to set the starting memory address and conversion mode
+
154  //sequence
+
155  HWREG8(baseAddress + OFS_ADC12CTL0_L) &= ~(ADC12ENC);
+
156  //Reset the bits about to be set
+
157  HWREG16(baseAddress + OFS_ADC12CTL1) &= ~(ADC12CSTARTADD_15 + ADC12CONSEQ_3);
+
158 
+
159  HWREG8(baseAddress + OFS_ADC12CTL1_H) |= (startingMemoryBufferIndex << 4);
+
160  HWREG8(baseAddress + OFS_ADC12CTL1_L) |= conversionSequenceModeSelect;
+
161  HWREG8(baseAddress + OFS_ADC12CTL0_L) |= ADC12ENC + ADC12SC;
+
162 }
+
163 
+
164 void ADC12_A_disableConversions (uint16_t baseAddress, bool preempt)
+
165 {
+
166  if (ADC12_A_PREEMPTCONVERSION == preempt) {
+
167  HWREG8(baseAddress + OFS_ADC12CTL1_L) &= ~(ADC12CONSEQ_3);
+
168  //Reset conversion sequence mode to single-channel, single-conversion
+
169  }
+
170  else if (~(HWREG8(baseAddress + OFS_ADC12CTL1_L) & ADC12CONSEQ_3)) {
+
171  //To prevent preemoption of a single-channel, single-conversion we must
+
172  //wait for the ADC core to finish the conversion.
+
173  while (ADC12_A_isBusy(baseAddress)) ;
+
174  }
+
175 
+
176  HWREG8(baseAddress + OFS_ADC12CTL0_L) &= ~(ADC12ENC);
+
177 }
+
178 
+
179 uint16_t ADC12_A_getResults (uint16_t baseAddress, uint8_t memoryBufferIndex)
+
180 {
+
181  //(0x20 + (memoryBufferIndex * 2)) == offset of ADC12MEMx
+
182  return ( HWREG16(baseAddress + (0x20 + (memoryBufferIndex * 2))) );
+
183 }
+
184 
+
185 void ADC12_A_setResolution (uint16_t baseAddress,
+
186  uint8_t resolutionSelect)
+
187 {
+
188  HWREG8(baseAddress + OFS_ADC12CTL2_L) &= ~(ADC12RES_3);
+
189  HWREG8(baseAddress + OFS_ADC12CTL2_L) |= resolutionSelect;
+
190 }
+
191 
+
192 void ADC12_A_setSampleHoldSignalInversion (uint16_t baseAddress,
+
193  uint16_t invertedSignal)
+
194 {
+
195  HWREG16(baseAddress + OFS_ADC12CTL1) &= ~(ADC12ISSH);
+
196  HWREG16(baseAddress + OFS_ADC12CTL1) |= invertedSignal;
+
197 }
+
198 
+
199 void ADC12_A_setDataReadBackFormat (uint16_t baseAddress,
+
200  uint8_t readBackFormat)
+
201 {
+
202  HWREG8(baseAddress + OFS_ADC12CTL2_L) &= ~(ADC12DF);
+
203  HWREG8(baseAddress + OFS_ADC12CTL2_L) |= readBackFormat;
+
204 }
+
205 
+
206 void ADC12_A_enableReferenceBurst (uint16_t baseAddress)
+
207 {
+
208  HWREG8(baseAddress + OFS_ADC12CTL2_L) |= ADC12REFBURST;
+
209 }
+
210 
+
211 void ADC12_A_disableReferenceBurst (uint16_t baseAddress)
+
212 {
+
213  HWREG8(baseAddress + OFS_ADC12CTL2_L) &= ~(ADC12REFBURST);
+
214 }
+
215 
+
216 void ADC12_A_setReferenceBufferSamplingRate (uint16_t baseAddress,
+
217  uint8_t samplingRateSelect)
+
218 {
+
219  HWREG8(baseAddress + OFS_ADC12CTL2_L) &= ~(ADC12SR);
+
220  HWREG8(baseAddress + OFS_ADC12CTL2_L) |= samplingRateSelect;
+
221 }
+
222 
+
223 uint32_t ADC12_A_getMemoryAddressForDMA (uint16_t baseAddress,
+
224  uint8_t memoryIndex)
+
225 {
+
226  return ( baseAddress + (0x20 + (memoryIndex * 2)) );
+
227 }
+
228 
+
229 uint16_t ADC12_A_isBusy (uint16_t baseAddress)
+
230 {
+
231  return (HWREG8(baseAddress + OFS_ADC12CTL1_L) & ADC12BUSY);
+
232 }
+
233 
+
234 
+
235 #endif
+
236 //*****************************************************************************
+
237 //
+
240 //
+
241 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/adc12__a_8h.html b/Documentation/html/adc12__a_8h.html new file mode 100644 index 0000000..69ba2fb --- /dev/null +++ b/Documentation/html/adc12__a_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc12_a.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc12_a.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/adc12__a_8h_source.html b/Documentation/html/adc12__a_8h_source.html new file mode 100644 index 0000000..981c39b --- /dev/null +++ b/Documentation/html/adc12__a_8h_source.html @@ -0,0 +1,574 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/adc12_a.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc12_a.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // adc12_a.h - Driver for the ADC12_A Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_ADC12_A_H__
+
8 #define __MSP430WARE_ADC12_A_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_ADC12_PLUS__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
30 //
+
31 //*****************************************************************************
+
32 typedef struct ADC12_A_configureMemoryParam {
+
51  uint8_t memoryBufferControlIndex;
+
71  uint8_t inputSourceSelect;
+
78  uint8_t positiveRefVoltageSourceSelect;
+
84  uint8_t negativeRefVoltageSourceSelect;
+
93  uint8_t endOfSequence;
+
94 } ADC12_A_configureMemoryParam;
+
95 
+
96 
+
97 //*****************************************************************************
+
98 //
+
99 // The following are values that can be passed to the clockSourceSelect
+
100 // parameter for functions: ADC12_A_init().
+
101 //
+
102 //*****************************************************************************
+
103 #define ADC12_A_CLOCKSOURCE_ADC12OSC (ADC12SSEL_0)
+
104 #define ADC12_A_CLOCKSOURCE_ACLK (ADC12SSEL_1)
+
105 #define ADC12_A_CLOCKSOURCE_MCLK (ADC12SSEL_2)
+
106 #define ADC12_A_CLOCKSOURCE_SMCLK (ADC12SSEL_3)
+
107 
+
108 //*****************************************************************************
+
109 //
+
110 // The following are values that can be passed to the clockSourceDivider
+
111 // parameter for functions: ADC12_A_init().
+
112 //
+
113 //*****************************************************************************
+
114 #define ADC12_A_CLOCKDIVIDER_1 (ADC12DIV_0)
+
115 #define ADC12_A_CLOCKDIVIDER_2 (ADC12DIV_1)
+
116 #define ADC12_A_CLOCKDIVIDER_3 (ADC12DIV_2)
+
117 #define ADC12_A_CLOCKDIVIDER_4 (ADC12DIV_3)
+
118 #define ADC12_A_CLOCKDIVIDER_5 (ADC12DIV_4)
+
119 #define ADC12_A_CLOCKDIVIDER_6 (ADC12DIV_5)
+
120 #define ADC12_A_CLOCKDIVIDER_7 (ADC12DIV_6)
+
121 #define ADC12_A_CLOCKDIVIDER_8 (ADC12DIV_7)
+
122 #define ADC12_A_CLOCKDIVIDER_12 (ADC12DIV_2 + ADC12PDIV)
+
123 #define ADC12_A_CLOCKDIVIDER_16 (ADC12DIV_3 + ADC12PDIV)
+
124 #define ADC12_A_CLOCKDIVIDER_20 (ADC12DIV_4 + ADC12PDIV)
+
125 #define ADC12_A_CLOCKDIVIDER_24 (ADC12DIV_5 + ADC12PDIV)
+
126 #define ADC12_A_CLOCKDIVIDER_28 (ADC12DIV_6 + ADC12PDIV)
+
127 #define ADC12_A_CLOCKDIVIDER_32 (ADC12DIV_7 + ADC12PDIV)
+
128 
+
129 //*****************************************************************************
+
130 //
+
131 // The following are values that can be passed to the
+
132 // sampleHoldSignalSourceSelect parameter for functions: ADC12_A_init().
+
133 //
+
134 //*****************************************************************************
+
135 #define ADC12_A_SAMPLEHOLDSOURCE_SC (ADC12SHS_0)
+
136 #define ADC12_A_SAMPLEHOLDSOURCE_1 (ADC12SHS_1)
+
137 #define ADC12_A_SAMPLEHOLDSOURCE_2 (ADC12SHS_2)
+
138 #define ADC12_A_SAMPLEHOLDSOURCE_3 (ADC12SHS_3)
+
139 
+
140 //*****************************************************************************
+
141 //
+
142 // The following are values that can be passed to the clockCycleHoldCountLowMem
+
143 // parameter for functions: ADC12_A_setupSamplingTimer(); the
+
144 // clockCycleHoldCountHighMem parameter for functions:
+
145 // ADC12_A_setupSamplingTimer().
+
146 //
+
147 //*****************************************************************************
+
148 #define ADC12_A_CYCLEHOLD_4_CYCLES (ADC12SHT0_0)
+
149 #define ADC12_A_CYCLEHOLD_8_CYCLES (ADC12SHT0_1)
+
150 #define ADC12_A_CYCLEHOLD_16_CYCLES (ADC12SHT0_2)
+
151 #define ADC12_A_CYCLEHOLD_32_CYCLES (ADC12SHT0_3)
+
152 #define ADC12_A_CYCLEHOLD_64_CYCLES (ADC12SHT0_4)
+
153 #define ADC12_A_CYCLEHOLD_96_CYCLES (ADC12SHT0_5)
+
154 #define ADC12_A_CYCLEHOLD_128_CYCLES (ADC12SHT0_6)
+
155 #define ADC12_A_CYCLEHOLD_192_CYCLES (ADC12SHT0_7)
+
156 #define ADC12_A_CYCLEHOLD_256_CYCLES (ADC12SHT0_8)
+
157 #define ADC12_A_CYCLEHOLD_384_CYCLES (ADC12SHT0_9)
+
158 #define ADC12_A_CYCLEHOLD_512_CYCLES (ADC12SHT0_10)
+
159 #define ADC12_A_CYCLEHOLD_768_CYCLES (ADC12SHT0_11)
+
160 #define ADC12_A_CYCLEHOLD_1024_CYCLES (ADC12SHT0_12)
+
161 
+
162 //*****************************************************************************
+
163 //
+
164 // The following are values that can be passed to the multipleSamplesEnabled
+
165 // parameter for functions: ADC12_A_setupSamplingTimer().
+
166 //
+
167 //*****************************************************************************
+
168 #define ADC12_A_MULTIPLESAMPLESDISABLE (!(ADC12MSC))
+
169 #define ADC12_A_MULTIPLESAMPLESENABLE (ADC12MSC)
+
170 
+
171 //*****************************************************************************
+
172 //
+
173 // The following are values that can be passed to the param parameter for
+
174 // functions: ADC12_A_configureMemory().
+
175 //
+
176 //*****************************************************************************
+
177 #define ADC12_A_VREFPOS_AVCC (!(ADC12SREF0 + ADC12SREF1))
+
178 #define ADC12_A_VREFPOS_EXT (ADC12SREF1)
+
179 #define ADC12_A_VREFPOS_INT (ADC12SREF0)
+
180 
+
181 //*****************************************************************************
+
182 //
+
183 // The following are values that can be passed to the param parameter for
+
184 // functions: ADC12_A_configureMemory().
+
185 //
+
186 //*****************************************************************************
+
187 #define ADC12_A_VREFNEG_AVSS (!(ADC12SREF2))
+
188 #define ADC12_A_VREFNEG_EXT (ADC12SREF2)
+
189 
+
190 //*****************************************************************************
+
191 //
+
192 // The following are values that can be passed to the param parameter for
+
193 // functions: ADC12_A_configureMemory().
+
194 //
+
195 //*****************************************************************************
+
196 #define ADC12_A_NOTENDOFSEQUENCE (!(ADC12EOS))
+
197 #define ADC12_A_ENDOFSEQUENCE (ADC12EOS)
+
198 
+
199 //*****************************************************************************
+
200 //
+
201 // The following are values that can be passed to the param parameter for
+
202 // functions: ADC12_A_configureMemory().
+
203 //
+
204 //*****************************************************************************
+
205 #define ADC12_A_INPUT_A0 (ADC12INCH_0)
+
206 #define ADC12_A_INPUT_A1 (ADC12INCH_1)
+
207 #define ADC12_A_INPUT_A2 (ADC12INCH_2)
+
208 #define ADC12_A_INPUT_A3 (ADC12INCH_3)
+
209 #define ADC12_A_INPUT_A4 (ADC12INCH_4)
+
210 #define ADC12_A_INPUT_A5 (ADC12INCH_5)
+
211 #define ADC12_A_INPUT_A6 (ADC12INCH_6)
+
212 #define ADC12_A_INPUT_A7 (ADC12INCH_7)
+
213 #define ADC12_A_INPUT_A8 (ADC12INCH_8)
+
214 #define ADC12_A_INPUT_A9 (ADC12INCH_9)
+
215 #define ADC12_A_INPUT_TEMPSENSOR (ADC12INCH_10)
+
216 #define ADC12_A_INPUT_BATTERYMONITOR (ADC12INCH_11)
+
217 #define ADC12_A_INPUT_A12 (ADC12INCH_12)
+
218 #define ADC12_A_INPUT_A13 (ADC12INCH_13)
+
219 #define ADC12_A_INPUT_A14 (ADC12INCH_14)
+
220 #define ADC12_A_INPUT_A15 (ADC12INCH_15)
+
221 
+
222 //*****************************************************************************
+
223 //
+
224 // The following are values that can be passed to the startingMemoryBufferIndex
+
225 // parameter for functions: ADC12_A_startConversion(); the memoryIndex
+
226 // parameter for functions: ADC12_A_getMemoryAddressForDMA(); the
+
227 // memoryBufferIndex parameter for functions: ADC12_A_getResults(); the param
+
228 // parameter for functions: ADC12_A_configureMemory().
+
229 //
+
230 //*****************************************************************************
+
231 #define ADC12_A_MEMORY_0 (0x0)
+
232 #define ADC12_A_MEMORY_1 (0x1)
+
233 #define ADC12_A_MEMORY_2 (0x2)
+
234 #define ADC12_A_MEMORY_3 (0x3)
+
235 #define ADC12_A_MEMORY_4 (0x4)
+
236 #define ADC12_A_MEMORY_5 (0x5)
+
237 #define ADC12_A_MEMORY_6 (0x6)
+
238 #define ADC12_A_MEMORY_7 (0x7)
+
239 #define ADC12_A_MEMORY_8 (0x8)
+
240 #define ADC12_A_MEMORY_9 (0x9)
+
241 #define ADC12_A_MEMORY_10 (0xA)
+
242 #define ADC12_A_MEMORY_11 (0xB)
+
243 #define ADC12_A_MEMORY_12 (0xC)
+
244 #define ADC12_A_MEMORY_13 (0xD)
+
245 #define ADC12_A_MEMORY_14 (0xE)
+
246 #define ADC12_A_MEMORY_15 (0xF)
+
247 
+
248 //*****************************************************************************
+
249 //
+
250 // The following are values that can be passed to the memoryInterruptFlagMask
+
251 // parameter for functions: ADC12_A_clearInterrupt(), and
+
252 // ADC12_A_getInterruptStatus().
+
253 //
+
254 //*****************************************************************************
+
255 #define ADC12_A_IFG0 (ADC12IFG0)
+
256 #define ADC12_A_IFG1 (ADC12IFG1)
+
257 #define ADC12_A_IFG2 (ADC12IFG2)
+
258 #define ADC12_A_IFG3 (ADC12IFG3)
+
259 #define ADC12_A_IFG4 (ADC12IFG4)
+
260 #define ADC12_A_IFG5 (ADC12IFG5)
+
261 #define ADC12_A_IFG6 (ADC12IFG6)
+
262 #define ADC12_A_IFG7 (ADC12IFG7)
+
263 #define ADC12_A_IFG8 (ADC12IFG8)
+
264 #define ADC12_A_IFG9 (ADC12IFG9)
+
265 #define ADC12_A_IFG10 (ADC12IFG10)
+
266 #define ADC12_A_IFG11 (ADC12IFG11)
+
267 #define ADC12_A_IFG12 (ADC12IFG12)
+
268 #define ADC12_A_IFG13 (ADC12IFG13)
+
269 #define ADC12_A_IFG14 (ADC12IFG14)
+
270 #define ADC12_A_IFG15 (ADC12IFG15)
+
271 
+
272 //*****************************************************************************
+
273 //
+
274 // The following are values that can be passed to the
+
275 // conversionSequenceModeSelect parameter for functions:
+
276 // ADC12_A_startConversion().
+
277 //
+
278 //*****************************************************************************
+
279 #define ADC12_A_SINGLECHANNEL (ADC12CONSEQ_0)
+
280 #define ADC12_A_SEQOFCHANNELS (ADC12CONSEQ_1)
+
281 #define ADC12_A_REPEATED_SINGLECHANNEL (ADC12CONSEQ_2)
+
282 #define ADC12_A_REPEATED_SEQOFCHANNELS (ADC12CONSEQ_3)
+
283 
+
284 //*****************************************************************************
+
285 //
+
286 // The following are values that can be passed to the preempt parameter for
+
287 // functions: ADC12_A_disableConversions().
+
288 //
+
289 //*****************************************************************************
+
290 #define ADC12_A_COMPLETECONVERSION false
+
291 #define ADC12_A_PREEMPTCONVERSION true
+
292 
+
293 //*****************************************************************************
+
294 //
+
295 // The following are values that can be passed to the resolutionSelect
+
296 // parameter for functions: ADC12_A_setResolution().
+
297 //
+
298 //*****************************************************************************
+
299 #define ADC12_A_RESOLUTION_8BIT (ADC12RES_0)
+
300 #define ADC12_A_RESOLUTION_10BIT (ADC12RES_1)
+
301 #define ADC12_A_RESOLUTION_12BIT (ADC12RES_2)
+
302 
+
303 //*****************************************************************************
+
304 //
+
305 // The following are values that can be passed to the invertedSignal parameter
+
306 // for functions: ADC12_A_setSampleHoldSignalInversion().
+
307 //
+
308 //*****************************************************************************
+
309 #define ADC12_A_NONINVERTEDSIGNAL (!(ADC12ISSH))
+
310 #define ADC12_A_INVERTEDSIGNAL (ADC12ISSH)
+
311 
+
312 //*****************************************************************************
+
313 //
+
314 // The following are values that can be passed to the readBackFormat parameter
+
315 // for functions: ADC12_A_setDataReadBackFormat().
+
316 //
+
317 //*****************************************************************************
+
318 #define ADC12_A_UNSIGNED_BINARY (!(ADC12DF))
+
319 #define ADC12_A_SIGNED_2SCOMPLEMENT (ADC12DF)
+
320 
+
321 //*****************************************************************************
+
322 //
+
323 // The following are values that can be passed to the samplingRateSelect
+
324 // parameter for functions: ADC12_A_setReferenceBufferSamplingRate().
+
325 //
+
326 //*****************************************************************************
+
327 #define ADC12_A_MAXSAMPLINGRATE_200KSPS (!(ADC12SR))
+
328 #define ADC12_A_MAXSAMPLINGRATE_50KSPS (ADC12SR)
+
329 
+
330 //*****************************************************************************
+
331 //
+
332 // The following are values that can be passed toThe following are values that
+
333 // can be returned by the ADC12_A_isBusy() function.
+
334 //
+
335 //*****************************************************************************
+
336 #define ADC12_A_NOTBUSY 0x00
+
337 #define ADC12_A_BUSY ADC12BUSY
+
338 
+
339 //*****************************************************************************
+
340 //
+
341 // The following are values that can be passed to the interruptMask parameter
+
342 // for functions: ADC12_A_enableInterrupt(), and ADC12_A_disableInterrupt().
+
343 //
+
344 //*****************************************************************************
+
345 #define ADC12_A_IE0 (ADC12IE0)
+
346 #define ADC12_A_IE1 (ADC12IE1)
+
347 #define ADC12_A_IE2 (ADC12IE2)
+
348 #define ADC12_A_IE3 (ADC12IE3)
+
349 #define ADC12_A_IE4 (ADC12IE4)
+
350 #define ADC12_A_IE5 (ADC12IE5)
+
351 #define ADC12_A_IE6 (ADC12IE6)
+
352 #define ADC12_A_IE7 (ADC12IE7)
+
353 #define ADC12_A_IE8 (ADC12IE8)
+
354 #define ADC12_A_IE9 (ADC12IE9)
+
355 #define ADC12_A_IE10 (ADC12IE10)
+
356 #define ADC12_A_IE11 (ADC12IE11)
+
357 #define ADC12_A_IE12 (ADC12IE12)
+
358 #define ADC12_A_IE13 (ADC12IE13)
+
359 #define ADC12_A_IE14 (ADC12IE14)
+
360 #define ADC12_A_IE15 (ADC12IE15)
+
361 #define ADC12_A_OVERFLOW_IE ((uint32_t)ADC12OVIE << 16)
+
362 #define ADC12_A_CONVERSION_TIME_OVERFLOW_IE ((uint32_t)ADC12TOVIE << 16)
+
363 
+
364 //*****************************************************************************
+
365 //
+
366 // Prototypes for the APIs.
+
367 //
+
368 //*****************************************************************************
+
369 
+
370 //*****************************************************************************
+
371 //
+
428 //
+
429 //*****************************************************************************
+
430 extern bool ADC12_A_init(uint16_t baseAddress,
+
431  uint16_t sampleHoldSignalSourceSelect,
+
432  uint8_t clockSourceSelect,
+
433  uint16_t clockSourceDivider);
+
434 
+
435 //*****************************************************************************
+
436 //
+
446 //
+
447 //*****************************************************************************
+
448 extern void ADC12_A_enable(uint16_t baseAddress);
+
449 
+
450 //*****************************************************************************
+
451 //
+
461 //
+
462 //*****************************************************************************
+
463 extern void ADC12_A_disable(uint16_t baseAddress);
+
464 
+
465 //*****************************************************************************
+
466 //
+
524 //
+
525 //*****************************************************************************
+
526 extern void ADC12_A_setupSamplingTimer(uint16_t baseAddress,
+
527  uint16_t clockCycleHoldCountLowMem,
+
528  uint16_t clockCycleHoldCountHighMem,
+
529  uint16_t multipleSamplesEnabled);
+
530 
+
531 //*****************************************************************************
+
532 //
+
544 //
+
545 //*****************************************************************************
+
546 extern void ADC12_A_disableSamplingTimer(uint16_t baseAddress);
+
547 
+
548 //*****************************************************************************
+
549 //
+
565 //
+
566 //*****************************************************************************
+
567 extern void ADC12_A_configureMemory(uint16_t baseAddress,
+
568  ADC12_A_configureMemoryParam *param);
+
569 
+
570 //*****************************************************************************
+
571 //
+
603 //
+
604 //*****************************************************************************
+
605 extern void ADC12_A_enableInterrupt(uint16_t baseAddress,
+
606  uint32_t interruptMask);
+
607 
+
608 //*****************************************************************************
+
609 //
+
641 //
+
642 //*****************************************************************************
+
643 extern void ADC12_A_disableInterrupt(uint16_t baseAddress,
+
644  uint32_t interruptMask);
+
645 
+
646 //*****************************************************************************
+
647 //
+
680 //
+
681 //*****************************************************************************
+
682 extern void ADC12_A_clearInterrupt(uint16_t baseAddress,
+
683  uint16_t memoryInterruptFlagMask);
+
684 
+
685 //*****************************************************************************
+
686 //
+
715 //
+
716 //*****************************************************************************
+
717 extern uint16_t ADC12_A_getInterruptStatus(uint16_t baseAddress,
+
718  uint16_t memoryInterruptFlagMask);
+
719 
+
720 //*****************************************************************************
+
721 //
+
779 //
+
780 //*****************************************************************************
+
781 extern void ADC12_A_startConversion(uint16_t baseAddress,
+
782  uint16_t startingMemoryBufferIndex,
+
783  uint8_t conversionSequenceModeSelect);
+
784 
+
785 //*****************************************************************************
+
786 //
+
813 //
+
814 //*****************************************************************************
+
815 extern void ADC12_A_disableConversions(uint16_t baseAddress,
+
816  bool preempt);
+
817 
+
818 //*****************************************************************************
+
819 //
+
850 //
+
851 //*****************************************************************************
+
852 extern uint16_t ADC12_A_getResults(uint16_t baseAddress,
+
853  uint8_t memoryBufferIndex);
+
854 
+
855 //*****************************************************************************
+
856 //
+
871 //
+
872 //*****************************************************************************
+
873 extern void ADC12_A_setResolution(uint16_t baseAddress,
+
874  uint8_t resolutionSelect);
+
875 
+
876 //*****************************************************************************
+
877 //
+
897 //
+
898 //*****************************************************************************
+
899 extern void ADC12_A_setSampleHoldSignalInversion(uint16_t baseAddress,
+
900  uint16_t invertedSignal);
+
901 
+
902 //*****************************************************************************
+
903 //
+
922 //
+
923 //*****************************************************************************
+
924 extern void ADC12_A_setDataReadBackFormat(uint16_t baseAddress,
+
925  uint8_t readBackFormat);
+
926 
+
927 //*****************************************************************************
+
928 //
+
938 //
+
939 //*****************************************************************************
+
940 extern void ADC12_A_enableReferenceBurst(uint16_t baseAddress);
+
941 
+
942 //*****************************************************************************
+
943 //
+
952 //
+
953 //*****************************************************************************
+
954 extern void ADC12_A_disableReferenceBurst(uint16_t baseAddress);
+
955 
+
956 //*****************************************************************************
+
957 //
+
972 //
+
973 //*****************************************************************************
+
974 extern void ADC12_A_setReferenceBufferSamplingRate(uint16_t baseAddress,
+
975  uint8_t samplingRateSelect);
+
976 
+
977 //*****************************************************************************
+
978 //
+
1006 //
+
1007 //*****************************************************************************
+
1008 extern uint32_t ADC12_A_getMemoryAddressForDMA(uint16_t baseAddress,
+
1009  uint8_t memoryIndex);
+
1010 
+
1011 //*****************************************************************************
+
1012 //
+
1024 //
+
1025 //*****************************************************************************
+
1026 extern uint16_t ADC12_A_isBusy(uint16_t baseAddress);
+
1027 
+
1028 //*****************************************************************************
+
1029 //
+
1030 // Mark the end of the C bindings section for C++ compilers.
+
1031 //
+
1032 //*****************************************************************************
+
1033 #ifdef __cplusplus
+
1034 }
+
1035 #endif
+
1036 
+
1037 #endif
+
1038 #endif // __MSP430WARE_ADC12_A_H__
+ +
+
+ + + + diff --git a/Documentation/html/aes_8c.html b/Documentation/html/aes_8c.html new file mode 100644 index 0000000..09876e9 --- /dev/null +++ b/Documentation/html/aes_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/aes.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
aes.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/aes_8c_source.html b/Documentation/html/aes_8c_source.html new file mode 100644 index 0000000..81034f7 --- /dev/null +++ b/Documentation/html/aes_8c_source.html @@ -0,0 +1,452 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/aes.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
aes.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // aes.c - Driver for the aes Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_AES__
+
17 #include "aes.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 uint8_t AES_setCipherKey (uint16_t baseAddress,
+
22  const uint8_t * CipherKey
+
23  )
+
24 {
+
25  uint8_t i = 0;
+
26  uint16_t tempVariable = 0;
+
27 
+
28  // Wait until AES accelerator is busy
+
29  while(AESBUSY == (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY) );
+
30 
+
31  for (i = 0; i < 16; i = i + 2)
+
32  {
+
33  tempVariable = (uint16_t)(CipherKey[i]);
+
34  tempVariable = tempVariable | ((uint16_t)(CipherKey[i + 1]) << 8);
+
35  HWREG16(baseAddress + OFS_AESAKEY) = tempVariable;
+
36  }
+
37 
+
38  // Wait until key is written
+
39  while(0x00 == (HWREG16(baseAddress + OFS_AESASTAT) & AESKEYWR ));
+
40 
+
41  return STATUS_SUCCESS;
+
42 }
+
43 
+
44 uint8_t AES_encryptData (uint16_t baseAddress,
+
45  const uint8_t * Data,
+
46  uint8_t * encryptedData)
+
47 {
+
48  uint8_t i;
+
49  uint16_t tempData = 0;
+
50  uint16_t tempVariable = 0;
+
51 
+
52  // Set module to encrypt mode
+
53  HWREG16(baseAddress + OFS_AESACTL0) &= ~AESOP_3;
+
54 
+
55  // Write data to encrypt to module
+
56  for (i = 0; i < 16; i = i + 2)
+
57  {
+
58 
+
59  tempVariable = (uint16_t)(Data[i]);
+
60  tempVariable = tempVariable | ((uint16_t)(Data[i+1]) << 8);
+
61  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
62  }
+
63 
+
64  // Key that is already written shall be used
+
65  // Encryption is initialized by setting AESKEYWR to 1
+
66  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
67 
+
68  // Wait unit finished ~167 MCLK
+
69  while(AESBUSY == (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY) );
+
70 
+
71  // Write encrypted data back to variable
+
72  for (i = 0; i < 16; i = i + 2)
+
73  {
+
74  tempData = HWREG16(baseAddress + OFS_AESADOUT);
+
75  *(encryptedData + i) = (uint8_t)tempData;
+
76  *(encryptedData +i + 1) = (uint8_t)(tempData >> 8);
+
77 
+
78  }
+
79 
+
80  return STATUS_SUCCESS;
+
81 }
+
82 
+
83 uint8_t AES_decryptData (uint16_t baseAddress,
+
84  const uint8_t * Data,
+
85  uint8_t * decryptedData)
+
86 {
+
87  uint8_t i;
+
88  uint16_t tempData = 0;
+
89  uint16_t tempVariable = 0;
+
90 
+
91  // Set module to decrypt mode
+
92  HWREG16(baseAddress + OFS_AESACTL0) |= (AESOP_3);
+
93 
+
94  // Write data to decrypt to module
+
95  for (i = 0; i < 16; i = i + 2)
+
96  {
+
97  tempVariable = (uint16_t)(Data[i+1] << 8);
+
98  tempVariable = tempVariable | ((uint16_t)(Data[i]));
+
99  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
100  }
+
101 
+
102  // Key that is already written shall be used
+
103  // Now decryption starts
+
104  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
105 
+
106  // Wait unit finished ~167 MCLK
+
107  while(AESBUSY == (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY ));
+
108 
+
109  // Write encrypted data back to variable
+
110  for (i = 0; i < 16; i = i + 2)
+
111  {
+
112  tempData = HWREG16(baseAddress + OFS_AESADOUT);
+
113  *(decryptedData + i ) = (uint8_t)tempData;
+
114  *(decryptedData +i + 1) = (uint8_t)(tempData >> 8);
+
115  }
+
116 
+
117  return STATUS_SUCCESS;
+
118 }
+
119 
+
120 uint8_t AES_setDecipherKey (uint16_t baseAddress,
+
121  const uint8_t * CipherKey)
+
122 {
+
123  uint8_t i;
+
124  uint16_t tempVariable = 0;
+
125 
+
126  // Set module to decrypt mode
+
127  HWREG16(baseAddress + OFS_AESACTL0) &= ~(AESOP0);
+
128  HWREG16(baseAddress + OFS_AESACTL0) |= AESOP1;
+
129 
+
130  // Write cipher key to key register
+
131  for (i = 0; i < 16; i = i + 2)
+
132  {
+
133  tempVariable = (uint16_t)(CipherKey[i]);
+
134  tempVariable = tempVariable | ((uint16_t)(CipherKey[i + 1]) << 8);
+
135  HWREG16(baseAddress + OFS_AESAKEY) = tempVariable;
+
136  }
+
137 
+
138  // Wait until key is processed ~52 MCLK
+
139  while((HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY) == AESBUSY);
+
140 
+
141  return STATUS_SUCCESS;
+
142 }
+
143 
+
144 void AES_clearInterrupt (uint16_t baseAddress )
+
145 {
+
146  HWREG8(baseAddress + OFS_AESACTL0) &= ~AESRDYIFG;
+
147 }
+
148 
+
149 uint32_t AES_getInterruptStatus (uint16_t baseAddress)
+
150 {
+
151  return ((HWREG8(baseAddress + OFS_AESACTL0) & AESRDYIFG) << 0x04);
+
152 }
+
153 
+
154 void AES_enableInterrupt (uint16_t baseAddress)
+
155 {
+
156  HWREG8(baseAddress + OFS_AESACTL0) |= AESRDYIE;
+
157 }
+
158 
+
159 void AES_disableInterrupt (uint16_t baseAddress)
+
160 {
+
161  HWREG8(baseAddress + OFS_AESACTL0) &= ~AESRDYIE;
+
162 }
+
163 
+
164 void AES_reset (uint16_t baseAddress)
+
165 {
+
166  HWREG8(baseAddress + OFS_AESACTL0) |= AESSWRST;
+
167 }
+
168 
+
169 uint8_t AES_startEncryptData (uint16_t baseAddress,
+
170  const uint8_t * Data,
+
171  uint8_t * encryptedData)
+
172 {
+
173  uint8_t i;
+
174  uint16_t tempVariable = 0;
+
175 
+
176  // Set module to encrypt mode
+
177  HWREG16(baseAddress + OFS_AESACTL0) &= ~AESOP_3;
+
178 
+
179  // Write data to encrypt to module
+
180  for (i = 0; i < 16; i = i + 2)
+
181  {
+
182  tempVariable = (uint16_t)(Data[i]);
+
183  tempVariable = tempVariable | ((uint16_t)(Data[i+1]) << 8);
+
184  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
185  }
+
186 
+
187  // Key that is already written shall be used
+
188  // Encryption is initialized by setting AESKEYWR to 1
+
189  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
190 
+
191  return STATUS_SUCCESS;
+
192 }
+
193 
+
194 uint8_t AES_startDecryptData (uint16_t baseAddress,
+
195  const uint8_t * Data)
+
196 {
+
197  uint8_t i;
+
198  uint16_t tempVariable = 0;
+
199 
+
200  // Set module to decrypt mode
+
201  HWREG16(baseAddress + OFS_AESACTL0) |= (AESOP_3);
+
202 
+
203  // Write data to decrypt to module
+
204  for (i = 0; i < 16; i = i + 2)
+
205  {
+
206  tempVariable = (uint16_t)(Data[i+1] << 8);
+
207  tempVariable = tempVariable | ((uint16_t)(Data[i]));
+
208  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
209  }
+
210 
+
211  // Key that is already written shall be used
+
212  // Now decryption starts
+
213  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
214 
+
215  return STATUS_SUCCESS;
+
216 }
+
217 
+
218 uint8_t AES_startSetDecipherKey (uint16_t baseAddress,
+
219  const uint8_t * CipherKey)
+
220 {
+
221  uint8_t i;
+
222  uint16_t tempVariable = 0;
+
223 
+
224  HWREG16(baseAddress + OFS_AESACTL0) &= ~(AESOP0);
+
225  HWREG16(baseAddress + OFS_AESACTL0) |= AESOP1;
+
226 
+
227  // Write cipher key to key register
+
228  for (i = 0; i < 16; i = i + 2)
+
229  {
+
230  tempVariable = (uint16_t)(CipherKey[i]);
+
231  tempVariable = tempVariable | ((uint16_t)(CipherKey[i+1]) << 8);
+
232  HWREG16(baseAddress + OFS_AESAKEY) = tempVariable;
+
233  }
+
234 
+
235  return STATUS_SUCCESS;
+
236 }
+
237 
+
238 uint8_t AES_getDataOut(uint16_t baseAddress,
+
239  uint8_t *OutputData
+
240  )
+
241 {
+
242  uint8_t i;
+
243  uint16_t tempData = 0;
+
244 
+
245  // If module is busy, exit and return failure
+
246  if( AESBUSY == (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY))
+
247  return STATUS_FAIL;
+
248 
+
249  // Write encrypted data back to variable
+
250  for (i = 0; i < 16; i = i + 2)
+
251  {
+
252  tempData = HWREG16(baseAddress + OFS_AESADOUT);
+
253  *(OutputData + i) = (uint8_t)tempData;
+
254  *(OutputData +i + 1) = (uint8_t)(tempData >> 8);
+
255  }
+
256 
+
257  return STATUS_SUCCESS;
+
258 }
+
259 
+
260 uint8_t AES_isBusy (uint16_t baseAddress)
+
261 {
+
262  return (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY);
+
263 }
+
264 
+
265 void AES_clearErrorFlag (uint16_t baseAddress )
+
266 {
+
267  HWREG8(baseAddress + OFS_AESACTL0) &= ~AESERRFG;
+
268 }
+
269 
+
270 uint32_t AES_getErrorFlagStatus (uint16_t baseAddress)
+
271 {
+
272  return (HWREG8(baseAddress + OFS_AESACTL0) & AESERRFG);
+
273 }
+
274 
+
275 uint8_t AES_startDecryptDataUsingEncryptionKey (
+
276  uint16_t baseAddress,
+
277  const uint8_t * Data)
+
278 {
+
279  uint8_t i;
+
280  uint16_t tempVariable = 0;
+
281 
+
282  // Set module to decrypt mode
+
283  HWREG16(baseAddress + OFS_AESACTL0) &= ~(AESOP1);
+
284  HWREG16(baseAddress + OFS_AESACTL0) |= AESOP0;
+
285 
+
286  // Write data to decrypt to module
+
287  for (i = 0; i < 16; i = i + 2)
+
288  {
+
289  tempVariable = (uint16_t)(Data[i+1] << 8);
+
290  tempVariable = tempVariable | ((uint16_t)(Data[i]));
+
291  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
292  }
+
293 
+
294  // Key that is already written shall be used
+
295  // Now decryption starts
+
296  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
297 
+
298  return STATUS_SUCCESS;
+
299 }
+
300 
+
301 uint8_t AES_decryptDataUsingEncryptionKey (uint16_t baseAddress,
+
302  const uint8_t * Data,
+
303  uint8_t * decryptedData)
+
304 {
+
305  uint8_t i;
+
306  uint16_t tempData = 0;
+
307  uint16_t tempVariable = 0;
+
308 
+
309  // Set module to decrypt mode
+
310  HWREG16(baseAddress + OFS_AESACTL0) &= ~(AESOP1);
+
311  HWREG16(baseAddress + OFS_AESACTL0) |= AESOP0;
+
312 
+
313  // Write data to decrypt to module
+
314  for (i = 0; i < 16; i = i + 2)
+
315  {
+
316  tempVariable = (uint16_t)(Data[i+1] << 8);
+
317  tempVariable = tempVariable | ((uint16_t)(Data[i]));
+
318  HWREG16(baseAddress + OFS_AESADIN) = tempVariable;
+
319  }
+
320 
+
321  // Key that is already written shall be used
+
322  // Now decryption starts
+
323  HWREG16(baseAddress + OFS_AESASTAT) |= AESKEYWR;
+
324 
+
325  // Wait unit finished ~214 MCLK
+
326  while(AESBUSY == (HWREG16(baseAddress + OFS_AESASTAT) & AESBUSY) );
+
327 
+
328  // Write encrypted data back to variable
+
329  for (i = 0; i < 16; i = i + 2)
+
330  {
+
331  tempData = HWREG16(baseAddress + OFS_AESADOUT);
+
332  *(decryptedData + i ) = (uint8_t)tempData;
+
333  *(decryptedData +i + 1) = (uint8_t)(tempData >> 8);
+
334  }
+
335 
+
336  return STATUS_SUCCESS;
+
337 }
+
338 
+
339 #endif
+
340 //*****************************************************************************
+
341 //
+
344 //
+
345 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_FAIL
Definition: hw_memmap.h:23
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/aes_8h.html b/Documentation/html/aes_8h.html new file mode 100644 index 0000000..60e1fd4 --- /dev/null +++ b/Documentation/html/aes_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/aes.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
aes.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/aes_8h_source.html b/Documentation/html/aes_8h_source.html new file mode 100644 index 0000000..fa70492 --- /dev/null +++ b/Documentation/html/aes_8h_source.html @@ -0,0 +1,287 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/aes.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
aes.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // aes.h - Driver for the AES Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_AES_H__
+
8 #define __MSP430WARE_AES_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_AES__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // The following are values that can be passed toThe following are values that
+
28 // can be returned by the AES_isBusy() function.
+
29 //
+
30 //*****************************************************************************
+
31 #define AES_BUSY AESBUSY
+
32 #define AES_NOT_BUSY 0x00
+
33 
+
34 //*****************************************************************************
+
35 //
+
36 // The following are values that can be passed toThe following are values that
+
37 // can be returned by the AES_getErrorFlagStatus() function.
+
38 //
+
39 //*****************************************************************************
+
40 #define AES_ERROR_OCCURRED AESERRFG
+
41 #define AES_NO_ERROR 0x00
+
42 
+
43 //*****************************************************************************
+
44 //
+
45 // Prototypes for the APIs.
+
46 //
+
47 //*****************************************************************************
+
48 
+
49 //*****************************************************************************
+
50 //
+
60 //
+
61 //*****************************************************************************
+
62 extern uint8_t AES_setCipherKey(uint16_t baseAddress,
+
63  const uint8_t *CipherKey);
+
64 
+
65 //*****************************************************************************
+
66 //
+
79 //
+
80 //*****************************************************************************
+
81 extern uint8_t AES_encryptData(uint16_t baseAddress,
+
82  const uint8_t *Data,
+
83  uint8_t *encryptedData);
+
84 
+
85 //*****************************************************************************
+
86 //
+
100 //
+
101 //*****************************************************************************
+
102 extern uint8_t AES_decryptData(uint16_t baseAddress,
+
103  const uint8_t *Data,
+
104  uint8_t *decryptedData);
+
105 
+
106 //*****************************************************************************
+
107 //
+
118 //
+
119 //*****************************************************************************
+
120 extern uint8_t AES_setDecipherKey(uint16_t baseAddress,
+
121  const uint8_t *CipherKey);
+
122 
+
123 //*****************************************************************************
+
124 //
+
137 //
+
138 //*****************************************************************************
+
139 extern void AES_clearInterrupt(uint16_t baseAddress);
+
140 
+
141 //*****************************************************************************
+
142 //
+
152 //
+
153 //*****************************************************************************
+
154 extern uint32_t AES_getInterruptStatus(uint16_t baseAddress);
+
155 
+
156 //*****************************************************************************
+
157 //
+
168 //
+
169 //*****************************************************************************
+
170 extern void AES_enableInterrupt(uint16_t baseAddress);
+
171 
+
172 //*****************************************************************************
+
173 //
+
184 //
+
185 //*****************************************************************************
+
186 extern void AES_disableInterrupt(uint16_t baseAddress);
+
187 
+
188 //*****************************************************************************
+
189 //
+
200 //
+
201 //*****************************************************************************
+
202 extern void AES_reset(uint16_t baseAddress);
+
203 
+
204 //*****************************************************************************
+
205 //
+
221 //
+
222 //*****************************************************************************
+
223 extern uint8_t AES_startEncryptData(uint16_t baseAddress,
+
224  const uint8_t *Data,
+
225  uint8_t *encryptedData);
+
226 
+
227 //*****************************************************************************
+
228 //
+
243 //
+
244 //*****************************************************************************
+
245 extern uint8_t AES_startDecryptData(uint16_t baseAddress,
+
246  const uint8_t *Data);
+
247 
+
248 //*****************************************************************************
+
249 //
+
261 //
+
262 //*****************************************************************************
+
263 extern uint8_t AES_startSetDecipherKey(uint16_t baseAddress,
+
264  const uint8_t *CipherKey);
+
265 
+
266 //*****************************************************************************
+
267 //
+
280 //
+
281 //*****************************************************************************
+
282 extern uint8_t AES_getDataOut(uint16_t baseAddress,
+
283  uint8_t *OutputData);
+
284 
+
285 //*****************************************************************************
+
286 //
+
299 //
+
300 //*****************************************************************************
+
301 extern uint8_t AES_isBusy(uint16_t baseAddress);
+
302 
+
303 //*****************************************************************************
+
304 //
+
316 //
+
317 //*****************************************************************************
+
318 extern void AES_clearErrorFlag(uint16_t baseAddress);
+
319 
+
320 //*****************************************************************************
+
321 //
+
335 //
+
336 //*****************************************************************************
+
337 extern uint32_t AES_getErrorFlagStatus(uint16_t baseAddress);
+
338 
+
339 //*****************************************************************************
+
340 //
+
352 //
+
353 //*****************************************************************************
+
354 extern uint8_t AES_startDecryptDataUsingEncryptionKey(uint16_t baseAddress,
+
355  const uint8_t *Data);
+
356 
+
357 //*****************************************************************************
+
358 //
+
371 //
+
372 //*****************************************************************************
+
373 extern uint8_t AES_decryptDataUsingEncryptionKey(uint16_t baseAddress,
+
374  const uint8_t *Data,
+
375  uint8_t *decryptedData);
+
376 
+
377 //*****************************************************************************
+
378 //
+
379 // Mark the end of the C bindings section for C++ compilers.
+
380 //
+
381 //*****************************************************************************
+
382 #ifdef __cplusplus
+
383 }
+
384 #endif
+
385 
+
386 #endif
+
387 #endif // __MSP430WARE_AES_H__
+ +
+
+ + + + diff --git a/Documentation/html/battbak_8c.html b/Documentation/html/battbak_8c.html new file mode 100644 index 0000000..7ce4114 --- /dev/null +++ b/Documentation/html/battbak_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/battbak.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
battbak.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/battbak_8c_source.html b/Documentation/html/battbak_8c_source.html new file mode 100644 index 0000000..97a59bd --- /dev/null +++ b/Documentation/html/battbak_8c_source.html @@ -0,0 +1,184 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/battbak.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
battbak.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // battbak.c - Driver for the battbak Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_BATTERY_CHARGER__
+
17 #include "battbak.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 uint16_t BattBak_unlockBackupSubSystem (uint16_t baseAddress)
+
22 {
+
23  HWREG8(baseAddress + OFS_BAKCTL) &= ~(LOCKBAK);
+
24  return (HWREG8(baseAddress + OFS_BAKCTL) & LOCKBAK);
+
25 }
+
26 
+
27 void BattBak_enableBackupSupplyToADC (uint16_t baseAddress)
+
28 {
+
29  HWREG8(baseAddress + OFS_BAKCTL) |= BAKADC;
+
30 }
+
31 
+
32 void BattBak_disableBackupSupplyToADC (uint16_t baseAddress)
+
33 {
+
34  HWREG8(baseAddress + OFS_BAKCTL) &= ~(BAKADC);
+
35 }
+
36 
+
37 void BattBak_switchToBackupSupplyManually (uint16_t baseAddress)
+
38 {
+
39  HWREG8(baseAddress + OFS_BAKCTL) |= BAKSW;
+
40 }
+
41 
+
42 void BattBak_disable (uint16_t baseAddress)
+
43 {
+
44  HWREG8(baseAddress + OFS_BAKCTL) |= BAKDIS;
+
45 }
+
46 
+
47 void BattBak_initAndEnableCharger (uint16_t baseAddress,
+
48  uint8_t chargerEndVoltage,
+
49  uint8_t chargeCurrent)
+
50 {
+
51  HWREG16(baseAddress +
+
52  OFS_BAKCHCTL) = CHPWD + chargerEndVoltage + chargeCurrent + CHEN;
+
53 }
+
54 
+
55 void BattBak_disableCharger (uint16_t baseAddress)
+
56 {
+
57  HWREG16(baseAddress + OFS_BAKCHCTL) = CHPWD;
+
58 }
+
59 
+
60 void BattBak_setBackupRAMData (uint16_t baseAddress,
+
61  uint8_t backupRAMSelect,
+
62  uint16_t data)
+
63 {
+
64  HWREG16(baseAddress + backupRAMSelect) = data;
+
65 }
+
66 
+
67 uint16_t BattBak_getBackupRAMData (uint16_t baseAddress,
+
68  uint8_t backupRAMSelect)
+
69 {
+
70  return ( HWREG16(baseAddress + backupRAMSelect) );
+
71 }
+
72 
+
73 #endif
+
74 //*****************************************************************************
+
75 //
+
78 //
+
79 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/battbak_8h.html b/Documentation/html/battbak_8h.html new file mode 100644 index 0000000..54914ef --- /dev/null +++ b/Documentation/html/battbak_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/battbak.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
battbak.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/battbak_8h_source.html b/Documentation/html/battbak_8h_source.html new file mode 100644 index 0000000..c647ef9 --- /dev/null +++ b/Documentation/html/battbak_8h_source.html @@ -0,0 +1,245 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/battbak.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
battbak.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // battbak.h - Driver for the BATTBAK Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_BATTBAK_H__
+
8 #define __MSP430WARE_BATTBAK_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_BATTERY_CHARGER__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // The following are values that can be passed toThe following are values that
+
28 // can be returned by the BattBak_unlockBackupSubSystem() function.
+
29 //
+
30 //*****************************************************************************
+
31 #define BATTBAK_UNLOCKFAILURE (LOCKBAK)
+
32 #define BATTBAK_UNLOCKSUCCESS (0x0)
+
33 
+
34 //*****************************************************************************
+
35 //
+
36 // The following are values that can be passed to the chargerEndVoltage
+
37 // parameter for functions: BattBak_initAndEnableCharger().
+
38 //
+
39 //*****************************************************************************
+
40 #define BATTBAK_CHARGERENDVOLTAGE_VCC (BAKCHV0)
+
41 #define BATTBAK_CHARGERENDVOLTAGE2_7V (BAKCHV1)
+
42 
+
43 //*****************************************************************************
+
44 //
+
45 // The following are values that can be passed to the chargeCurrent parameter
+
46 // for functions: BattBak_initAndEnableCharger().
+
47 //
+
48 //*****************************************************************************
+
49 #define BATTBAK_CHARGECURRENT_5KOHM (BAKCHC0)
+
50 #define BATTBAK_CHARGECURRENT_10KOHM (BAKCHC1)
+
51 #define BATTBAK_CHARGECURRENT_20KOHM (BAKCHC0 + BAKCHC1)
+
52 
+
53 //*****************************************************************************
+
54 //
+
55 // The following are values that can be passed to the backupRAMSelect parameter
+
56 // for functions: BattBak_setBackupRAMData(), and BattBak_getBackupRAMData().
+
57 //
+
58 //*****************************************************************************
+
59 #define BATTBAK_RAMSELECT_0 (0x0000)
+
60 #define BATTBAK_RAMSELECT_1 (0x0002)
+
61 #define BATTBAK_RAMSELECT_2 (0x0004)
+
62 #define BATTBAK_RAMSELECT_3 (0x0006)
+
63 
+
64 //*****************************************************************************
+
65 //
+
66 // Prototypes for the APIs.
+
67 //
+
68 //*****************************************************************************
+
69 
+
70 //*****************************************************************************
+
71 //
+
88 //
+
89 //*****************************************************************************
+
90 extern uint16_t BattBak_unlockBackupSubSystem(uint16_t baseAddress);
+
91 
+
92 //*****************************************************************************
+
93 //
+
104 //
+
105 //*****************************************************************************
+
106 extern void BattBak_enableBackupSupplyToADC(uint16_t baseAddress);
+
107 
+
108 //*****************************************************************************
+
109 //
+
118 //
+
119 //*****************************************************************************
+
120 extern void BattBak_disableBackupSupplyToADC(uint16_t baseAddress);
+
121 
+
122 //*****************************************************************************
+
123 //
+
133 //
+
134 //*****************************************************************************
+
135 extern void BattBak_switchToBackupSupplyManually(uint16_t baseAddress);
+
136 
+
137 //*****************************************************************************
+
138 //
+
147 //
+
148 //*****************************************************************************
+
149 extern void BattBak_disable(uint16_t baseAddress);
+
150 
+
151 //*****************************************************************************
+
152 //
+
176 //
+
177 //*****************************************************************************
+
178 extern void BattBak_initAndEnableCharger(uint16_t baseAddress,
+
179  uint8_t chargerEndVoltage,
+
180  uint8_t chargeCurrent);
+
181 
+
182 //*****************************************************************************
+
183 //
+
193 //
+
194 //*****************************************************************************
+
195 extern void BattBak_disableCharger(uint16_t baseAddress);
+
196 
+
197 //*****************************************************************************
+
198 //
+
214 //
+
215 //*****************************************************************************
+
216 extern void BattBak_setBackupRAMData(uint16_t baseAddress,
+
217  uint8_t backupRAMSelect,
+
218  uint16_t data);
+
219 
+
220 //*****************************************************************************
+
221 //
+
236 //
+
237 //*****************************************************************************
+
238 extern uint16_t BattBak_getBackupRAMData(uint16_t baseAddress,
+
239  uint8_t backupRAMSelect);
+
240 
+
241 //*****************************************************************************
+
242 //
+
243 // Mark the end of the C bindings section for C++ compilers.
+
244 //
+
245 //*****************************************************************************
+
246 #ifdef __cplusplus
+
247 }
+
248 #endif
+
249 
+
250 #endif
+
251 #endif // __MSP430WARE_BATTBAK_H__
+ +
+
+ + + + diff --git a/Documentation/html/comp__b_8c.html b/Documentation/html/comp__b_8c.html new file mode 100644 index 0000000..457906f --- /dev/null +++ b/Documentation/html/comp__b_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/comp_b.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comp_b.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/comp__b_8c_source.html b/Documentation/html/comp__b_8c_source.html new file mode 100644 index 0000000..beeb845 --- /dev/null +++ b/Documentation/html/comp__b_8c_source.html @@ -0,0 +1,315 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/comp_b.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comp_b.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // comp_b.c - Driver for the comp_b Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_COMPB__
+
17 #include "comp_b.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 bool Comp_B_init(uint16_t baseAddress, Comp_B_initParam *param)
+
22 {
+
23  bool retVal = STATUS_SUCCESS;
+
24 
+
25  //Reset COMPB Control 1 & Interrupt Registers for initialization (OFS_CBCTL3
+
26  //is not reset because it controls the input buffers of the analog signals
+
27  //and may cause parasitic effects if an analog signal is still attached and
+
28  //the buffer is re-enabled
+
29  HWREG16(baseAddress + OFS_CBCTL0) &= 0x0000;
+
30  HWREG16(baseAddress + OFS_CBINT) &= 0x0000;
+
31 
+
32  //Clear reference voltage and reference source
+
33  HWREG16(baseAddress + OFS_CBCTL2) &= ~(CBRS_3 | CBREFL_3);
+
34 
+
35  //Set the Positive Terminal
+
36  if(COMP_B_VREF != param->positiveTerminalInput) {
+
37  //Enable Positive Terminal Input Mux and Set it to the appropriate input
+
38  HWREG16(baseAddress + OFS_CBCTL0) |= CBIPEN + param->positiveTerminalInput;
+
39 
+
40  //Disable the input buffer
+
41  HWREG16(baseAddress + OFS_CBCTL3) |= (1 << param->positiveTerminalInput);
+
42  }
+
43  else {
+
44  //Reset and Set COMPB Control 2 Register
+
45  //Set Vref to go to (+)terminal
+
46  HWREG16(baseAddress + OFS_CBCTL2) &= ~(CBRSEL);
+
47  }
+
48 
+
49  //Set the Negative Terminal
+
50  if (COMP_B_VREF != param->negativeTerminalInput) {
+
51  //Enable Negative Terminal Input Mux and Set it to the appropriate input
+
52  HWREG16(baseAddress + OFS_CBCTL0) |= CBIMEN + (param->negativeTerminalInput << 8);
+
53 
+
54  //Disable the input buffer
+
55  HWREG16(baseAddress + OFS_CBCTL3) |= (1 << param->negativeTerminalInput);
+
56  }
+
57  else {
+
58  //Reset and Set COMPB Control 2 Register
+
59  //Set Vref to go to (-) terminal
+
60  HWREG16(baseAddress + OFS_CBCTL2) |= CBRSEL;
+
61  }
+
62 
+
63  //Reset and Set COMPB Control 1 Register
+
64  HWREG16(baseAddress + OFS_CBCTL1) =
+
65  param->powerModeSelect //Set the power mode
+
66  + param->outputFilterEnableAndDelayLevel //Set the filter enable bit and delay
+
67  + param->invertedOutputPolarity; //Set the polarity of the output
+
68 
+
69  return (retVal);
+
70 }
+
71 
+
72 void Comp_B_configureReferenceVoltage(uint16_t baseAddress,
+
73  Comp_B_configureReferenceVoltageParam *param)
+
74 {
+
75  //Set to VREF0
+
76  HWREG16(baseAddress + OFS_CBCTL1) &= ~(CBMRVS);
+
77 
+
78  //Reset COMPB Control 2 Bits (Except for CBRSEL which is set in Comp_Init())
+
79  HWREG16(baseAddress + OFS_CBCTL2) &= CBRSEL;
+
80 
+
81  //Set Voltage Source (Vcc | Vref, resistor ladder or not)
+
82  if (COMP_B_VREFBASE_VCC == param->supplyVoltageReferenceBase) {
+
83  HWREG16(baseAddress + OFS_CBCTL2) |= CBRS_1; //Vcc with resistor ladder
+
84  }
+
85  else if (param->lowerLimitSupplyVoltageFractionOf32 == 32) {
+
86  //If the lower limit is 32, then the upper limit has to be 32 due to the
+
87  //assertion that upper must be >= to the lower limit. If the numerator is
+
88  //equal to 32, then the equation would be 32/32 == 1, therefore no resistor
+
89  //ladder is needed
+
90  HWREG16(baseAddress + OFS_CBCTL2) |= CBRS_3; //Vref, no resistor ladder
+
91  }
+
92  else {
+
93  HWREG16(baseAddress + OFS_CBCTL2) |= CBRS_2; //Vref with resistor ladder
+
94  }
+
95 
+
96  //Set COMPD Control 2 Register
+
97  HWREG16(baseAddress + OFS_CBCTL2) |=
+
98  param->supplyVoltageReferenceBase //Set Supply Voltage Base
+
99  + ((param->upperLimitSupplyVoltageFractionOf32 - 1) << 8) //Set Supply Voltage Num.
+
100  + (param->lowerLimitSupplyVoltageFractionOf32 - 1);
+
101 
+
102  HWREG16(baseAddress + OFS_CBCTL2) &= ~(CBREFACC);
+
103  HWREG16(baseAddress + OFS_CBCTL2) |= param->referenceAccuracy;
+
104 }
+
105 
+
106 void Comp_B_enableInterrupt(uint16_t baseAddress,
+
107  uint16_t interruptMask)
+
108 {
+
109  //Set the Interrupt enable bit
+
110  HWREG16(baseAddress + OFS_CBINT) |= interruptMask;
+
111 }
+
112 
+
113 void Comp_B_disableInterrupt(uint16_t baseAddress,
+
114  uint16_t interruptMask)
+
115 {
+
116  HWREG16(baseAddress + OFS_CBINT) &= ~(interruptMask);
+
117 }
+
118 
+
119 void Comp_B_clearInterrupt(uint16_t baseAddress,
+
120  uint16_t interruptFlagMask)
+
121 {
+
122  HWREG16(baseAddress + OFS_CBINT) &= ~(interruptFlagMask);
+
123 }
+
124 
+
125 uint8_t Comp_B_getInterruptStatus(uint16_t baseAddress,
+
126  uint16_t interruptFlagMask)
+
127 {
+
128  return(HWREG16(baseAddress + OFS_CBINT) & interruptFlagMask);
+
129 }
+
130 
+
131 void Comp_B_setInterruptEdgeDirection(uint16_t baseAddress,
+
132  uint16_t edgeDirection)
+
133 {
+
134  //Set the edge direction that will trigger an interrupt
+
135  if(COMP_B_RISINGEDGE == edgeDirection) {
+
136  HWREG16(baseAddress + OFS_CBCTL1) &= ~(CBIES);
+
137  }
+
138  else if(COMP_B_FALLINGEDGE == edgeDirection) {
+
139  HWREG16(baseAddress + OFS_CBCTL1) |= CBIES;
+
140  }
+
141 }
+
142 
+
143 void Comp_B_toggleInterruptEdgeDirection(uint16_t baseAddress)
+
144 {
+
145  HWREG16(baseAddress + OFS_CBCTL1) ^= CBIES;
+
146 }
+
147 
+
148 void Comp_B_enable(uint16_t baseAddress)
+
149 {
+
150  HWREG16(baseAddress + OFS_CBCTL1) |= CBON;
+
151 }
+
152 
+
153 void Comp_B_disable(uint16_t baseAddress)
+
154 {
+
155  HWREG16(baseAddress + OFS_CBCTL1) &= ~(CBON);
+
156 }
+
157 
+
158 void Comp_B_shortInputs(uint16_t baseAddress)
+
159 {
+
160  HWREG16(baseAddress + OFS_CBCTL1) |= CBSHORT;
+
161 }
+
162 
+
163 void Comp_B_unshortInputs(uint16_t baseAddress)
+
164 {
+
165  HWREG16(baseAddress + OFS_CBCTL1) &= ~(CBSHORT);
+
166 }
+
167 
+
168 void Comp_B_disableInputBuffer(uint16_t baseAddress,
+
169  uint8_t inputPort)
+
170 {
+
171  HWREG16(baseAddress + OFS_CBCTL3) |= (1 << inputPort);
+
172 }
+
173 
+
174 void Comp_B_enableInputBuffer(uint16_t baseAddress,
+
175  uint8_t inputPort)
+
176 {
+
177  HWREG16(baseAddress + OFS_CBCTL3) &= ~(1 << inputPort);
+
178 }
+
179 
+
180 void Comp_B_swapIO(uint16_t baseAddress)
+
181 {
+
182  HWREG16(baseAddress + OFS_CBCTL1) ^= CBEX;
+
183 }
+
184 
+
185 uint16_t Comp_B_outputValue(uint16_t baseAddress)
+
186 {
+
187  return (HWREG16(baseAddress + OFS_CBCTL1) & CBOUT);
+
188 
+
189 }
+
190 
+
191 void Comp_B_selectReferenceVoltage(uint16_t baseAddress, uint16_t selectType,
+
192  uint16_t selectVRef)
+
193 {
+
194  HWREG16(baseAddress + OFS_CBCTL1) &= ~(CBMRVS | CBMRVL);
+
195  if(selectType == COMP_B_VREF_MANUAL_SELECT) {
+
196  HWREG16(baseAddress + OFS_CBCTL1) |= CBMRVS;
+
197  if(selectVRef == COMP_B_SELECT_VREF1) {
+
198  HWREG16(baseAddress + OFS_CBCTL1) |= CBMRVL;
+
199  }
+
200  }
+
201 }
+
202 
+
203 
+
204 #endif
+
205 //*****************************************************************************
+
206 //
+
209 //
+
210 //*****************************************************************************
+ + +
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/comp__b_8h.html b/Documentation/html/comp__b_8h.html new file mode 100644 index 0000000..1fa30a7 --- /dev/null +++ b/Documentation/html/comp__b_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/comp_b.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comp_b.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/comp__b_8h_source.html b/Documentation/html/comp__b_8h_source.html new file mode 100644 index 0000000..47647b0 --- /dev/null +++ b/Documentation/html/comp__b_8h_source.html @@ -0,0 +1,422 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/comp_b.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comp_b.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // comp_b.h - Driver for the COMP_B Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_COMP_B_H__
+
8 #define __MSP430WARE_COMP_B_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_COMPB__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
29 //
+
30 //*****************************************************************************
+
31 typedef struct Comp_B_initParam {
+
51  uint8_t positiveTerminalInput;
+
71  uint8_t negativeTerminalInput;
+
77  uint16_t powerModeSelect;
+
87  uint8_t outputFilterEnableAndDelayLevel;
+
92  uint16_t invertedOutputPolarity;
+
93 } Comp_B_initParam;
+
94 
+
95 //*****************************************************************************
+
96 //
+
99 //
+
100 //*****************************************************************************
+
101 typedef struct Comp_B_configureReferenceVoltageParam {
+
109  uint16_t supplyVoltageReferenceBase;
+
112  uint16_t lowerLimitSupplyVoltageFractionOf32;
+
115  uint16_t upperLimitSupplyVoltageFractionOf32;
+
121  uint16_t referenceAccuracy;
+
122 } Comp_B_configureReferenceVoltageParam;
+
123 
+
124 
+
125 //*****************************************************************************
+
126 //
+
127 // The following are values that can be passed to the powerModeSelect parameter
+
128 // for functions: Comp_B_init(); the param parameter for functions:
+
129 // Comp_B_init().
+
130 //
+
131 //*****************************************************************************
+
132 #define COMP_B_POWERMODE_HIGHSPEED (CBPWRMD_0)
+
133 #define COMP_B_POWERMODE_NORMALMODE (CBPWRMD_1)
+
134 #define COMP_B_POWERMODE_ULTRALOWPOWER (CBPWRMD_2)
+
135 
+
136 //*****************************************************************************
+
137 //
+
138 // The following are values that can be passed to the positiveTerminalInput
+
139 // parameter for functions: Comp_B_init(); the inputPort parameter for
+
140 // functions: Comp_B_disableInputBuffer(), and Comp_B_enableInputBuffer(); the
+
141 // param parameter for functions: Comp_B_init(), and Comp_B_init(); the
+
142 // negativeTerminalInput parameter for functions: Comp_B_init().
+
143 //
+
144 //*****************************************************************************
+
145 #define COMP_B_INPUT0 (CBIPSEL_0)
+
146 #define COMP_B_INPUT1 (CBIPSEL_1)
+
147 #define COMP_B_INPUT2 (CBIPSEL_2)
+
148 #define COMP_B_INPUT3 (CBIPSEL_3)
+
149 #define COMP_B_INPUT4 (CBIPSEL_4)
+
150 #define COMP_B_INPUT5 (CBIPSEL_5)
+
151 #define COMP_B_INPUT6 (CBIPSEL_6)
+
152 #define COMP_B_INPUT7 (CBIPSEL_7)
+
153 #define COMP_B_INPUT8 (CBIPSEL_8)
+
154 #define COMP_B_INPUT9 (CBIPSEL_9)
+
155 #define COMP_B_INPUT10 (CBIPSEL_10)
+
156 #define COMP_B_INPUT11 (CBIPSEL_11)
+
157 #define COMP_B_INPUT12 (CBIPSEL_12)
+
158 #define COMP_B_INPUT13 (CBIPSEL_13)
+
159 #define COMP_B_INPUT14 (CBIPSEL_14)
+
160 #define COMP_B_INPUT15 (CBIPSEL_15)
+
161 #define COMP_B_VREF (0x10)
+
162 
+
163 //*****************************************************************************
+
164 //
+
165 // The following are values that can be passed to the
+
166 // outputFilterEnableAndDelayLevel parameter for functions: Comp_B_init(); the
+
167 // param parameter for functions: Comp_B_init().
+
168 //
+
169 //*****************************************************************************
+
170 #define COMP_B_FILTEROUTPUT_OFF 0x00
+
171 #define COMP_B_FILTEROUTPUT_DLYLVL1 (CBF + CBFDLY_0)
+
172 #define COMP_B_FILTEROUTPUT_DLYLVL2 (CBF + CBFDLY_1)
+
173 #define COMP_B_FILTEROUTPUT_DLYLVL3 (CBF + CBFDLY_2)
+
174 #define COMP_B_FILTEROUTPUT_DLYLVL4 (CBF + CBFDLY_3)
+
175 
+
176 //*****************************************************************************
+
177 //
+
178 // The following are values that can be passed to the invertedOutputPolarity
+
179 // parameter for functions: Comp_B_init(); the param parameter for functions:
+
180 // Comp_B_init().
+
181 //
+
182 //*****************************************************************************
+
183 #define COMP_B_NORMALOUTPUTPOLARITY (!(CBOUTPOL))
+
184 #define COMP_B_INVERTEDOUTPUTPOLARITY (CBOUTPOL)
+
185 
+
186 //*****************************************************************************
+
187 //
+
188 // The following are values that can be passed to the param parameter for
+
189 // functions: Comp_B_configureReferenceVoltage().
+
190 //
+
191 //*****************************************************************************
+
192 #define COMP_B_ACCURACY_STATIC (!CBREFACC)
+
193 #define COMP_B_ACCURACY_CLOCKED (CBREFACC)
+
194 
+
195 //*****************************************************************************
+
196 //
+
197 // The following are values that can be passed to the param parameter for
+
198 // functions: Comp_B_configureReferenceVoltage().
+
199 //
+
200 //*****************************************************************************
+
201 #define COMP_B_VREFBASE_VCC (CBREFL_0)
+
202 #define COMP_B_VREFBASE1_5V (CBREFL_1)
+
203 #define COMP_B_VREFBASE2_0V (CBREFL_2)
+
204 #define COMP_B_VREFBASE2_5V (CBREFL_3)
+
205 
+
206 //*****************************************************************************
+
207 //
+
208 // The following are values that can be passed to the interruptMask parameter
+
209 // for functions: Comp_B_enableInterrupt(), and Comp_B_disableInterrupt().
+
210 //
+
211 //*****************************************************************************
+
212 #define COMP_B_OUTPUT_INT CBIE
+
213 #define COMP_B_OUTPUTINVERTED_INT CBIIE
+
214 
+
215 //*****************************************************************************
+
216 //
+
217 // The following are values that can be passed to the interruptFlagMask
+
218 // parameter for functions: Comp_B_clearInterrupt(), and
+
219 // Comp_B_getInterruptStatus() as well as returned by the
+
220 // Comp_B_getInterruptStatus() function.
+
221 //
+
222 //*****************************************************************************
+
223 #define COMP_B_OUTPUT_FLAG CBIFG
+
224 #define COMP_B_OUTPUTINVERTED_FLAG CBIIFG
+
225 
+
226 //*****************************************************************************
+
227 //
+
228 // The following are values that can be passed to the edgeDirection parameter
+
229 // for functions: Comp_B_setInterruptEdgeDirection().
+
230 //
+
231 //*****************************************************************************
+
232 #define COMP_B_RISINGEDGE (!(CBIES))
+
233 #define COMP_B_FALLINGEDGE (CBIES)
+
234 
+
235 //*****************************************************************************
+
236 //
+
237 // The following are values that can be passed toThe following are values that
+
238 // can be returned by the Comp_B_outputValue() function.
+
239 //
+
240 //*****************************************************************************
+
241 #define COMP_B_LOW (0x0)
+
242 #define COMP_B_HIGH (CBOUT)
+
243 
+
244 //*****************************************************************************
+
245 //
+
246 // The following are values that can be passed to the selectType parameter for
+
247 // functions: Comp_B_selectReferenceVoltage().
+
248 //
+
249 //*****************************************************************************
+
250 #define COMP_B_VREF_AUTO_SELECT 0x0000
+
251 #define COMP_B_VREF_MANUAL_SELECT CBMRVS
+
252 
+
253 //*****************************************************************************
+
254 //
+
255 // The following are values that can be passed to the selectVRef parameter for
+
256 // functions: Comp_B_selectReferenceVoltage().
+
257 //
+
258 //*****************************************************************************
+
259 #define COMP_B_SELECT_VREF0 0x0000
+
260 #define COMP_B_SELECT_VREF1 CBMRVL
+
261 
+
262 //*****************************************************************************
+
263 //
+
264 // Prototypes for the APIs.
+
265 //
+
266 //*****************************************************************************
+
267 
+
268 //*****************************************************************************
+
269 //
+
283 //
+
284 //*****************************************************************************
+
285 extern bool Comp_B_init(uint16_t baseAddress,
+
286  Comp_B_initParam *param);
+
287 
+
288 //*****************************************************************************
+
289 //
+
303 //
+
304 //*****************************************************************************
+
305 extern void Comp_B_configureReferenceVoltage(uint16_t baseAddress,
+
306  Comp_B_configureReferenceVoltageParam *param);
+
307 
+
308 //*****************************************************************************
+
309 //
+
325 //
+
326 //*****************************************************************************
+
327 extern void Comp_B_enableInterrupt(uint16_t baseAddress,
+
328  uint16_t interruptMask);
+
329 
+
330 //*****************************************************************************
+
331 //
+
347 //
+
348 //*****************************************************************************
+
349 extern void Comp_B_disableInterrupt(uint16_t baseAddress,
+
350  uint16_t interruptMask);
+
351 
+
352 //*****************************************************************************
+
353 //
+
369 //
+
370 //*****************************************************************************
+
371 extern void Comp_B_clearInterrupt(uint16_t baseAddress,
+
372  uint16_t interruptFlagMask);
+
373 
+
374 //*****************************************************************************
+
375 //
+
392 //
+
393 //*****************************************************************************
+
394 extern uint8_t Comp_B_getInterruptStatus(uint16_t baseAddress,
+
395  uint16_t interruptFlagMask);
+
396 
+
397 //*****************************************************************************
+
398 //
+
420 //
+
421 //*****************************************************************************
+
422 extern void Comp_B_setInterruptEdgeDirection(uint16_t baseAddress,
+
423  uint16_t edgeDirection);
+
424 
+
425 //*****************************************************************************
+
426 //
+
437 //
+
438 //*****************************************************************************
+
439 extern void Comp_B_toggleInterruptEdgeDirection(uint16_t baseAddress);
+
440 
+
441 //*****************************************************************************
+
442 //
+
450 //
+
451 //*****************************************************************************
+
452 extern void Comp_B_enable(uint16_t baseAddress);
+
453 
+
454 //*****************************************************************************
+
455 //
+
464 //
+
465 //*****************************************************************************
+
466 extern void Comp_B_disable(uint16_t baseAddress);
+
467 
+
468 //*****************************************************************************
+
469 //
+
478 //
+
479 //*****************************************************************************
+
480 extern void Comp_B_shortInputs(uint16_t baseAddress);
+
481 
+
482 //*****************************************************************************
+
483 //
+
493 //
+
494 //*****************************************************************************
+
495 extern void Comp_B_unshortInputs(uint16_t baseAddress);
+
496 
+
497 //*****************************************************************************
+
498 //
+
532 //
+
533 //*****************************************************************************
+
534 extern void Comp_B_disableInputBuffer(uint16_t baseAddress,
+
535  uint8_t inputPort);
+
536 
+
537 //*****************************************************************************
+
538 //
+
570 //
+
571 //*****************************************************************************
+
572 extern void Comp_B_enableInputBuffer(uint16_t baseAddress,
+
573  uint8_t inputPort);
+
574 
+
575 //*****************************************************************************
+
576 //
+
588 //
+
589 //*****************************************************************************
+
590 extern void Comp_B_swapIO(uint16_t baseAddress);
+
591 
+
592 //*****************************************************************************
+
593 //
+
604 //
+
605 //*****************************************************************************
+
606 extern uint16_t Comp_B_outputValue(uint16_t baseAddress);
+
607 
+
608 //*****************************************************************************
+
609 //
+
633 //
+
634 //*****************************************************************************
+
635 extern void Comp_B_selectReferenceVoltage(uint16_t baseAddress,
+
636  uint16_t selectType,
+
637  uint16_t selectVRef);
+
638 
+
639 //*****************************************************************************
+
640 //
+
641 // Mark the end of the C bindings section for C++ compilers.
+
642 //
+
643 //*****************************************************************************
+
644 #ifdef __cplusplus
+
645 }
+
646 #endif
+
647 
+
648 #endif
+
649 #endif // __MSP430WARE_COMP_B_H__
+ +
+
+ + + + diff --git a/Documentation/html/crc_8c.html b/Documentation/html/crc_8c.html new file mode 100644 index 0000000..2a55729 --- /dev/null +++ b/Documentation/html/crc_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/crc.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
crc.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/crc_8c_source.html b/Documentation/html/crc_8c_source.html new file mode 100644 index 0000000..e7fef96 --- /dev/null +++ b/Documentation/html/crc_8c_source.html @@ -0,0 +1,177 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/crc.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
crc.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // crc.c - Driver for the crc Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_CRC__
+
17 #include "crc.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void CRC_setSeed (uint16_t baseAddress,
+
22  uint16_t seed)
+
23 {
+
24  HWREG16(baseAddress + OFS_CRCINIRES) = seed;
+
25 }
+
26 
+
27 void CRC_set16BitData (uint16_t baseAddress,
+
28  uint16_t dataIn)
+
29 {
+
30  HWREG16(baseAddress + OFS_CRCDI) = dataIn;
+
31 }
+
32 
+
33 void CRC_set8BitData (uint16_t baseAddress,
+
34  uint8_t dataIn)
+
35 {
+
36  HWREG8(baseAddress + OFS_CRCDI_L) = dataIn;
+
37 }
+
38 
+
39 void CRC_set16BitDataReversed (uint16_t baseAddress,
+
40  uint16_t dataIn)
+
41 {
+
42  HWREG16(baseAddress + OFS_CRCDIRB) = dataIn;
+
43 }
+
44 
+
45 void CRC_set8BitDataReversed (uint16_t baseAddress,
+
46  uint8_t dataIn)
+
47 {
+
48  HWREG8(baseAddress + OFS_CRCDIRB_L) = dataIn;
+
49 }
+
50 
+
51 uint16_t CRC_getData (uint16_t baseAddress)
+
52 {
+
53  return ( HWREG16(baseAddress + OFS_CRCDI) );
+
54 }
+
55 
+
56 uint16_t CRC_getResult (uint16_t baseAddress)
+
57 {
+
58  return ( HWREG16(baseAddress + OFS_CRCINIRES) );
+
59 }
+
60 
+
61 uint16_t CRC_getResultBitsReversed (uint16_t baseAddress)
+
62 {
+
63  return ( HWREG16(baseAddress + OFS_CRCRESR) );
+
64 }
+
65 
+
66 #endif
+
67 //*****************************************************************************
+
68 //
+
71 //
+
72 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/crc_8h.html b/Documentation/html/crc_8h.html new file mode 100644 index 0000000..274c503 --- /dev/null +++ b/Documentation/html/crc_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/crc.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
crc.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/crc_8h_source.html b/Documentation/html/crc_8h_source.html new file mode 100644 index 0000000..c5aeeca --- /dev/null +++ b/Documentation/html/crc_8h_source.html @@ -0,0 +1,200 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/crc.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
crc.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // crc.h - Driver for the CRC Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_CRC_H__
+
8 #define __MSP430WARE_CRC_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_CRC__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // Prototypes for the APIs.
+
28 //
+
29 //*****************************************************************************
+
30 
+
31 //*****************************************************************************
+
32 //
+
44 //
+
45 //*****************************************************************************
+
46 extern void CRC_setSeed(uint16_t baseAddress,
+
47  uint16_t seed);
+
48 
+
49 //*****************************************************************************
+
50 //
+
63 //
+
64 //*****************************************************************************
+
65 extern void CRC_set16BitData(uint16_t baseAddress,
+
66  uint16_t dataIn);
+
67 
+
68 //*****************************************************************************
+
69 //
+
82 //
+
83 //*****************************************************************************
+
84 extern void CRC_set8BitData(uint16_t baseAddress,
+
85  uint8_t dataIn);
+
86 
+
87 //*****************************************************************************
+
88 //
+
102 //
+
103 //*****************************************************************************
+
104 extern void CRC_set16BitDataReversed(uint16_t baseAddress,
+
105  uint16_t dataIn);
+
106 
+
107 //*****************************************************************************
+
108 //
+
122 //
+
123 //*****************************************************************************
+
124 extern void CRC_set8BitDataReversed(uint16_t baseAddress,
+
125  uint8_t dataIn);
+
126 
+
127 //*****************************************************************************
+
128 //
+
137 //
+
138 //*****************************************************************************
+
139 extern uint16_t CRC_getData(uint16_t baseAddress);
+
140 
+
141 //*****************************************************************************
+
142 //
+
151 //
+
152 //*****************************************************************************
+
153 extern uint16_t CRC_getResult(uint16_t baseAddress);
+
154 
+
155 //*****************************************************************************
+
156 //
+
164 //
+
165 //*****************************************************************************
+
166 extern uint16_t CRC_getResultBitsReversed(uint16_t baseAddress);
+
167 
+
168 //*****************************************************************************
+
169 //
+
170 // Mark the end of the C bindings section for C++ compilers.
+
171 //
+
172 //*****************************************************************************
+
173 #ifdef __cplusplus
+
174 }
+
175 #endif
+
176 
+
177 #endif
+
178 #endif // __MSP430WARE_CRC_H__
+ +
+
+ + + + diff --git a/Documentation/html/ctsd16_8c.html b/Documentation/html/ctsd16_8c.html new file mode 100644 index 0000000..471f3e4 --- /dev/null +++ b/Documentation/html/ctsd16_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/ctsd16.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ctsd16.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/ctsd16_8c_source.html b/Documentation/html/ctsd16_8c_source.html new file mode 100644 index 0000000..d836c00 --- /dev/null +++ b/Documentation/html/ctsd16_8c_source.html @@ -0,0 +1,386 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/ctsd16.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ctsd16.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // ctsd16.c - Driver for the ctsd16 Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_CTSD16__
+
17 #include "ctsd16.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void CTSD16_init(uint16_t baseAddress, uint16_t chargePumpBurstRequest,
+
22  uint8_t referenceSelect)
+
23 {
+
24  // Reset all interrupts and flags
+
25  HWREG16(baseAddress + OFS_CTSD16IE) &= 0x0000; //Reset ALL interrupt enables
+
26  HWREG16(baseAddress + OFS_CTSD16IFG) &= 0x0000; //Reset ALL interrupt flags
+
27 
+
28  // Configure CTSD16
+
29  HWREG16(baseAddress + OFS_CTSD16CTL) &= ~(CTSD16RRIBURST | CTSD16OFFG |
+
30  CTSD16REFS);
+
31 
+
32  HWREG16(baseAddress + OFS_CTSD16CTL) |= chargePumpBurstRequest | referenceSelect;
+
33 
+
34  return;
+
35 }
+
36 
+
37 void CTSD16_initConverter(uint16_t baseAddress, uint8_t converter,
+
38  uint16_t conversionMode, uint8_t inputChannel)
+
39 {
+
40  uint16_t address;
+
41  address = baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x06));
+
42 
+
43  // Clearing previous settings for configuration
+
44  HWREG16(address) &= ~(CTSD16SC | CTSD16SNGL);
+
45 
+
46  HWREG16(address) |= conversionMode;
+
47 
+
48  address += 0x2;
+
49 
+
50  HWREG16(address) &= ~(CTSD16INCH4 | CTSD16INCH3 | CTSD16INCH2 |
+
51  CTSD16INCH1 | CTSD16INCH0);
+
52 
+
53  HWREG16(address) |= inputChannel;
+
54 }
+
55 
+
56 void CTSD16_initConverterAdvanced(uint16_t baseAddress,
+
57  CTSD16_initConverterAdvancedParam *param)
+
58 {
+
59  uint16_t address;
+
60 
+
61  // Getting correct CTSD16CCTLx register
+
62  address = baseAddress + (OFS_CTSD16CCTL0 + (param->converter * 0x06));
+
63 
+
64  // Clearing previous settings for configuration
+
65  HWREG16(address) &= ~(CTSD16SC | CTSD16SNGL | CTSD16GRP | CTSD16OSR__32 |
+
66  CTSD16DF);
+
67 
+
68  HWREG16(address) |= (param->groupEnable | param->conversionMode | param->oversampleRatio | param->dataFormat);
+
69 
+
70  // Getting correct CTSD16INCTLx register
+
71  address += 0x2;
+
72 
+
73  HWREG16(address) &= ~(CTSD16RRI | CTSD16INTDLY | CTSD16GAIN2 |
+
74  CTSD16GAIN1 | CTSD16GAIN0 | CTSD16INCH4 | CTSD16INCH3 | CTSD16INCH2 |
+
75  CTSD16INCH1 | CTSD16INCH0);
+
76 
+
77  HWREG16(address) |= (param->railToRailInput | param->interruptDelay |
+
78  param->gain | param->inputChannel);
+
79 
+
80 }
+
81 
+
82 void CTSD16_startConverterConversion(uint16_t baseAddress,
+
83  uint8_t converter)
+
84 {
+
85  uint16_t address;
+
86 
+
87  address = baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x06));
+
88 
+
89  // Setting CTSD16SC bit to start conversion
+
90  HWREG16(address) |= CTSD16SC;
+
91 }
+
92 
+
93 void CTSD16_stopConverterConversion(uint16_t baseAddress,
+
94  uint8_t converter)
+
95 {
+
96  uint16_t address;
+
97 
+
98  address = baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x06));
+
99 
+
100  // Setting CTSD16SC bit to start conversion
+
101  HWREG16(address) &= ~(CTSD16SC);
+
102 }
+
103 
+
104 void CTSD16_setConverterDataFormat(uint16_t baseAddress,
+
105  uint8_t converter,
+
106  uint8_t dataFormat)
+
107 {
+
108  uint16_t address;
+
109 
+
110  address = baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x06));
+
111 
+
112  // Clearing previous settings for configuration
+
113  HWREG8(address) &= ~CTSD16DF;
+
114 
+
115  HWREG8(address) |= dataFormat;
+
116 }
+
117 
+
118 void CTSD16_setInputChannel(uint16_t baseAddress,
+
119  uint8_t converter,
+
120  uint8_t inputChannel)
+
121 {
+
122  uint16_t address;
+
123 
+
124  address = baseAddress + (OFS_CTSD16INCTL0 + (converter * 0x06));
+
125 
+
126  // Clear previous settings
+
127  HWREG16(address) &= ~(CTSD16INCH4 | CTSD16INCH3 | CTSD16INCH2 |
+
128  CTSD16INCH1 | CTSD16INCH0);
+
129 
+
130  HWREG16(address) |= inputChannel;
+
131 }
+
132 
+
133 void CTSD16_setRailToRailInput(uint16_t baseAddress,
+
134  uint8_t converter,
+
135  uint16_t railToRailInput)
+
136 {
+
137  uint16_t address;
+
138 
+
139  address = baseAddress + (OFS_CTSD16INCTL0 + (converter * 0x06));
+
140 
+
141  // Clear previous settings
+
142  HWREG16(address) &= ~CTSD16RRI;
+
143 
+
144  HWREG16(address) |= railToRailInput;
+
145 }
+
146 
+
147 void CTSD16_setInterruptDelay(uint16_t baseAddress,
+
148  uint8_t converter,
+
149  uint16_t interruptDelay)
+
150 {
+
151  uint16_t address;
+
152 
+
153  address = baseAddress + (OFS_CTSD16INCTL0 + (converter * 0x06));
+
154 
+
155  // Clear previous settings
+
156  HWREG16(address) &= ~CTSD16INTDLY;
+
157 
+
158  HWREG16(address) |= interruptDelay;
+
159 
+
160 }
+
161 
+
162 void CTSD16_setOversampling(uint16_t baseAddress,
+
163  uint8_t converter,
+
164  uint16_t oversampleRatio)
+
165 {
+
166  uint16_t address;
+
167 
+
168  address = baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x06));
+
169 
+
170  // Setting CTSD16SC bit to start conversion
+
171  HWREG16(address) |= oversampleRatio;
+
172 }
+
173 
+
174 void CTSD16_setGain(uint16_t baseAddress,
+
175  uint8_t converter,
+
176  uint8_t gain)
+
177 {
+
178  uint16_t address;
+
179 
+
180  address = baseAddress + (OFS_CTSD16INCTL0 + (converter * 0x06));
+
181 
+
182  // Clear previous settings
+
183  HWREG16(address) &= ~(CTSD16GAIN2 | CTSD16GAIN1 | CTSD16GAIN0);
+
184 
+
185  HWREG16(address) |= gain;
+
186 }
+
187 
+
188 uint32_t CTSD16_getResults(uint16_t baseAddress,
+
189  uint8_t converter)
+
190 {
+
191  volatile uint16_t OSR;
+
192 
+
193  uint16_t address = baseAddress + (OFS_CTSD16MEM0 + (converter * 0x02));
+
194 
+
195  // Get high word result
+
196  HWREG16(baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x02))) &= ~(CTSD16LSBACC);
+
197  uint32_t highResult = (uint32_t)HWREG16(address);
+
198 
+
199  // Get low word result
+
200  HWREG16(baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x02))) |= CTSD16LSBACC;
+
201  uint16_t lowResult = HWREG16(address);
+
202  HWREG16(baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x02))) &= ~(CTSD16LSBACC);
+
203 
+
204  // Determine the OSR and combine the high and low result words as appropriate
+
205  OSR = HWREG16(baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x02))) & (CTSD16OSR0 | CTSD16OSR1);
+
206 
+
207  if(OSR == CTSD16_OVERSAMPLE_256)
+
208  {
+
209  return (highResult << 8) | lowResult;
+
210  }
+
211  else if(OSR == CTSD16_OVERSAMPLE_128)
+
212  {
+
213  return (highResult << 5) | lowResult;
+
214  }
+
215  else if(OSR == CTSD16_OVERSAMPLE_64)
+
216  {
+
217  return (highResult << 2) | lowResult;
+
218  }
+
219  else // OSR = CTSD16_OVERSAMPLE_32
+
220  {
+
221  return (highResult);
+
222  }
+
223 }
+
224 
+
225 uint16_t CTSD16_getHighWordResults(uint16_t baseAddress,
+
226  uint8_t converter)
+
227 {
+
228  // Calculate address of MEM results
+
229  uint16_t address = baseAddress + (OFS_CTSD16MEM0 + (converter * 0x02));
+
230 
+
231  // Get high word result
+
232  HWREG16(baseAddress + (OFS_CTSD16CCTL0 + (converter * 0x02))) &= ~(CTSD16LSBACC);
+
233  uint16_t highResult = HWREG16(address);
+
234 
+
235  return(highResult);
+
236 }
+
237 
+
238 uint16_t CTSD16_isRailToRailInputReady(uint16_t baseAddress)
+
239 {
+
240  return HWREG16(baseAddress + OFS_CTSD16CTL) & CTSD16RRIRDY;
+
241 }
+
242 
+
243 void CTSD16_enableInterrupt (uint16_t baseAddress,
+
244  uint8_t converter,
+
245  uint16_t mask)
+
246 {
+
247  //Enable Interrupt
+
248  HWREG16(baseAddress + OFS_CTSD16IE) |= (mask << converter);
+
249 
+
250 }
+
251 
+
252 void CTSD16_disableInterrupt (uint16_t baseAddress,
+
253  uint8_t converter,
+
254  uint16_t mask)
+
255 {
+
256  //Enable Interrupt
+
257  HWREG16(baseAddress + OFS_CTSD16IE) &= ~(mask << converter);
+
258 
+
259 }
+
260 
+
261 void CTSD16_clearInterrupt (uint16_t baseAddress,
+
262  uint8_t converter,
+
263  uint16_t mask)
+
264 {
+
265  HWREG16(baseAddress + OFS_CTSD16IFG) &= ~(mask << converter);
+
266 }
+
267 
+
268 uint16_t CTSD16_getInterruptStatus (uint16_t baseAddress,
+
269  uint8_t converter,
+
270  uint16_t mask)
+
271 {
+
272  return ( HWREG16(baseAddress + OFS_CTSD16IFG) & (mask << converter) );
+
273 }
+
274 
+
275 #endif
+
276 //*****************************************************************************
+
277 //
+
280 //
+
281 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/ctsd16_8h.html b/Documentation/html/ctsd16_8h.html new file mode 100644 index 0000000..cb9bf8c --- /dev/null +++ b/Documentation/html/ctsd16_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/ctsd16.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ctsd16.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/ctsd16_8h_source.html b/Documentation/html/ctsd16_8h_source.html new file mode 100644 index 0000000..e952b37 --- /dev/null +++ b/Documentation/html/ctsd16_8h_source.html @@ -0,0 +1,463 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/ctsd16.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ctsd16.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // ctsd16.h - Driver for the CTSD16 Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_CTSD16_H__
+
8 #define __MSP430WARE_CTSD16_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_CTSD16__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
30 //
+
31 //*****************************************************************************
+
32 typedef struct CTSD16_initConverterAdvancedParam {
+
42  uint8_t converter;
+
48  uint16_t conversionMode;
+
52  uint8_t groupEnable;
+
74  uint8_t inputChannel;
+
79  uint8_t dataFormat;
+
84  uint16_t railToRailInput;
+
89  uint16_t interruptDelay;
+
96  uint16_t oversampleRatio;
+
104  uint8_t gain;
+
105 } CTSD16_initConverterAdvancedParam;
+
106 
+
107 
+
108 //*****************************************************************************
+
109 //
+
110 // The following are values that can be passed to the converter parameter for
+
111 // functions: CTSD16_setConverterDataFormat(),
+
112 // CTSD16_startConverterConversion(), CTSD16_stopConverterConversion(),
+
113 // CTSD16_setInputChannel(), CTSD16_setInterruptDelay(),
+
114 // CTSD16_setOversampling(), CTSD16_setGain(), CTSD16_setRailToRailInput(),
+
115 // CTSD16_getResults(), CTSD16_getHighWordResults(), CTSD16_enableInterrupt(),
+
116 // CTSD16_disableInterrupt(), CTSD16_clearInterrupt(),
+
117 // CTSD16_getInterruptStatus(), and CTSD16_initConverter(); the param parameter
+
118 // for functions: CTSD16_initConverterAdvanced().
+
119 //
+
120 //*****************************************************************************
+
121 #define CTSD16_CONVERTER_0 0
+
122 #define CTSD16_CONVERTER_1 1
+
123 #define CTSD16_CONVERTER_2 2
+
124 #define CTSD16_CONVERTER_3 3
+
125 #define CTSD16_CONVERTER_4 4
+
126 #define CTSD16_CONVERTER_5 5
+
127 #define CTSD16_CONVERTER_6 6
+
128 
+
129 //*****************************************************************************
+
130 //
+
131 // The following are values that can be passed to the oversampleRatio parameter
+
132 // for functions: CTSD16_setOversampling(); the param parameter for functions:
+
133 // CTSD16_initConverterAdvanced().
+
134 //
+
135 //*****************************************************************************
+
136 #define CTSD16_OVERSAMPLE_32 (CTSD16OSR__32)
+
137 #define CTSD16_OVERSAMPLE_64 (CTSD16OSR__64)
+
138 #define CTSD16_OVERSAMPLE_128 (CTSD16OSR__128)
+
139 #define CTSD16_OVERSAMPLE_256 (CTSD16OSR__256)
+
140 
+
141 //*****************************************************************************
+
142 //
+
143 // The following are values that can be passed to the inputChannel parameter
+
144 // for functions: CTSD16_initConverter(), and CTSD16_setInputChannel(); the
+
145 // param parameter for functions: CTSD16_initConverterAdvanced().
+
146 //
+
147 //*****************************************************************************
+
148 #define CTSD16_INPUT_CH0 (CTSD16INCH_0)
+
149 #define CTSD16_INPUT_CH1 (CTSD16INCH_1)
+
150 #define CTSD16_INPUT_CH2 (CTSD16INCH_2)
+
151 #define CTSD16_INPUT_CH3 (CTSD16INCH_3)
+
152 #define CTSD16_INPUT_CH4 (CTSD16INCH_4)
+
153 #define CTSD16_INPUT_CH5 (CTSD16INCH_5)
+
154 #define CTSD16_INPUT_CH6 (CTSD16INCH_6)
+
155 #define CTSD16_INPUT_CH7 (CTSD16INCH_7)
+
156 #define CTSD16_INPUT_CH8 (CTSD16INCH_8)
+
157 #define CTSD16_INPUT_CH9 (CTSD16INCH_9)
+
158 #define CTSD16_INPUT_CH10 (CTSD16INCH_10)
+
159 #define CTSD16_INPUT_CH11 (CTSD16INCH_11)
+
160 #define CTSD16_INPUT_CH12 (CTSD16INCH_12)
+
161 #define CTSD16_INPUT_CH13 (CTSD16INCH_13)
+
162 #define CTSD16_INPUT_CH14 (CTSD16INCH_14)
+
163 #define CTSD16_INPUT_CH15 (CTSD16INCH_15)
+
164 #define CTSD16_INPUT_CH16 (CTSD16INCH_16)
+
165 #define CTSD16_INPUT_CH17 (CTSD16INCH_17)
+
166 #define CTSD16_INPUT_CH18 (CTSD16INCH_18)
+
167 
+
168 //*****************************************************************************
+
169 //
+
170 // The following are values that can be passed to the dataFormat parameter for
+
171 // functions: CTSD16_setConverterDataFormat(); the param parameter for
+
172 // functions: CTSD16_initConverterAdvanced().
+
173 //
+
174 //*****************************************************************************
+
175 #define CTSD16_DATA_FORMAT_BINARY (0x00)
+
176 #define CTSD16_DATA_FORMAT_2COMPLEMENT (CTSD16DF)
+
177 
+
178 //*****************************************************************************
+
179 //
+
180 // The following are values that can be passed to the gain parameter for
+
181 // functions: CTSD16_setGain(); the param parameter for functions:
+
182 // CTSD16_initConverterAdvanced().
+
183 //
+
184 //*****************************************************************************
+
185 #define CTSD16_GAIN_1 (CTSD16GAIN_1)
+
186 #define CTSD16_GAIN_2 (CTSD16GAIN_2)
+
187 #define CTSD16_GAIN_4 (CTSD16GAIN_4)
+
188 #define CTSD16_GAIN_8 (CTSD16GAIN_8)
+
189 #define CTSD16_GAIN_16 (CTSD16GAIN_16)
+
190 
+
191 //*****************************************************************************
+
192 //
+
193 // The following are values that can be passed to the interruptDelay parameter
+
194 // for functions: CTSD16_setInterruptDelay(); the param parameter for
+
195 // functions: CTSD16_initConverterAdvanced().
+
196 //
+
197 //*****************************************************************************
+
198 #define CTSD16_FIRST_SAMPLE_INTERRUPT (CTSD16INTDLY)
+
199 #define CTSD16_FOURTH_SAMPLE_INTERRUPT (0x00)
+
200 
+
201 //*****************************************************************************
+
202 //
+
203 // The following are values that can be passed to the param parameter for
+
204 // functions: CTSD16_initConverterAdvanced().
+
205 //
+
206 //*****************************************************************************
+
207 #define CTSD16_NOT_GROUPED (0x00)
+
208 #define CTSD16_GROUPED (CTSD16GRP)
+
209 
+
210 //*****************************************************************************
+
211 //
+
212 // The following are values that can be passed to the mask parameter for
+
213 // functions: CTSD16_enableInterrupt(), CTSD16_disableInterrupt(),
+
214 // CTSD16_clearInterrupt(), and CTSD16_getInterruptStatus() as well as returned
+
215 // by the CTSD16_getInterruptStatus() function.
+
216 //
+
217 //*****************************************************************************
+
218 #define CTSD16_CONVERTER_INTERRUPT (CTSD16IE0)
+
219 #define CTSD16_CONVERTER_OVERFLOW_INTERRUPT (CTSD16OVIE0)
+
220 
+
221 //*****************************************************************************
+
222 //
+
223 // The following are values that can be passed to the chargePumpBurstRequest
+
224 // parameter for functions: CTSD16_init().
+
225 //
+
226 //*****************************************************************************
+
227 #define CTSD16_RTR_INPUT_CHARGEPUMP_BURST_REQUEST_ENABLE (CTSD16RRIBURST)
+
228 #define CTSD16_RTR_INPUT_CHARGEPUMP_BURST_REQUEST_DISABLE (0x0)
+
229 
+
230 //*****************************************************************************
+
231 //
+
232 // The following are values that can be passed to the referenceSelect parameter
+
233 // for functions: CTSD16_init().
+
234 //
+
235 //*****************************************************************************
+
236 #define CTSD16_REF_EXTERNAL (0x0)
+
237 #define CTSD16_REF_INTERNAL (CTSD16REFS)
+
238 
+
239 //*****************************************************************************
+
240 //
+
241 // The following are values that can be passed to the param parameter for
+
242 // functions: CTSD16_initConverterAdvanced(); the conversionMode parameter for
+
243 // functions: CTSD16_initConverter().
+
244 //
+
245 //*****************************************************************************
+
246 #define CTSD16_CONTINUOUS_MODE (0x0)
+
247 #define CTSD16_SINGLE_MODE (CTSD16SNGL)
+
248 
+
249 //*****************************************************************************
+
250 //
+
251 // The following are values that can be passed to the railToRailInput parameter
+
252 // for functions: CTSD16_setRailToRailInput(); the param parameter for
+
253 // functions: CTSD16_initConverterAdvanced().
+
254 //
+
255 //*****************************************************************************
+
256 #define CTSD16_RTR_INPUT_ENABLE (CTSD16RRI)
+
257 #define CTSD16_RTR_INPUT_DISABLE (0x0)
+
258 
+
259 //*****************************************************************************
+
260 //
+
261 // The following are values that can be passed toThe following are values that
+
262 // can be returned by the CTSD16_isRailToRailInputReady() function.
+
263 //
+
264 //*****************************************************************************
+
265 #define CTSD16_RTR_INPUT_READY (CTSD16RRIRDY)
+
266 #define CTSD16_RTR_INPUT_NOT_READY (0x0)
+
267 
+
268 //*****************************************************************************
+
269 //
+
270 // Prototypes for the APIs.
+
271 //
+
272 //*****************************************************************************
+
273 
+
274 //*****************************************************************************
+
275 //
+
299 //
+
300 //*****************************************************************************
+
301 extern void CTSD16_init(uint16_t baseAddress,
+
302  uint16_t chargePumpBurstRequest,
+
303  uint8_t referenceSelect);
+
304 
+
305 //*****************************************************************************
+
306 //
+
354 //
+
355 //*****************************************************************************
+
356 extern void CTSD16_initConverter(uint16_t baseAddress,
+
357  uint8_t converter,
+
358  uint16_t conversionMode,
+
359  uint8_t inputChannel);
+
360 
+
361 //*****************************************************************************
+
362 //
+
373 //
+
374 //*****************************************************************************
+
375 extern void CTSD16_initConverterAdvanced(uint16_t baseAddress,
+
376  CTSD16_initConverterAdvancedParam *param);
+
377 
+
378 //*****************************************************************************
+
379 //
+
397 //
+
398 //*****************************************************************************
+
399 extern void CTSD16_startConverterConversion(uint16_t baseAddress,
+
400  uint8_t converter);
+
401 
+
402 //*****************************************************************************
+
403 //
+
421 //
+
422 //*****************************************************************************
+
423 extern void CTSD16_stopConverterConversion(uint16_t baseAddress,
+
424  uint8_t converter);
+
425 
+
426 //*****************************************************************************
+
427 //
+
451 //
+
452 //*****************************************************************************
+
453 extern void CTSD16_setConverterDataFormat(uint16_t baseAddress,
+
454  uint8_t converter,
+
455  uint8_t dataFormat);
+
456 
+
457 //*****************************************************************************
+
458 //
+
498 //
+
499 //*****************************************************************************
+
500 extern void CTSD16_setInputChannel(uint16_t baseAddress,
+
501  uint8_t converter,
+
502  uint8_t inputChannel);
+
503 
+
504 //*****************************************************************************
+
505 //
+
527 //
+
528 //*****************************************************************************
+
529 extern void CTSD16_setRailToRailInput(uint16_t baseAddress,
+
530  uint8_t converter,
+
531  uint16_t railToRailInput);
+
532 
+
533 //*****************************************************************************
+
534 //
+
559 //
+
560 //*****************************************************************************
+
561 extern void CTSD16_setInterruptDelay(uint16_t baseAddress,
+
562  uint8_t converter,
+
563  uint16_t interruptDelay);
+
564 
+
565 //*****************************************************************************
+
566 //
+
590 //
+
591 //*****************************************************************************
+
592 extern void CTSD16_setOversampling(uint16_t baseAddress,
+
593  uint8_t converter,
+
594  uint16_t oversampleRatio);
+
595 
+
596 //*****************************************************************************
+
597 //
+
622 //
+
623 //*****************************************************************************
+
624 extern void CTSD16_setGain(uint16_t baseAddress,
+
625  uint8_t converter,
+
626  uint8_t gain);
+
627 
+
628 //*****************************************************************************
+
629 //
+
648 //
+
649 //*****************************************************************************
+
650 extern uint32_t CTSD16_getResults(uint16_t baseAddress,
+
651  uint8_t converter);
+
652 
+
653 //*****************************************************************************
+
654 //
+
672 //
+
673 //*****************************************************************************
+
674 extern uint16_t CTSD16_getHighWordResults(uint16_t baseAddress,
+
675  uint8_t converter);
+
676 
+
677 //*****************************************************************************
+
678 //
+
690 //
+
691 //*****************************************************************************
+
692 extern uint16_t CTSD16_isRailToRailInputReady(uint16_t baseAddress);
+
693 
+
694 //*****************************************************************************
+
695 //
+
719 //
+
720 //*****************************************************************************
+
721 extern void CTSD16_enableInterrupt(uint16_t baseAddress,
+
722  uint8_t converter,
+
723  uint16_t mask);
+
724 
+
725 //*****************************************************************************
+
726 //
+
751 //
+
752 //*****************************************************************************
+
753 extern void CTSD16_disableInterrupt(uint16_t baseAddress,
+
754  uint8_t converter,
+
755  uint16_t mask);
+
756 
+
757 //*****************************************************************************
+
758 //
+
780 //
+
781 //*****************************************************************************
+
782 extern void CTSD16_clearInterrupt(uint16_t baseAddress,
+
783  uint8_t converter,
+
784  uint16_t mask);
+
785 
+
786 //*****************************************************************************
+
787 //
+
811 //
+
812 //*****************************************************************************
+
813 extern uint16_t CTSD16_getInterruptStatus(uint16_t baseAddress,
+
814  uint8_t converter,
+
815  uint16_t mask);
+
816 
+
817 //*****************************************************************************
+
818 //
+
819 // Mark the end of the C bindings section for C++ compilers.
+
820 //
+
821 //*****************************************************************************
+
822 #ifdef __cplusplus
+
823 }
+
824 #endif
+
825 
+
826 #endif
+
827 #endif // __MSP430WARE_CTSD16_H__
+ +
+
+ + + + diff --git a/Documentation/html/dac12__a_8c.html b/Documentation/html/dac12__a_8c.html new file mode 100644 index 0000000..295bb82 --- /dev/null +++ b/Documentation/html/dac12__a_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/dac12_a.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dac12_a.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/dac12__a_8c_source.html b/Documentation/html/dac12__a_8c_source.html new file mode 100644 index 0000000..b45e58a --- /dev/null +++ b/Documentation/html/dac12__a_8c_source.html @@ -0,0 +1,317 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/dac12_a.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dac12_a.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // dac12_a.c - Driver for the dac12_a Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_DAC12_2__
+
17 #include "dac12_a.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 bool DAC12_A_init(uint16_t baseAddress, DAC12_A_initParam *param)
+
22 {
+
23  baseAddress += param->submoduleSelect; //Add 0x10 to base address IF
+
24  //DAC12_A_1 is selected.
+
25  HWREG16(baseAddress + OFS_DAC12_0CTL1) &= ~(DAC12OG + DAC12DFJ);
+
26 
+
27  //Reset and Set DAC12_A Control 0 Bits
+
28  HWREG16(baseAddress + OFS_DAC12_0CTL0) = param->outputSelect
+
29  + param->positiveReferenceVoltage
+
30  + param->amplifierSetting
+
31  + param->conversionTriggerSelect;
+
32 
+
33  if (DAC12_A_VREFx1 == param->outputVoltageMultiplier){
+
34  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= DAC12IR;
+
35  } else if (DAC12_A_VREFx2 == param->outputVoltageMultiplier){
+
36  HWREG16(baseAddress + OFS_DAC12_0CTL1) |= DAC12OG;
+
37  }
+
38  //else if(DAC12_A_VREFx3 == outputVoltageMultiplier)
+
39  //Both DAC12IR and DAC12OG values == 0
+
40 
+
41  return ( STATUS_SUCCESS) ;
+
42 }void DAC12_A_setAmplifierSetting (uint16_t baseAddress,
+
43  uint8_t submoduleSelect,
+
44  uint8_t amplifierSetting)
+
45 {
+
46  //Reset amplifier setting to set it
+
47  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) &= ~(DAC12AMP_7);
+
48  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) |= amplifierSetting;
+
49 }
+
50 
+
51 void DAC12_A_disable (uint16_t baseAddress,
+
52  uint8_t submoduleSelect)
+
53 {
+
54  //Reset amplifier setting to turn DAC12_A off completely
+
55  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) &= ~(DAC12AMP_7);
+
56 }
+
57 
+
58 void DAC12_A_enableGrouping (uint16_t baseAddress)
+
59 {
+
60  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= DAC12GRP;
+
61 }
+
62 
+
63 void DAC12_A_disableGrouping (uint16_t baseAddress)
+
64 {
+
65  HWREG16(baseAddress + OFS_DAC12_0CTL0) &= ~(DAC12GRP);
+
66 }
+
67 
+
68 void DAC12_A_enableInterrupt (uint16_t baseAddress,
+
69  uint8_t submoduleSelect)
+
70 {
+
71  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) |= DAC12IE;
+
72 }
+
73 
+
74 void DAC12_A_disableInterrupt (uint16_t baseAddress,
+
75  uint8_t submoduleSelect)
+
76 {
+
77  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) &= ~(DAC12IE);
+
78 }
+
79 
+
80 uint16_t DAC12_A_getInterruptStatus (uint16_t baseAddress,
+
81  uint8_t submoduleSelect)
+
82 {
+
83  return (HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) & DAC12IFG);
+
84 }
+
85 
+
86 void DAC12_A_clearInterrupt (uint16_t baseAddress,
+
87  uint8_t submoduleSelect)
+
88 {
+
89  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) &= ~(DAC12IFG);
+
90 }
+
91 
+
92 void DAC12_A_calibrateOutput (uint16_t baseAddress,
+
93  uint8_t submoduleSelect)
+
94 {
+
95  //Unlock Calibration
+
96  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CALCTL) = DAC12PW;
+
97 
+
98  //Start Calibration
+
99  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) |= DAC12CALON;
+
100 
+
101  //Wait for Calibration to Finish
+
102  while (HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) & DAC12CALON);
+
103 
+
104  //Lock Calibration
+
105  HWREG16(baseAddress + submoduleSelect +
+
106  OFS_DAC12_0CALCTL) = DAC12PW + DAC12LOCK;
+
107 }
+
108 
+
109 uint16_t DAC12_A_getCalibrationData (uint16_t baseAddress,
+
110  uint8_t submoduleSelect)
+
111 {
+
112  return ((uint16_t)(HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CALDAT))) ;
+
113 }
+
114 
+
115 void DAC12_A_setCalibrationOffset (uint16_t baseAddress,
+
116  uint8_t submoduleSelect,
+
117  uint16_t calibrationOffsetValue)
+
118 {
+
119  //Unlock Calibration
+
120  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CALCTL) = DAC12PW;
+
121 
+
122  //Set Calibration Offset
+
123  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CALDAT) =
+
124  calibrationOffsetValue;
+
125 
+
126  //Lock Calibration
+
127  HWREG16(baseAddress + submoduleSelect +
+
128  OFS_DAC12_0CALCTL) = DAC12PW + DAC12LOCK;
+
129 }
+
130 
+
131 void DAC12_A_enableConversions (uint16_t baseAddress,
+
132  uint8_t submoduleSelect)
+
133 {
+
134  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) |= DAC12ENC;
+
135 }
+
136 
+
137 void DAC12_A_setData (uint16_t baseAddress,
+
138  uint8_t submoduleSelect,
+
139  uint16_t data)
+
140 {
+
141  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0DAT) = data;
+
142 }
+
143 
+
144 void DAC12_A_disableConversions (uint16_t baseAddress,
+
145  uint8_t submoduleSelect)
+
146 {
+
147  HWREG16(baseAddress + submoduleSelect + OFS_DAC12_0CTL0) &= ~(DAC12ENC);
+
148 }
+
149 
+
150 void DAC12_A_setResolution (uint16_t baseAddress,
+
151  uint8_t submoduleSelect,
+
152  uint16_t resolutionSelect)
+
153 {
+
154  //Store the ENC bit status
+
155  uint16_t conversionsEnabledStatus =
+
156  ( HWREG16(baseAddress + OFS_DAC12_0CTL0) & (DAC12ENC) );
+
157 
+
158  baseAddress += submoduleSelect; //Add 0x10 to base address IF
+
159  //DAC12_A_1 is selected.
+
160 
+
161  if (DAC12_A_RESOLUTION_8BIT == resolutionSelect){
+
162  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= DAC12RES;
+
163  } else if (DAC12_A_RESOLUTION_12BIT == resolutionSelect){
+
164  HWREG16(baseAddress + OFS_DAC12_0CTL0) &= ~(DAC12RES);
+
165  }
+
166 
+
167  //Restore the ENC bit status
+
168  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= conversionsEnabledStatus;
+
169 }
+
170 
+
171 void DAC12_A_setInputDataFormat (uint16_t baseAddress,
+
172  uint8_t submoduleSelect,
+
173  uint8_t inputJustification,
+
174  uint8_t inputSign)
+
175 {
+
176  //Store the ENC bit status
+
177  uint16_t conversionsEnabledStatus =
+
178  ( HWREG16(baseAddress + OFS_DAC12_0CTL0) & (DAC12ENC) );
+
179 
+
180  baseAddress += submoduleSelect; //Add 0x10 to base address IF
+
181  //DAC12_A_1 is selected.
+
182 
+
183  if (DAC12_A_JUSTIFICATION_LEFT == inputJustification){
+
184  HWREG16(baseAddress + OFS_DAC12_0CTL1) |= DAC12DFJ;
+
185  } else if (DAC12_A_JUSTIFICATION_RIGHT == inputJustification){
+
186  HWREG16(baseAddress + OFS_DAC12_0CTL1) &= ~(DAC12DFJ);
+
187  }
+
188 
+
189  if (DAC12_A_SIGNED_2SCOMPLEMENT == inputSign){
+
190  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= DAC12DF;
+
191  } else if (DAC12_A_UNSIGNED_BINARY == inputSign){
+
192  HWREG16(baseAddress + OFS_DAC12_0CTL0) &= ~(DAC12DF);
+
193  }
+
194 
+
195  //Restore the ENC bit status
+
196  HWREG16(baseAddress + OFS_DAC12_0CTL0) |= conversionsEnabledStatus;
+
197 }
+
198 
+
199 uint32_t DAC12_A_getDataBufferMemoryAddressForDMA (uint16_t baseAddress,
+
200  uint8_t submoduleSelect)
+
201 {
+
202  return ( baseAddress + submoduleSelect + OFS_DAC12_0DAT );
+
203 }
+
204 
+
205 
+
206 #endif
+
207 //*****************************************************************************
+
208 //
+
211 //
+
212 //*****************************************************************************
+ + +
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/dac12__a_8h.html b/Documentation/html/dac12__a_8h.html new file mode 100644 index 0000000..7d358ab --- /dev/null +++ b/Documentation/html/dac12__a_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/dac12_a.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dac12_a.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/dac12__a_8h_source.html b/Documentation/html/dac12__a_8h_source.html new file mode 100644 index 0000000..3344521 --- /dev/null +++ b/Documentation/html/dac12__a_8h_source.html @@ -0,0 +1,405 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/dac12_a.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dac12_a.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // dac12_a.h - Driver for the DAC12_A Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_DAC12_A_H__
+
8 #define __MSP430WARE_DAC12_A_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_DAC12_2__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
29 //
+
30 //*****************************************************************************
+
31 typedef struct DAC12_A_initParam {
+
36  uint8_t submoduleSelect;
+
41  uint16_t outputSelect;
+
50  uint16_t positiveReferenceVoltage;
+
56  uint16_t outputVoltageMultiplier;
+
80  uint8_t amplifierSetting;
+
97  uint16_t conversionTriggerSelect;
+
98 } DAC12_A_initParam;
+
99 
+
100 
+
101 //*****************************************************************************
+
102 //
+
103 // The following are values that can be passed to the positiveReferenceVoltage
+
104 // parameter for functions: DAC12_A_init(); the param parameter for functions:
+
105 // DAC12_A_init().
+
106 //
+
107 //*****************************************************************************
+
108 #define DAC12_A_VREF_INT (DAC12SREF_0)
+
109 #define DAC12_A_VREF_AVCC (DAC12SREF_1)
+
110 #define DAC12_A_VREF_EXT (DAC12SREF_2)
+
111 
+
112 //*****************************************************************************
+
113 //
+
114 // The following are values that can be passed to the param parameter for
+
115 // functions: DAC12_A_init(); the amplifierSetting parameter for functions:
+
116 // DAC12_A_init(), and DAC12_A_setAmplifierSetting().
+
117 //
+
118 //*****************************************************************************
+
119 #define DAC12_A_AMP_OFF_PINOUTHIGHZ (DAC12AMP_0)
+
120 #define DAC12_A_AMP_OFF_PINOUTLOW (DAC12AMP_1)
+
121 #define DAC12_A_AMP_LOWIN_LOWOUT (DAC12AMP_2)
+
122 #define DAC12_A_AMP_LOWIN_MEDOUT (DAC12AMP_3)
+
123 #define DAC12_A_AMP_LOWIN_HIGHOUT (DAC12AMP_4)
+
124 #define DAC12_A_AMP_MEDIN_MEDOUT (DAC12AMP_5)
+
125 #define DAC12_A_AMP_MEDIN_HIGHOUT (DAC12AMP_6)
+
126 #define DAC12_A_AMP_HIGHIN_HIGHOUT (DAC12AMP_7)
+
127 
+
128 //*****************************************************************************
+
129 //
+
130 // The following are values that can be passed to the outputSelect parameter
+
131 // for functions: DAC12_A_init(); the param parameter for functions:
+
132 // DAC12_A_init().
+
133 //
+
134 //*****************************************************************************
+
135 #define DAC12_A_OUTPUT_1 (!(DAC12OPS))
+
136 #define DAC12_A_OUTPUT_2 (DAC12OPS)
+
137 
+
138 //*****************************************************************************
+
139 //
+
140 // The following are values that can be passed to the submoduleSelect parameter
+
141 // for functions: DAC12_A_init(), DAC12_A_setAmplifierSetting(),
+
142 // DAC12_A_disable(), DAC12_A_enableInterrupt(), DAC12_A_disableInterrupt(),
+
143 // DAC12_A_getInterruptStatus(), DAC12_A_clearInterrupt(),
+
144 // DAC12_A_calibrateOutput(), DAC12_A_getCalibrationData(),
+
145 // DAC12_A_setCalibrationOffset(), DAC12_A_enableConversions(),
+
146 // DAC12_A_setData(), DAC12_A_disableConversions(), DAC12_A_setResolution(),
+
147 // DAC12_A_setInputDataFormat(), and
+
148 // DAC12_A_getDataBufferMemoryAddressForDMA(); the param parameter for
+
149 // functions: DAC12_A_init().
+
150 //
+
151 //*****************************************************************************
+
152 #define DAC12_A_SUBMODULE_0 (0x00)
+
153 #define DAC12_A_SUBMODULE_1 (0x10)
+
154 
+
155 //*****************************************************************************
+
156 //
+
157 // The following are values that can be passed to the outputVoltageMultiplier
+
158 // parameter for functions: DAC12_A_init(); the param parameter for functions:
+
159 // DAC12_A_init().
+
160 //
+
161 //*****************************************************************************
+
162 #define DAC12_A_VREFx1 (DAC12IR)
+
163 #define DAC12_A_VREFx2 (DAC12OG)
+
164 #define DAC12_A_VREFx3 (0x0)
+
165 
+
166 //*****************************************************************************
+
167 //
+
168 // The following are values that can be passed to the conversionTriggerSelect
+
169 // parameter for functions: DAC12_A_init(); the param parameter for functions:
+
170 // DAC12_A_init().
+
171 //
+
172 //*****************************************************************************
+
173 #define DAC12_A_TRIGGER_ENCBYPASS (DAC12LSEL_0)
+
174 #define DAC12_A_TRIGGER_ENC (DAC12LSEL_1)
+
175 #define DAC12_A_TRIGGER_TA (DAC12LSEL_2)
+
176 #define DAC12_A_TRIGGER_TB (DAC12LSEL_3)
+
177 
+
178 //*****************************************************************************
+
179 //
+
180 // The following are values that can be passed to the resolutionSelect
+
181 // parameter for functions: DAC12_A_setResolution().
+
182 //
+
183 //*****************************************************************************
+
184 #define DAC12_A_RESOLUTION_8BIT (DAC12RES)
+
185 #define DAC12_A_RESOLUTION_12BIT (!(DAC12RES))
+
186 
+
187 //*****************************************************************************
+
188 //
+
189 // The following are values that can be passed to the inputJustification
+
190 // parameter for functions: DAC12_A_setInputDataFormat().
+
191 //
+
192 //*****************************************************************************
+
193 #define DAC12_A_JUSTIFICATION_RIGHT (!(DAC12DFJ))
+
194 #define DAC12_A_JUSTIFICATION_LEFT (DAC12DFJ)
+
195 
+
196 //*****************************************************************************
+
197 //
+
198 // The following are values that can be passed to the inputSign parameter for
+
199 // functions: DAC12_A_setInputDataFormat().
+
200 //
+
201 //*****************************************************************************
+
202 #define DAC12_A_UNSIGNED_BINARY (!(DAC12DF))
+
203 #define DAC12_A_SIGNED_2SCOMPLEMENT (DAC12DF)
+
204 
+
205 //*****************************************************************************
+
206 //
+
207 // The following are values that can be passed toThe following are values that
+
208 // can be returned by the DAC12_A_getInterruptStatus() function.
+
209 //
+
210 //*****************************************************************************
+
211 #define DAC12_A_INT_ACTIVE (DAC12IFG)
+
212 #define DAC12_A_INT_INACTIVE (0x00)
+
213 
+
214 //*****************************************************************************
+
215 //
+
216 // Prototypes for the APIs.
+
217 //
+
218 //*****************************************************************************
+
219 
+
220 //*****************************************************************************
+
221 //
+
235 //
+
236 //*****************************************************************************
+
237 extern bool DAC12_A_init(uint16_t baseAddress,
+
238  DAC12_A_initParam *param);
+
239 
+
240 //*****************************************************************************
+
241 //
+
279 //
+
280 //*****************************************************************************
+
281 extern void DAC12_A_setAmplifierSetting(uint16_t baseAddress,
+
282  uint8_t submoduleSelect,
+
283  uint8_t amplifierSetting);
+
284 
+
285 //*****************************************************************************
+
286 //
+
301 //
+
302 //*****************************************************************************
+
303 extern void DAC12_A_disable(uint16_t baseAddress,
+
304  uint8_t submoduleSelect);
+
305 
+
306 //*****************************************************************************
+
307 //
+
323 //
+
324 //*****************************************************************************
+
325 extern void DAC12_A_enableGrouping(uint16_t baseAddress);
+
326 
+
327 //*****************************************************************************
+
328 //
+
337 //
+
338 //*****************************************************************************
+
339 extern void DAC12_A_disableGrouping(uint16_t baseAddress);
+
340 
+
341 //*****************************************************************************
+
342 //
+
359 //
+
360 //*****************************************************************************
+
361 extern void DAC12_A_enableInterrupt(uint16_t baseAddress,
+
362  uint8_t submoduleSelect);
+
363 
+
364 //*****************************************************************************
+
365 //
+
379 //
+
380 //*****************************************************************************
+
381 extern void DAC12_A_disableInterrupt(uint16_t baseAddress,
+
382  uint8_t submoduleSelect);
+
383 
+
384 //*****************************************************************************
+
385 //
+
402 //
+
403 //*****************************************************************************
+
404 extern uint16_t DAC12_A_getInterruptStatus(uint16_t baseAddress,
+
405  uint8_t submoduleSelect);
+
406 
+
407 //*****************************************************************************
+
408 //
+
424 //
+
425 //*****************************************************************************
+
426 extern void DAC12_A_clearInterrupt(uint16_t baseAddress,
+
427  uint8_t submoduleSelect);
+
428 
+
429 //*****************************************************************************
+
430 //
+
448 //
+
449 //*****************************************************************************
+
450 extern void DAC12_A_calibrateOutput(uint16_t baseAddress,
+
451  uint8_t submoduleSelect);
+
452 
+
453 //*****************************************************************************
+
454 //
+
470 //
+
471 //*****************************************************************************
+
472 extern uint16_t DAC12_A_getCalibrationData(uint16_t baseAddress,
+
473  uint8_t submoduleSelect);
+
474 
+
475 //*****************************************************************************
+
476 //
+
495 //
+
496 //*****************************************************************************
+
497 extern void DAC12_A_setCalibrationOffset(uint16_t baseAddress,
+
498  uint8_t submoduleSelect,
+
499  uint16_t calibrationOffsetValue);
+
500 
+
501 //*****************************************************************************
+
502 //
+
519 //
+
520 //*****************************************************************************
+
521 extern void DAC12_A_enableConversions(uint16_t baseAddress,
+
522  uint8_t submoduleSelect);
+
523 
+
524 //*****************************************************************************
+
525 //
+
551 //
+
552 //*****************************************************************************
+
553 extern void DAC12_A_setData(uint16_t baseAddress,
+
554  uint8_t submoduleSelect,
+
555  uint16_t data);
+
556 
+
557 //*****************************************************************************
+
558 //
+
574 //
+
575 //*****************************************************************************
+
576 extern void DAC12_A_disableConversions(uint16_t baseAddress,
+
577  uint8_t submoduleSelect);
+
578 
+
579 //*****************************************************************************
+
580 //
+
599 //
+
600 //*****************************************************************************
+
601 extern void DAC12_A_setResolution(uint16_t baseAddress,
+
602  uint8_t submoduleSelect,
+
603  uint16_t resolutionSelect);
+
604 
+
605 //*****************************************************************************
+
606 //
+
628 //
+
629 //*****************************************************************************
+
630 extern void DAC12_A_setInputDataFormat(uint16_t baseAddress,
+
631  uint8_t submoduleSelect,
+
632  uint8_t inputJustification,
+
633  uint8_t inputSign);
+
634 
+
635 //*****************************************************************************
+
636 //
+
650 //
+
651 //*****************************************************************************
+
652 extern uint32_t DAC12_A_getDataBufferMemoryAddressForDMA(uint16_t baseAddress,
+
653  uint8_t submoduleSelect);
+
654 
+
655 //*****************************************************************************
+
656 //
+
657 // Mark the end of the C bindings section for C++ compilers.
+
658 //
+
659 //*****************************************************************************
+
660 #ifdef __cplusplus
+
661 }
+
662 #endif
+
663 
+
664 #endif
+
665 #endif // __MSP430WARE_DAC12_A_H__
+ +
+
+ + + + diff --git a/Documentation/html/design_choices.html b/Documentation/html/design_choices.html index 165c0c5..e27d1c4 100644 --- a/Documentation/html/design_choices.html +++ b/Documentation/html/design_choices.html @@ -96,8 +96,20 @@ $(document).ready(function(){initNavTree('design_choices.html',''); initResizabl JTAG Interface

When connecting the MCU to the programmer via the JTAG interface, it is possible for a local power supply connected to the MCU to be used or for power from the debugging/programming adapter to be used. Since having power supplied to the MCU from the debugging/programming adapter can be useful for use outside of the Sunseeker vehicle, we chose to use that.

-Microcontroller Peripheral Connections

-

Universal Serial Communication Interfaces (USCIs):

+Microcontroller Connections +

The board is going to be organized to the best of our abilities to be organized as such:

+ +

+Universal Serial Communication Interfaces (USCIs):

-

+

Real-Time Clock/Calendar: Microchip Technology ‎MCP7940MT-I/SN

-

+

Bluetooth/Wi-Fi: Espressif Systems ESP32-WROVER-IE (8MB)

-

-GPS Receiver: Maxim Integrated ‎MAX2771ETI+T

+

+GPS Receiver: U-Blox NEO-M8Q-01A

-

+

CANbus Controller: Microchip Technology MCP2515T-I/SO

-

+

CANbus Transceiver: ‎Microchip Technology MCP2542FD-H/SN

-

+

SD Card (Generic)

-

+

USB to UART Bridge: Future Technology Devices International FT230XS-R

-

+

RS-232 Transceiver: STMicroelectronics ST232CDR

-

-Inertial Measurement Unit: TDK InvenSense ICM-20600

+

+Inertial Measurement Unit: TDK InvenSense ICM-20948

-

+

Adding Images

Use this pattern/format:

@image html "Documentation Guide.assets/Funny-Cat-Hidden.jpg"
@cond EXCLUDED
@@ -128,7 +128,7 @@ Adding Images diff --git a/Documentation/html/driverlib_8h.html b/Documentation/html/driverlib_8h.html new file mode 100644 index 0000000..4a088b6 --- /dev/null +++ b/Documentation/html/driverlib_8h.html @@ -0,0 +1,149 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/driverlib.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
driverlib.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+#include "eusci_b_i2c.h"
+#include "ctsd16.h"
+#include "battbak.h"
+#include "timer_b.h"
+#include "timer_d.h"
+#include "eusci_a_spi.h"
+#include "eusci_a_uart.h"
+#include "comp_b.h"
+#include "tlv.h"
+#include "dac12_a.h"
+#include "timer_a.h"
+#include "usci_a_uart.h"
+#include "pmm.h"
+#include "sysctl.h"
+#include "adc10_a.h"
+#include "sfr.h"
+#include "mpy32.h"
+#include "wdt_a.h"
+#include "ucs.h"
+#include "pmap.h"
+#include "rtc_a.h"
+#include "usci_b_i2c.h"
+#include "usci_b_spi.h"
+#include "ldopwr.h"
+#include "lcd_c.h"
+#include "tec.h"
+#include "rtc_c.h"
+#include "gpio.h"
+#include "adc12_a.h"
+#include "aes.h"
+#include "oa.h"
+#include "rtc_b.h"
+#include "sd24_b.h"
+#include "ram.h"
+#include "dma.h"
+#include "ref.h"
+#include "eusci_b_spi.h"
+#include "usci_a_spi.h"
+#include "lcd_b.h"
+#include "flashctl.h"
+#include "crc.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/driverlib_8h_source.html b/Documentation/html/driverlib_8h_source.html new file mode 100644 index 0000000..a92738d --- /dev/null +++ b/Documentation/html/driverlib_8h_source.html @@ -0,0 +1,190 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/driverlib.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
driverlib.h
+
+
+Go to the documentation of this file.
1 #include "inc/hw_memmap.h"
+
2 
+
3 #include "eusci_b_i2c.h"
+
4 #include "ctsd16.h"
+
5 #include "battbak.h"
+
6 #include "timer_b.h"
+
7 #include "timer_d.h"
+
8 #include "eusci_a_spi.h"
+
9 #include "eusci_a_uart.h"
+
10 #include "comp_b.h"
+
11 #include "tlv.h"
+
12 #include "dac12_a.h"
+
13 #include "timer_a.h"
+
14 #include "usci_a_uart.h"
+
15 #include "pmm.h"
+
16 #include "sysctl.h"
+
17 #include "adc10_a.h"
+
18 #include "sfr.h"
+
19 #include "mpy32.h"
+
20 #include "wdt_a.h"
+
21 #include "ucs.h"
+
22 #include "pmap.h"
+
23 #include "rtc_a.h"
+
24 #include "usci_b_i2c.h"
+
25 #include "usci_b_spi.h"
+
26 #include "ldopwr.h"
+
27 #include "lcd_c.h"
+
28 #include "tec.h"
+
29 #include "rtc_c.h"
+
30 #include "gpio.h"
+
31 #include "adc12_a.h"
+
32 #include "aes.h"
+
33 #include "oa.h"
+
34 #include "rtc_b.h"
+
35 #include "sd24_b.h"
+
36 #include "ram.h"
+
37 #include "dma.h"
+
38 #include "ref.h"
+
39 #include "eusci_b_spi.h"
+
40 #include "usci_a_spi.h"
+
41 #include "lcd_b.h"
+
42 #include "flashctl.h"
+
43 #include "crc.h"
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/Documentation/html/eusci__a__spi_8c.html b/Documentation/html/eusci__a__spi_8c.html new file mode 100644 index 0000000..b2ec1c4 --- /dev/null +++ b/Documentation/html/eusci__a__spi_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_spi.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_spi.c File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__a__spi_8c_source.html b/Documentation/html/eusci__a__spi_8c_source.html new file mode 100644 index 0000000..a4bca29 --- /dev/null +++ b/Documentation/html/eusci__a__spi_8c_source.html @@ -0,0 +1,301 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_spi.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_spi.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_a_spi.c - Driver for the eusci_a_spi Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_EUSCI_Ax__
+
17 #include "eusci_a_spi.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void EUSCI_A_SPI_initMaster (uint16_t baseAddress,
+
22  EUSCI_A_SPI_initMasterParam *param)
+
23 {
+
24  //Disable the USCI Module
+
25  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
26 
+
27  //Reset OFS_UCAxCTLW0 values
+
28  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCCKPH + UCCKPL + UC7BIT + UCMSB +
+
29  UCMST + UCMODE_3 + UCSYNC);
+
30 
+
31  //Reset OFS_UCAxCTLW0 values
+
32  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSSEL_3);
+
33 
+
34  //Select Clock
+
35  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (uint16_t)param->selectClockSource;
+
36 
+
37  HWREG16(baseAddress + OFS_UCAxBRW) =
+
38  (uint16_t)(param->clockSourceFrequency / param->desiredSpiClock);
+
39 
+
40  /*
+
41  * Configure as SPI master mode.
+
42  * Clock phase select, polarity, msb
+
43  * UCMST = Master mode
+
44  * UCSYNC = Synchronous mode
+
45  * UCMODE_0 = 3-pin SPI
+
46  */
+
47  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (
+
48  param->msbFirst +
+
49  param->clockPhase +
+
50  param->clockPolarity +
+
51  UCMST +
+
52  UCSYNC +
+
53  param->spiMode
+
54  );
+
55  //No modulation
+
56  HWREG16(baseAddress + OFS_UCAxMCTLW) = 0;
+
57 }
+
58 
+
59 void EUSCI_A_SPI_select4PinFunctionality (uint16_t baseAddress,
+
60  uint16_t select4PinFunctionality
+
61  )
+
62 {
+
63  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCSTEM;
+
64  HWREG16(baseAddress + OFS_UCAxCTLW0) |= select4PinFunctionality;
+
65 }
+
66 
+
67 void EUSCI_A_SPI_changeMasterClock (uint16_t baseAddress,
+
68  EUSCI_A_SPI_changeMasterClockParam *param)
+
69 {
+
70  //Disable the USCI Module
+
71  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
72 
+
73  HWREG16(baseAddress + OFS_UCAxBRW) =
+
74  (uint16_t)(param->clockSourceFrequency / param->desiredSpiClock);
+
75 
+
76  //Reset the UCSWRST bit to enable the USCI Module
+
77  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSWRST);
+
78 }
+
79 
+
80 void EUSCI_A_SPI_initSlave (uint16_t baseAddress, EUSCI_A_SPI_initSlaveParam *param)
+
81 {
+
82  //Disable USCI Module
+
83  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
84 
+
85  //Reset OFS_UCAxCTLW0 register
+
86  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCMSB +
+
87  UC7BIT +
+
88  UCMST +
+
89  UCCKPL +
+
90  UCCKPH +
+
91  UCMODE_3
+
92  );
+
93 
+
94  //Clock polarity, phase select, msbFirst, SYNC, Mode0
+
95  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (param->clockPhase +
+
96  param->clockPolarity +
+
97  param->msbFirst +
+
98  UCSYNC +
+
99  param->spiMode
+
100  );
+
101 }
+
102 
+
103 void EUSCI_A_SPI_changeClockPhasePolarity (uint16_t baseAddress,
+
104  uint16_t clockPhase,
+
105  uint16_t clockPolarity
+
106  )
+
107 {
+
108  //Disable the USCI Module
+
109  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
110 
+
111  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCCKPH + UCCKPL);
+
112 
+
113  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (
+
114  clockPhase +
+
115  clockPolarity
+
116  );
+
117 
+
118  //Reset the UCSWRST bit to enable the USCI Module
+
119  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSWRST);
+
120 }
+
121 
+
122 void EUSCI_A_SPI_transmitData ( uint16_t baseAddress,
+
123  uint8_t transmitData
+
124  )
+
125 {
+
126  HWREG16(baseAddress + OFS_UCAxTXBUF) = transmitData;
+
127 }
+
128 
+
129 uint8_t EUSCI_A_SPI_receiveData (uint16_t baseAddress)
+
130 {
+
131  return ( HWREG16(baseAddress + OFS_UCAxRXBUF)) ;
+
132 }
+
133 
+
134 void EUSCI_A_SPI_enableInterrupt (uint16_t baseAddress,
+
135  uint16_t mask
+
136  )
+
137 {
+
138  HWREG16(baseAddress + OFS_UCAxIE) |= mask;
+
139 }
+
140 
+
141 void EUSCI_A_SPI_disableInterrupt (uint16_t baseAddress,
+
142  uint16_t mask
+
143  )
+
144 {
+
145  HWREG16(baseAddress + OFS_UCAxIE) &= ~mask;
+
146 }
+
147 
+
148 uint8_t EUSCI_A_SPI_getInterruptStatus (uint16_t baseAddress,
+
149  uint8_t mask
+
150  )
+
151 {
+
152  return ( HWREG16(baseAddress + OFS_UCAxIFG) & mask );
+
153 }
+
154 
+
155 void EUSCI_A_SPI_clearInterrupt (uint16_t baseAddress,
+
156  uint16_t mask
+
157  )
+
158 {
+
159  HWREG16(baseAddress + OFS_UCAxIFG) &= ~mask;
+
160 }
+
161 
+
162 void EUSCI_A_SPI_enable (uint16_t baseAddress)
+
163 {
+
164  //Reset the UCSWRST bit to enable the USCI Module
+
165  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSWRST);
+
166 }
+
167 
+
168 void EUSCI_A_SPI_disable (uint16_t baseAddress)
+
169 {
+
170  //Set the UCSWRST bit to disable the USCI Module
+
171  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
172 }
+
173 
+
174 uint32_t EUSCI_A_SPI_getReceiveBufferAddress (uint16_t baseAddress)
+
175 {
+
176  return ( baseAddress + OFS_UCAxRXBUF );
+
177 }
+
178 
+
179 uint32_t EUSCI_A_SPI_getTransmitBufferAddress (uint16_t baseAddress)
+
180 {
+
181  return ( baseAddress + OFS_UCAxTXBUF );
+
182 }
+
183 
+
184 uint16_t EUSCI_A_SPI_isBusy (uint16_t baseAddress)
+
185 {
+
186  //Return the bus busy status.
+
187  return (HWREG16(baseAddress + OFS_UCAxSTATW) & UCBUSY);
+
188 }
+
189 
+
190 
+
191 #endif
+
192 //*****************************************************************************
+
193 //
+
196 //
+
197 //*****************************************************************************
+ + +
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/eusci__a__spi_8h.html b/Documentation/html/eusci__a__spi_8h.html new file mode 100644 index 0000000..4099f49 --- /dev/null +++ b/Documentation/html/eusci__a__spi_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_spi.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_spi.h File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__a__spi_8h_source.html b/Documentation/html/eusci__a__spi_8h_source.html new file mode 100644 index 0000000..525a159 --- /dev/null +++ b/Documentation/html/eusci__a__spi_8h_source.html @@ -0,0 +1,368 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_spi.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_spi.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_a_spi.h - Driver for the EUSCI_A_SPI Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_EUSCI_A_SPI_H__
+
8 #define __MSP430WARE_EUSCI_A_SPI_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_EUSCI_Ax__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
30 //
+
31 //*****************************************************************************
+
32 typedef struct EUSCI_A_SPI_changeMasterClockParam {
+
34  uint32_t clockSourceFrequency;
+
36  uint32_t desiredSpiClock;
+
37 } EUSCI_A_SPI_changeMasterClockParam;
+
38 
+
39 //*****************************************************************************
+
40 //
+
42 //
+
43 //*****************************************************************************
+
44 typedef struct EUSCI_A_SPI_initSlaveParam {
+
49  uint16_t msbFirst;
+
54  uint16_t clockPhase;
+
59  uint16_t clockPolarity;
+
65  uint16_t spiMode;
+
66 } EUSCI_A_SPI_initSlaveParam;
+
67 
+
68 //*****************************************************************************
+
69 //
+
72 //
+
73 //*****************************************************************************
+
74 typedef struct EUSCI_A_SPI_initMasterParam {
+
80  uint8_t selectClockSource;
+
82  uint32_t clockSourceFrequency;
+
84  uint32_t desiredSpiClock;
+
89  uint16_t msbFirst;
+
94  uint16_t clockPhase;
+
99  uint16_t clockPolarity;
+
105  uint16_t spiMode;
+
106 } EUSCI_A_SPI_initMasterParam;
+
107 
+
108 
+
109 //*****************************************************************************
+
110 //
+
111 // The following are values that can be passed to the clockPhase parameter for
+
112 // functions: EUSCI_A_SPI_changeClockPhasePolarity(); the param parameter for
+
113 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
+
114 //
+
115 //*****************************************************************************
+
116 #define EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00
+
117 #define EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT UCCKPH
+
118 
+
119 //*****************************************************************************
+
120 //
+
121 // The following are values that can be passed to the param parameter for
+
122 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
+
123 //
+
124 //*****************************************************************************
+
125 #define EUSCI_A_SPI_MSB_FIRST UCMSB
+
126 #define EUSCI_A_SPI_LSB_FIRST 0x00
+
127 
+
128 //*****************************************************************************
+
129 //
+
130 // The following are values that can be passed to the param parameter for
+
131 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave(); the
+
132 // clockPolarity parameter for functions:
+
133 // EUSCI_A_SPI_changeClockPhasePolarity().
+
134 //
+
135 //*****************************************************************************
+
136 #define EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH UCCKPL
+
137 #define EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00
+
138 
+
139 //*****************************************************************************
+
140 //
+
141 // The following are values that can be passed to the param parameter for
+
142 // functions: EUSCI_A_SPI_initMaster().
+
143 //
+
144 //*****************************************************************************
+
145 #define EUSCI_A_SPI_CLOCKSOURCE_ACLK UCSSEL__ACLK
+
146 #define EUSCI_A_SPI_CLOCKSOURCE_SMCLK UCSSEL__SMCLK
+
147 
+
148 //*****************************************************************************
+
149 //
+
150 // The following are values that can be passed to the param parameter for
+
151 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
+
152 //
+
153 //*****************************************************************************
+
154 #define EUSCI_A_SPI_3PIN UCMODE_0
+
155 #define EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH UCMODE_1
+
156 #define EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW UCMODE_2
+
157 
+
158 //*****************************************************************************
+
159 //
+
160 // The following are values that can be passed to the select4PinFunctionality
+
161 // parameter for functions: EUSCI_A_SPI_select4PinFunctionality().
+
162 //
+
163 //*****************************************************************************
+
164 #define EUSCI_A_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x0000
+
165 #define EUSCI_A_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE UCSTEM
+
166 
+
167 //*****************************************************************************
+
168 //
+
169 // The following are values that can be passed to the mask parameter for
+
170 // functions: EUSCI_A_SPI_enableInterrupt(), EUSCI_A_SPI_disableInterrupt(),
+
171 // EUSCI_A_SPI_getInterruptStatus(), and EUSCI_A_SPI_clearInterrupt() as well
+
172 // as returned by the EUSCI_A_SPI_getInterruptStatus() function.
+
173 //
+
174 //*****************************************************************************
+
175 #define EUSCI_A_SPI_TRANSMIT_INTERRUPT UCTXIE
+
176 #define EUSCI_A_SPI_RECEIVE_INTERRUPT UCRXIE
+
177 
+
178 //*****************************************************************************
+
179 //
+
180 // The following are values that can be passed toThe following are values that
+
181 // can be returned by the EUSCI_A_SPI_isBusy() function.
+
182 //
+
183 //*****************************************************************************
+
184 #define EUSCI_A_SPI_BUSY UCBUSY
+
185 #define EUSCI_A_SPI_NOT_BUSY 0x00
+
186 
+
187 //*****************************************************************************
+
188 //
+
189 // Prototypes for the APIs.
+
190 //
+
191 //*****************************************************************************
+
192 
+
193 //*****************************************************************************
+
194 //
+
208 //
+
209 //*****************************************************************************
+
210 extern void EUSCI_A_SPI_initMaster(uint16_t baseAddress,
+
211  EUSCI_A_SPI_initMasterParam *param);
+
212 
+
213 //*****************************************************************************
+
214 //
+
229 //
+
230 //*****************************************************************************
+
231 extern void EUSCI_A_SPI_select4PinFunctionality(uint16_t baseAddress,
+
232  uint16_t select4PinFunctionality);
+
233 
+
234 //*****************************************************************************
+
235 //
+
245 //
+
246 //*****************************************************************************
+
247 extern void EUSCI_A_SPI_changeMasterClock(uint16_t baseAddress,
+
248  EUSCI_A_SPI_changeMasterClockParam *param);
+
249 
+
250 //*****************************************************************************
+
251 //
+
265 //
+
266 //*****************************************************************************
+
267 extern void EUSCI_A_SPI_initSlave(uint16_t baseAddress,
+
268  EUSCI_A_SPI_initSlaveParam *param);
+
269 
+
270 //*****************************************************************************
+
271 //
+
290 //
+
291 //*****************************************************************************
+
292 extern void EUSCI_A_SPI_changeClockPhasePolarity(uint16_t baseAddress,
+
293  uint16_t clockPhase,
+
294  uint16_t clockPolarity);
+
295 
+
296 //*****************************************************************************
+
297 //
+
307 //
+
308 //*****************************************************************************
+
309 extern void EUSCI_A_SPI_transmitData(uint16_t baseAddress,
+
310  uint8_t transmitData);
+
311 
+
312 //*****************************************************************************
+
313 //
+
322 //
+
323 //*****************************************************************************
+
324 extern uint8_t EUSCI_A_SPI_receiveData(uint16_t baseAddress);
+
325 
+
326 //*****************************************************************************
+
327 //
+
343 //
+
344 //*****************************************************************************
+
345 extern void EUSCI_A_SPI_enableInterrupt(uint16_t baseAddress,
+
346  uint16_t mask);
+
347 
+
348 //*****************************************************************************
+
349 //
+
365 //
+
366 //*****************************************************************************
+
367 extern void EUSCI_A_SPI_disableInterrupt(uint16_t baseAddress,
+
368  uint16_t mask);
+
369 
+
370 //*****************************************************************************
+
371 //
+
387 //
+
388 //*****************************************************************************
+
389 extern uint8_t EUSCI_A_SPI_getInterruptStatus(uint16_t baseAddress,
+
390  uint8_t mask);
+
391 
+
392 //*****************************************************************************
+
393 //
+
405 //
+
406 //*****************************************************************************
+
407 extern void EUSCI_A_SPI_clearInterrupt(uint16_t baseAddress,
+
408  uint16_t mask);
+
409 
+
410 //*****************************************************************************
+
411 //
+
421 //
+
422 //*****************************************************************************
+
423 extern void EUSCI_A_SPI_enable(uint16_t baseAddress);
+
424 
+
425 //*****************************************************************************
+
426 //
+
436 //
+
437 //*****************************************************************************
+
438 extern void EUSCI_A_SPI_disable(uint16_t baseAddress);
+
439 
+
440 //*****************************************************************************
+
441 //
+
450 //
+
451 //*****************************************************************************
+
452 extern uint32_t EUSCI_A_SPI_getReceiveBufferAddress(uint16_t baseAddress);
+
453 
+
454 //*****************************************************************************
+
455 //
+
464 //
+
465 //*****************************************************************************
+
466 extern uint32_t EUSCI_A_SPI_getTransmitBufferAddress(uint16_t baseAddress);
+
467 
+
468 //*****************************************************************************
+
469 //
+
481 //
+
482 //*****************************************************************************
+
483 extern uint16_t EUSCI_A_SPI_isBusy(uint16_t baseAddress);
+
484 
+
485 //*****************************************************************************
+
486 //
+
487 // Mark the end of the C bindings section for C++ compilers.
+
488 //
+
489 //*****************************************************************************
+
490 #ifdef __cplusplus
+
491 }
+
492 #endif
+
493 
+
494 #endif
+
495 #endif // __MSP430WARE_EUSCI_A_SPI_H__
+ +
+
+ + + + diff --git a/Documentation/html/eusci__a__uart_8c.html b/Documentation/html/eusci__a__uart_8c.html new file mode 100644 index 0000000..34f4a23 --- /dev/null +++ b/Documentation/html/eusci__a__uart_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_uart.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_uart.c File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__a__uart_8c_source.html b/Documentation/html/eusci__a__uart_8c_source.html new file mode 100644 index 0000000..6ac8b51 --- /dev/null +++ b/Documentation/html/eusci__a__uart_8c_source.html @@ -0,0 +1,341 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_uart.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_uart.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_a_uart.c - Driver for the eusci_a_uart Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_EUSCI_Ax__
+
17 #include "eusci_a_uart.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 bool EUSCI_A_UART_init(uint16_t baseAddress, EUSCI_A_UART_initParam *param)
+
22 {
+
23  bool retVal = STATUS_SUCCESS;
+
24 
+
25  //Disable the USCI Module
+
26  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
27 
+
28  //Clock source select
+
29  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCSSEL_3;
+
30  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (uint16_t)param->selectClockSource;
+
31 
+
32  //MSB, LSB select
+
33  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCMSB;
+
34  HWREG16(baseAddress + OFS_UCAxCTLW0) |= param->msborLsbFirst;
+
35 
+
36  //UCSPB = 0(1 stop bit) OR 1(2 stop bits)
+
37  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCSPB;
+
38  HWREG16(baseAddress + OFS_UCAxCTLW0) |= param->numberofStopBits;
+
39 
+
40  //Parity
+
41  switch (param->parity){
+
42  case EUSCI_A_UART_NO_PARITY:
+
43  //No Parity
+
44  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCPEN;
+
45  break;
+
46  case EUSCI_A_UART_ODD_PARITY:
+
47  //Odd Parity
+
48  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCPEN;
+
49  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCPAR;
+
50  break;
+
51  case EUSCI_A_UART_EVEN_PARITY:
+
52  //Even Parity
+
53  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCPEN;
+
54  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCPAR;
+
55  break;
+
56  }
+
57 
+
58  //BaudRate Control Register
+
59  HWREG16(baseAddress + OFS_UCAxBRW ) = param->clockPrescalar;
+
60  //Modulation Control Register
+
61  HWREG16(baseAddress + OFS_UCAxMCTLW) = ((param->secondModReg <<8)
+
62  + (param->firstModReg <<4) + param->overSampling );
+
63 
+
64  //Asynchronous mode & 8 bit character select & clear mode
+
65  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSYNC +
+
66  UC7BIT +
+
67  UCMODE_3
+
68  );
+
69 
+
70  //Configure UART mode.
+
71  HWREG16(baseAddress + OFS_UCAxCTLW0) |= param->uartMode ;
+
72 
+
73  //Reset UCRXIE, UCBRKIE, UCDORM, UCTXADDR, UCTXBRK
+
74  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCRXEIE + UCBRKIE + UCDORM +
+
75  UCTXADDR + UCTXBRK
+
76  );
+
77  return (retVal);
+
78 }
+
79 
+
80 void EUSCI_A_UART_transmitData ( uint16_t baseAddress,
+
81  uint8_t transmitData
+
82  )
+
83 {
+
84  //If interrupts are not used, poll for flags
+
85  if (!(HWREG16(baseAddress + OFS_UCAxIE) & UCTXIE)){
+
86  //Poll for transmit interrupt flag
+
87  while (!(HWREG16(baseAddress + OFS_UCAxIFG) & UCTXIFG));
+
88  }
+
89 
+
90  HWREG16(baseAddress + OFS_UCAxTXBUF) = transmitData;
+
91 }
+
92 
+
93 uint8_t EUSCI_A_UART_receiveData (uint16_t baseAddress)
+
94 {
+
95  //If interrupts are not used, poll for flags
+
96  if (!(HWREG16(baseAddress + OFS_UCAxIE) & UCRXIE)){
+
97  //Poll for receive interrupt flag
+
98  while (!(HWREG16(baseAddress + OFS_UCAxIFG) & UCRXIFG));
+
99  }
+
100 
+
101  return ( HWREG16(baseAddress + OFS_UCAxRXBUF)) ;
+
102 }
+
103 
+
104 void EUSCI_A_UART_enableInterrupt (uint16_t baseAddress,
+
105  uint8_t mask
+
106  )
+
107 {
+
108  uint8_t locMask;
+
109 
+
110  locMask = (mask & (EUSCI_A_UART_RECEIVE_INTERRUPT
+
111  | EUSCI_A_UART_TRANSMIT_INTERRUPT
+
112  | EUSCI_A_UART_STARTBIT_INTERRUPT
+
113  | EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT));
+
114 
+
115  HWREG16(baseAddress + OFS_UCAxIE) |= (uint16_t)locMask;
+
116 
+
117  locMask = (mask & (EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT
+
118  | EUSCI_A_UART_BREAKCHAR_INTERRUPT));
+
119  HWREG16(baseAddress + OFS_UCAxCTLW0) |= (uint16_t)locMask;
+
120 }
+
121 
+
122 void EUSCI_A_UART_disableInterrupt (uint16_t baseAddress,
+
123  uint8_t mask
+
124  )
+
125 {
+
126  uint8_t locMask;
+
127 
+
128  locMask = (mask & (EUSCI_A_UART_RECEIVE_INTERRUPT
+
129  | EUSCI_A_UART_TRANSMIT_INTERRUPT
+
130  | EUSCI_A_UART_STARTBIT_INTERRUPT
+
131  | EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT));
+
132  HWREG16(baseAddress + OFS_UCAxIE) &= (uint16_t)~locMask;
+
133 
+
134  locMask = (mask & (EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT
+
135  | EUSCI_A_UART_BREAKCHAR_INTERRUPT));
+
136  HWREG16(baseAddress + OFS_UCAxCTLW0) &= (uint16_t)~locMask;
+
137 }
+
138 
+
139 uint8_t EUSCI_A_UART_getInterruptStatus (uint16_t baseAddress,
+
140  uint8_t mask)
+
141 {
+
142  return ( HWREG16(baseAddress + OFS_UCAxIFG) & mask );
+
143 }
+
144 
+
145 void EUSCI_A_UART_clearInterrupt (uint16_t baseAddress, uint16_t mask)
+
146 {
+
147  //Clear the UART interrupt source.
+
148  HWREG16(baseAddress + OFS_UCAxIFG) &= ~(mask);
+
149 }
+
150 
+
151 void EUSCI_A_UART_enable (uint16_t baseAddress)
+
152 {
+
153  //Reset the UCSWRST bit to enable the USCI Module
+
154  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~(UCSWRST);
+
155 }
+
156 
+
157 void EUSCI_A_UART_disable (uint16_t baseAddress)
+
158 {
+
159  //Set the UCSWRST bit to disable the USCI Module
+
160  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCSWRST;
+
161 }
+
162 
+
163 uint8_t EUSCI_A_UART_queryStatusFlags (uint16_t baseAddress,
+
164  uint8_t mask)
+
165 {
+
166  return ( HWREG16(baseAddress + OFS_UCAxSTATW) & mask );
+
167 }
+
168 
+
169 void EUSCI_A_UART_setDormant (uint16_t baseAddress)
+
170 {
+
171  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCDORM;
+
172 }
+
173 
+
174 void EUSCI_A_UART_resetDormant (uint16_t baseAddress)
+
175 {
+
176  HWREG16(baseAddress + OFS_UCAxCTLW0) &= ~UCDORM;
+
177 }
+
178 
+
179 void EUSCI_A_UART_transmitAddress (uint16_t baseAddress,
+
180  uint8_t transmitAddress)
+
181 {
+
182  //Set UCTXADDR bit
+
183  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCTXADDR;
+
184 
+
185  //Place next byte to be sent into the transmit buffer
+
186  HWREG16(baseAddress + OFS_UCAxTXBUF) = transmitAddress;
+
187 }
+
188 
+
189 void EUSCI_A_UART_transmitBreak (uint16_t baseAddress)
+
190 {
+
191  //Set UCTXADDR bit
+
192  HWREG16(baseAddress + OFS_UCAxCTLW0) |= UCTXBRK;
+
193 
+
194  //If current mode is automatic baud-rate detection
+
195  if (EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE ==
+
196  (HWREG16(baseAddress + OFS_UCAxCTLW0) &
+
197  EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE)){
+
198  HWREG16(baseAddress + OFS_UCAxTXBUF) = EUSCI_A_UART_AUTOMATICBAUDRATE_SYNC;
+
199  } else {
+
200  HWREG16(baseAddress + OFS_UCAxTXBUF) = DEFAULT_SYNC;
+
201  }
+
202 
+
203  //If interrupts are not used, poll for flags
+
204  if (!(HWREG16(baseAddress + OFS_UCAxIE) & UCTXIE)){
+
205  //Poll for transmit interrupt flag
+
206  while (!(HWREG16(baseAddress + OFS_UCAxIFG) & UCTXIFG));
+
207  }
+
208 }
+
209 
+
210 uint32_t EUSCI_A_UART_getReceiveBufferAddress (uint16_t baseAddress)
+
211 {
+
212  return ( baseAddress + OFS_UCAxRXBUF );
+
213 }
+
214 
+
215 uint32_t EUSCI_A_UART_getTransmitBufferAddress (uint16_t baseAddress)
+
216 {
+
217  return ( baseAddress + OFS_UCAxTXBUF );
+
218 }
+
219 
+
220 void EUSCI_A_UART_selectDeglitchTime(uint16_t baseAddress,
+
221  uint16_t deglitchTime
+
222  )
+
223 {
+
224  HWREG16(baseAddress + OFS_UCAxCTLW1) &= ~(UCGLIT1 + UCGLIT0);
+
225 
+
226  HWREG16(baseAddress + OFS_UCAxCTLW1) |= deglitchTime;
+
227 }
+
228 
+
229 
+
230 #endif
+
231 //*****************************************************************************
+
232 //
+
235 //
+
236 //*****************************************************************************
+ + +
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/eusci__a__uart_8h.html b/Documentation/html/eusci__a__uart_8h.html new file mode 100644 index 0000000..34de55b --- /dev/null +++ b/Documentation/html/eusci__a__uart_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_uart.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_uart.h File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__a__uart_8h_source.html b/Documentation/html/eusci__a__uart_8h_source.html new file mode 100644 index 0000000..a842c14 --- /dev/null +++ b/Documentation/html/eusci__a__uart_8h_source.html @@ -0,0 +1,396 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_a_uart.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_uart.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_a_uart.h - Driver for the EUSCI_A_UART Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_EUSCI_A_UART_H__
+
8 #define __MSP430WARE_EUSCI_A_UART_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_EUSCI_Ax__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
28 // The following values are the sync characters possible.
+
29 //
+
30 //*****************************************************************************
+
31 #define DEFAULT_SYNC 0x00
+
32 #define EUSCI_A_UART_AUTOMATICBAUDRATE_SYNC 0x55
+
33 
+
34 //*****************************************************************************
+
35 //
+
37 //
+
38 //*****************************************************************************
+
39 typedef struct EUSCI_A_UART_initParam {
+
45  uint8_t selectClockSource;
+
47  uint16_t clockPrescalar;
+
51  uint8_t firstModReg;
+
55  uint8_t secondModReg;
+
61  uint8_t parity;
+
66  uint16_t msborLsbFirst;
+
71  uint16_t numberofStopBits;
+
78  uint16_t uartMode;
+
83  uint8_t overSampling;
+
84 } EUSCI_A_UART_initParam;
+
85 
+
86 
+
87 //*****************************************************************************
+
88 //
+
89 // The following are values that can be passed to the param parameter for
+
90 // functions: EUSCI_A_UART_init().
+
91 //
+
92 //*****************************************************************************
+
93 #define EUSCI_A_UART_NO_PARITY 0x00
+
94 #define EUSCI_A_UART_ODD_PARITY 0x01
+
95 #define EUSCI_A_UART_EVEN_PARITY 0x02
+
96 
+
97 //*****************************************************************************
+
98 //
+
99 // The following are values that can be passed to the param parameter for
+
100 // functions: EUSCI_A_UART_init().
+
101 //
+
102 //*****************************************************************************
+
103 #define EUSCI_A_UART_MSB_FIRST UCMSB
+
104 #define EUSCI_A_UART_LSB_FIRST 0x00
+
105 
+
106 //*****************************************************************************
+
107 //
+
108 // The following are values that can be passed to the param parameter for
+
109 // functions: EUSCI_A_UART_init().
+
110 //
+
111 //*****************************************************************************
+
112 #define EUSCI_A_UART_MODE UCMODE_0
+
113 #define EUSCI_A_UART_IDLE_LINE_MULTI_PROCESSOR_MODE UCMODE_1
+
114 #define EUSCI_A_UART_ADDRESS_BIT_MULTI_PROCESSOR_MODE UCMODE_2
+
115 #define EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE UCMODE_3
+
116 
+
117 //*****************************************************************************
+
118 //
+
119 // The following are values that can be passed to the param parameter for
+
120 // functions: EUSCI_A_UART_init().
+
121 //
+
122 //*****************************************************************************
+
123 #define EUSCI_A_UART_CLOCKSOURCE_SMCLK UCSSEL__SMCLK
+
124 #define EUSCI_A_UART_CLOCKSOURCE_ACLK UCSSEL__ACLK
+
125 
+
126 //*****************************************************************************
+
127 //
+
128 // The following are values that can be passed to the param parameter for
+
129 // functions: EUSCI_A_UART_init().
+
130 //
+
131 //*****************************************************************************
+
132 #define EUSCI_A_UART_ONE_STOP_BIT 0x00
+
133 #define EUSCI_A_UART_TWO_STOP_BITS UCSPB
+
134 
+
135 //*****************************************************************************
+
136 //
+
137 // The following are values that can be passed to the param parameter for
+
138 // functions: EUSCI_A_UART_init().
+
139 //
+
140 //*****************************************************************************
+
141 #define EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION 0x01
+
142 #define EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION 0x00
+
143 
+
144 //*****************************************************************************
+
145 //
+
146 // The following are values that can be passed to the mask parameter for
+
147 // functions: EUSCI_A_UART_enableInterrupt(), and
+
148 // EUSCI_A_UART_disableInterrupt().
+
149 //
+
150 //*****************************************************************************
+
151 #define EUSCI_A_UART_RECEIVE_INTERRUPT UCRXIE
+
152 #define EUSCI_A_UART_TRANSMIT_INTERRUPT UCTXIE
+
153 #define EUSCI_A_UART_RECEIVE_ERRONEOUSCHAR_INTERRUPT UCRXEIE
+
154 #define EUSCI_A_UART_BREAKCHAR_INTERRUPT UCBRKIE
+
155 #define EUSCI_A_UART_STARTBIT_INTERRUPT UCSTTIE
+
156 #define EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT UCTXCPTIE
+
157 
+
158 //*****************************************************************************
+
159 //
+
160 // The following are values that can be passed to the mask parameter for
+
161 // functions: EUSCI_A_UART_getInterruptStatus(), and
+
162 // EUSCI_A_UART_clearInterrupt() as well as returned by the
+
163 // EUSCI_A_UART_getInterruptStatus() function.
+
164 //
+
165 //*****************************************************************************
+
166 #define EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG UCRXIFG
+
167 #define EUSCI_A_UART_TRANSMIT_INTERRUPT_FLAG UCTXIFG
+
168 #define EUSCI_A_UART_STARTBIT_INTERRUPT_FLAG UCSTTIFG
+
169 #define EUSCI_A_UART_TRANSMIT_COMPLETE_INTERRUPT_FLAG UCTXCPTIFG
+
170 
+
171 //*****************************************************************************
+
172 //
+
173 // The following are values that can be passed to the mask parameter for
+
174 // functions: EUSCI_A_UART_queryStatusFlags() as well as returned by the
+
175 // EUSCI_A_UART_queryStatusFlags() function.
+
176 //
+
177 //*****************************************************************************
+
178 #define EUSCI_A_UART_LISTEN_ENABLE UCLISTEN
+
179 #define EUSCI_A_UART_FRAMING_ERROR UCFE
+
180 #define EUSCI_A_UART_OVERRUN_ERROR UCOE
+
181 #define EUSCI_A_UART_PARITY_ERROR UCPE
+
182 #define EUSCI_A_UART_BREAK_DETECT UCBRK
+
183 #define EUSCI_A_UART_RECEIVE_ERROR UCRXERR
+
184 #define EUSCI_A_UART_ADDRESS_RECEIVED UCADDR
+
185 #define EUSCI_A_UART_IDLELINE UCIDLE
+
186 #define EUSCI_A_UART_BUSY UCBUSY
+
187 
+
188 //*****************************************************************************
+
189 //
+
190 // The following are values that can be passed to the deglitchTime parameter
+
191 // for functions: EUSCI_A_UART_selectDeglitchTime().
+
192 //
+
193 //*****************************************************************************
+
194 #define EUSCI_A_UART_DEGLITCH_TIME_2ns 0x00
+
195 #define EUSCI_A_UART_DEGLITCH_TIME_50ns UCGLIT0
+
196 #define EUSCI_A_UART_DEGLITCH_TIME_100ns UCGLIT1
+
197 #define EUSCI_A_UART_DEGLITCH_TIME_200ns (UCGLIT0 + UCGLIT1)
+
198 
+
199 //*****************************************************************************
+
200 //
+
201 // Prototypes for the APIs.
+
202 //
+
203 //*****************************************************************************
+
204 
+
205 //*****************************************************************************
+
206 //
+
228 //
+
229 //*****************************************************************************
+
230 extern bool EUSCI_A_UART_init(uint16_t baseAddress,
+
231  EUSCI_A_UART_initParam *param);
+
232 
+
233 //*****************************************************************************
+
234 //
+
249 //
+
250 //*****************************************************************************
+
251 extern void EUSCI_A_UART_transmitData(uint16_t baseAddress,
+
252  uint8_t transmitData);
+
253 
+
254 //*****************************************************************************
+
255 //
+
266 //
+
267 //*****************************************************************************
+
268 extern uint8_t EUSCI_A_UART_receiveData(uint16_t baseAddress);
+
269 
+
270 //*****************************************************************************
+
271 //
+
296 //
+
297 //*****************************************************************************
+
298 extern void EUSCI_A_UART_enableInterrupt(uint16_t baseAddress,
+
299  uint8_t mask);
+
300 
+
301 //*****************************************************************************
+
302 //
+
326 //
+
327 //*****************************************************************************
+
328 extern void EUSCI_A_UART_disableInterrupt(uint16_t baseAddress,
+
329  uint8_t mask);
+
330 
+
331 //*****************************************************************************
+
332 //
+
354 //
+
355 //*****************************************************************************
+
356 extern uint8_t EUSCI_A_UART_getInterruptStatus(uint16_t baseAddress,
+
357  uint8_t mask);
+
358 
+
359 //*****************************************************************************
+
360 //
+
378 //
+
379 //*****************************************************************************
+
380 extern void EUSCI_A_UART_clearInterrupt(uint16_t baseAddress,
+
381  uint16_t mask);
+
382 
+
383 //*****************************************************************************
+
384 //
+
394 //
+
395 //*****************************************************************************
+
396 extern void EUSCI_A_UART_enable(uint16_t baseAddress);
+
397 
+
398 //*****************************************************************************
+
399 //
+
409 //
+
410 //*****************************************************************************
+
411 extern void EUSCI_A_UART_disable(uint16_t baseAddress);
+
412 
+
413 //*****************************************************************************
+
414 //
+
445 //
+
446 //*****************************************************************************
+
447 extern uint8_t EUSCI_A_UART_queryStatusFlags(uint16_t baseAddress,
+
448  uint8_t mask);
+
449 
+
450 //*****************************************************************************
+
451 //
+
463 //
+
464 //*****************************************************************************
+
465 extern void EUSCI_A_UART_setDormant(uint16_t baseAddress);
+
466 
+
467 //*****************************************************************************
+
468 //
+
478 //
+
479 //*****************************************************************************
+
480 extern void EUSCI_A_UART_resetDormant(uint16_t baseAddress);
+
481 
+
482 //*****************************************************************************
+
483 //
+
493 //
+
494 //*****************************************************************************
+
495 extern void EUSCI_A_UART_transmitAddress(uint16_t baseAddress,
+
496  uint8_t transmitAddress);
+
497 
+
498 //*****************************************************************************
+
499 //
+
514 //
+
515 //*****************************************************************************
+
516 extern void EUSCI_A_UART_transmitBreak(uint16_t baseAddress);
+
517 
+
518 //*****************************************************************************
+
519 //
+
528 //
+
529 //*****************************************************************************
+
530 extern uint32_t EUSCI_A_UART_getReceiveBufferAddress(uint16_t baseAddress);
+
531 
+
532 //*****************************************************************************
+
533 //
+
542 //
+
543 //*****************************************************************************
+
544 extern uint32_t EUSCI_A_UART_getTransmitBufferAddress(uint16_t baseAddress);
+
545 
+
546 //*****************************************************************************
+
547 //
+
559 //
+
560 //*****************************************************************************
+
561 extern void EUSCI_A_UART_selectDeglitchTime(uint16_t baseAddress,
+
562  uint16_t deglitchTime);
+
563 
+
564 //*****************************************************************************
+
565 //
+
566 // Mark the end of the C bindings section for C++ compilers.
+
567 //
+
568 //*****************************************************************************
+
569 #ifdef __cplusplus
+
570 }
+
571 #endif
+
572 
+
573 #endif
+
574 #endif // __MSP430WARE_EUSCI_A_UART_H__
+ +
+
+ + + + diff --git a/Documentation/html/eusci__b__i2c_8c.html b/Documentation/html/eusci__b__i2c_8c.html new file mode 100644 index 0000000..3ad6ae9 --- /dev/null +++ b/Documentation/html/eusci__b__i2c_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_i2c.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_i2c.c File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__b__i2c_8c_source.html b/Documentation/html/eusci__b__i2c_8c_source.html new file mode 100644 index 0000000..d7e33a0 --- /dev/null +++ b/Documentation/html/eusci__b__i2c_8c_source.html @@ -0,0 +1,685 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_i2c.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_i2c.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_b_i2c.c - Driver for the eusci_b_i2c Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_EUSCI_Bx__
+
17 #include "eusci_b_i2c.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void EUSCI_B_I2C_initMaster (uint16_t baseAddress,
+
22  EUSCI_B_I2C_initMasterParam *param
+
23  )
+
24 {
+
25  uint16_t preScalarValue;
+
26 
+
27  //Disable the USCI module and clears the other bits of control register
+
28  HWREG16(baseAddress + OFS_UCBxCTLW0) = UCSWRST;
+
29 
+
30  //Configure Automatic STOP condition generation
+
31  HWREG16(baseAddress + OFS_UCBxCTLW1) &= ~UCASTP_3;
+
32  HWREG16(baseAddress + OFS_UCBxCTLW1) |= (uint16_t)param->autoSTOPGeneration;
+
33 
+
34  //Byte Count Threshold
+
35  HWREG16(baseAddress + OFS_UCBxTBCNT) = param->byteCounterThreshold;
+
36  /*
+
37  * Configure as I2C master mode.
+
38  * UCMST = Master mode
+
39  * UCMODE_3 = I2C mode
+
40  * UCSYNC = Synchronous mode
+
41  */
+
42  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCMST + UCMODE_3 + UCSYNC;
+
43 
+
44  //Configure I2C clock source
+
45  HWREG16(baseAddress + OFS_UCBxCTLW0) |= (param->selectClockSource + UCSWRST);
+
46 
+
47  /*
+
48  * Compute the clock divider that achieves the fastest speed less than or
+
49  * equal to the desired speed. The numerator is biased to favor a larger
+
50  * clock divider so that the resulting clock is always less than or equal
+
51  * to the desired clock, never greater.
+
52  */
+
53  preScalarValue = (uint16_t)(param->i2cClk / param->dataRate);
+
54  HWREG16(baseAddress + OFS_UCBxBRW) = preScalarValue;
+
55 }
+
56 
+
57 void EUSCI_B_I2C_initSlave (uint16_t baseAddress,
+
58  EUSCI_B_I2C_initSlaveParam *param
+
59  )
+
60 {
+
61  //Disable the USCI module
+
62  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
63 
+
64  //Clear USCI master mode
+
65  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCMST;
+
66 
+
67  //Configure I2C as Slave and Synchronous mode
+
68  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCMODE_3 + UCSYNC;
+
69 
+
70  //Set up the slave address.
+
71  HWREG16(baseAddress + OFS_UCBxI2COA0 + param->slaveAddressOffset)
+
72  = param->slaveAddress + param->slaveOwnAddressEnable;
+
73 }
+
74 
+
75 void EUSCI_B_I2C_enable (uint16_t baseAddress)
+
76 {
+
77  //Reset the UCSWRST bit to enable the USCI Module
+
78  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCSWRST);
+
79 }
+
80 
+
81 void EUSCI_B_I2C_disable (uint16_t baseAddress)
+
82 {
+
83  //Set the UCSWRST bit to disable the USCI Module
+
84  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
85 }
+
86 
+
87 void EUSCI_B_I2C_setSlaveAddress (uint16_t baseAddress,
+
88  uint8_t slaveAddress
+
89  )
+
90 {
+
91  //Set the address of the slave with which the master will communicate.
+
92  HWREG16(baseAddress + OFS_UCBxI2CSA) = (slaveAddress);
+
93 }
+
94 
+
95 void EUSCI_B_I2C_setMode (uint16_t baseAddress,
+
96  uint16_t mode
+
97  )
+
98 {
+
99  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~EUSCI_B_I2C_TRANSMIT_MODE;
+
100  HWREG16(baseAddress + OFS_UCBxCTLW0) |= mode;
+
101 }
+
102 
+
103 uint8_t EUSCI_B_I2C_getMode (uint16_t baseAddress)
+
104 {
+
105  //Read the I2C mode.
+
106  return ((HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTR));
+
107 
+
108 }
+
109 
+
110 void EUSCI_B_I2C_slavePutData (uint16_t baseAddress,
+
111  uint8_t transmitData
+
112  )
+
113 {
+
114  //Send single byte data.
+
115  HWREG16(baseAddress + OFS_UCBxTXBUF) = transmitData;
+
116 }
+
117 
+
118 uint8_t EUSCI_B_I2C_slaveGetData (uint16_t baseAddress)
+
119 {
+
120  //Read a byte.
+
121  return (HWREG16(baseAddress + OFS_UCBxRXBUF));
+
122 }
+
123 
+
124 uint16_t EUSCI_B_I2C_isBusBusy (uint16_t baseAddress)
+
125 {
+
126  //Return the bus busy status.
+
127  return (HWREG16(baseAddress + OFS_UCBxSTATW) & UCBBUSY);
+
128 }
+
129 
+
130 uint16_t EUSCI_B_I2C_masterIsStopSent (uint16_t baseAddress)
+
131 {
+
132  return (HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTXSTP);
+
133 }
+
134 
+
135 uint16_t EUSCI_B_I2C_masterIsStartSent (uint16_t baseAddress)
+
136 {
+
137  return (HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTXSTT);
+
138 }
+
139 
+
140 void EUSCI_B_I2C_enableInterrupt (uint16_t baseAddress,
+
141  uint16_t mask
+
142  )
+
143 {
+
144  //Enable the interrupt masked bit
+
145  HWREG16(baseAddress + OFS_UCBxIE) |= mask;
+
146 }
+
147 
+
148 void EUSCI_B_I2C_disableInterrupt (uint16_t baseAddress,
+
149  uint16_t mask
+
150  )
+
151 {
+
152  //Disable the interrupt masked bit
+
153  HWREG16(baseAddress + OFS_UCBxIE) &= ~(mask);
+
154 }
+
155 
+
156 void EUSCI_B_I2C_clearInterrupt (uint16_t baseAddress,
+
157  uint16_t mask
+
158  )
+
159 {
+
160  //Clear the I2C interrupt source.
+
161  HWREG16(baseAddress + OFS_UCBxIFG) &= ~(mask);
+
162 }
+
163 
+
164 uint16_t EUSCI_B_I2C_getInterruptStatus (uint16_t baseAddress,
+
165  uint16_t mask
+
166  )
+
167 {
+
168  //Return the interrupt status of the request masked bit.
+
169  return (HWREG16(baseAddress + OFS_UCBxIFG) & mask);
+
170 }
+
171 
+
172 void EUSCI_B_I2C_masterSendSingleByte (uint16_t baseAddress,
+
173  uint8_t txData
+
174  )
+
175 {
+
176  //Store current TXIE status
+
177  uint16_t txieStatus = HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE;
+
178 
+
179  //Disable transmit interrupt enable
+
180  HWREG16(baseAddress + OFS_UCBxIE) &= ~(UCTXIE);
+
181 
+
182  //Send start condition.
+
183  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTR + UCTXSTT;
+
184 
+
185  //Poll for transmit interrupt flag.
+
186  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
187 
+
188  //Send single byte data.
+
189  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
190 
+
191  //Poll for transmit interrupt flag.
+
192  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
193 
+
194  //Send stop condition.
+
195  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
196 
+
197  //Clear transmit interrupt flag before enabling interrupt again
+
198  HWREG16(baseAddress + OFS_UCBxIFG) &= ~(UCTXIFG);
+
199 
+
200  //Reinstate transmit interrupt enable
+
201  HWREG16(baseAddress + OFS_UCBxIE) |= txieStatus;
+
202 }
+
203 
+
204 uint8_t EUSCI_B_I2C_masterReceiveSingleByte (uint16_t baseAddress)
+
205 {
+
206  //Set USCI in Receive mode
+
207  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCTR;
+
208 
+
209  //Send start condition
+
210  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTT;
+
211 
+
212  //Poll for start condition transmission
+
213  while(HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTXSTT);
+
214 
+
215  //Send stop condition
+
216  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
217 
+
218  //Poll for receive interrupt flag.
+
219  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCRXIFG));
+
220 
+
221  //Send single byte data.
+
222  return (HWREG16(baseAddress + OFS_UCBxRXBUF));
+
223 }
+
224 
+
225 bool EUSCI_B_I2C_masterSendSingleByteWithTimeout (uint16_t baseAddress,
+
226  uint8_t txData,
+
227  uint32_t timeout
+
228  )
+
229 {
+
230  // Creating variable for second timeout scenario
+
231  uint32_t timeout2 = timeout;
+
232 
+
233  //Store current TXIE status
+
234  uint16_t txieStatus = HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE;
+
235 
+
236  //Disable transmit interrupt enable
+
237  HWREG16(baseAddress + OFS_UCBxIE) &= ~(UCTXIE);
+
238 
+
239  //Send start condition.
+
240  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTR + UCTXSTT;
+
241 
+
242  //Poll for transmit interrupt flag.
+
243  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout);
+
244 
+
245  //Check if transfer timed out
+
246  if (timeout == 0){
+
247  return (STATUS_FAIL);
+
248  }
+
249 
+
250  //Send single byte data.
+
251  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
252 
+
253  //Poll for transmit interrupt flag.
+
254  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout2);
+
255 
+
256  //Check if transfer timed out
+
257  if (timeout2 == 0){
+
258  return (STATUS_FAIL);
+
259  }
+
260 
+
261  //Send stop condition.
+
262  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
263 
+
264  //Clear transmit interrupt flag before enabling interrupt again
+
265  HWREG16(baseAddress + OFS_UCBxIFG) &= ~(UCTXIFG);
+
266 
+
267  //Reinstate transmit interrupt enable
+
268  HWREG16(baseAddress + OFS_UCBxIE) |= txieStatus;
+
269 
+
270  return (STATUS_SUCCESS);
+
271 }
+
272 
+
273 void EUSCI_B_I2C_masterSendMultiByteStart (uint16_t baseAddress,
+
274  uint8_t txData
+
275  )
+
276 {
+
277  //Store current transmit interrupt enable
+
278  uint16_t txieStatus = HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE;
+
279 
+
280  //Disable transmit interrupt enable
+
281  HWREG16(baseAddress + OFS_UCBxIE) &= ~(UCTXIE);
+
282 
+
283  //Send start condition.
+
284  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTR + UCTXSTT;
+
285 
+
286  //Poll for transmit interrupt flag.
+
287  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
288 
+
289  //Send single byte data.
+
290  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
291 
+
292  //Reinstate transmit interrupt enable
+
293  HWREG16(baseAddress + OFS_UCBxIE) |= txieStatus;
+
294 }
+
295 
+
296 bool EUSCI_B_I2C_masterSendMultiByteStartWithTimeout (uint16_t baseAddress,
+
297  uint8_t txData,
+
298  uint32_t timeout
+
299  )
+
300 {
+
301  //Store current transmit interrupt enable
+
302  uint16_t txieStatus = HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE;
+
303 
+
304  //Disable transmit interrupt enable
+
305  HWREG16(baseAddress + OFS_UCBxIE) &= ~(UCTXIE);
+
306 
+
307  //Send start condition.
+
308  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTR + UCTXSTT;
+
309 
+
310  //Poll for transmit interrupt flag.
+
311  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout);
+
312 
+
313  //Check if transfer timed out
+
314  if (timeout == 0){
+
315  return (STATUS_FAIL);
+
316  }
+
317 
+
318  //Send single byte data.
+
319  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
320 
+
321  //Reinstate transmit interrupt enable
+
322  HWREG16(baseAddress + OFS_UCBxIE) |= txieStatus;
+
323 
+
324  return(STATUS_SUCCESS);
+
325 }
+
326 
+
327 void EUSCI_B_I2C_masterSendMultiByteNext (uint16_t baseAddress,
+
328  uint8_t txData
+
329  )
+
330 {
+
331  //If interrupts are not used, poll for flags
+
332  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
333  //Poll for transmit interrupt flag.
+
334  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
335  }
+
336 
+
337  //Send single byte data.
+
338  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
339 }
+
340 
+
341 bool EUSCI_B_I2C_masterSendMultiByteNextWithTimeout (uint16_t baseAddress,
+
342  uint8_t txData,
+
343  uint32_t timeout
+
344  )
+
345 {
+
346  //If interrupts are not used, poll for flags
+
347  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
348  //Poll for transmit interrupt flag.
+
349  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout);
+
350 
+
351  //Check if transfer timed out
+
352  if (timeout == 0){
+
353  return (STATUS_FAIL);
+
354  }
+
355  }
+
356 
+
357  //Send single byte data.
+
358  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
359 
+
360  return(STATUS_SUCCESS);
+
361 }
+
362 
+
363 void EUSCI_B_I2C_masterSendMultiByteFinish (uint16_t baseAddress,
+
364  uint8_t txData
+
365  )
+
366 {
+
367  //If interrupts are not used, poll for flags
+
368  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
369  //Poll for transmit interrupt flag.
+
370  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
371  }
+
372 
+
373  //Send single byte data.
+
374  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
375 
+
376  //Poll for transmit interrupt flag.
+
377  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
378 
+
379  //Send stop condition.
+
380  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
381 }
+
382 
+
383 bool EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout (uint16_t baseAddress,
+
384  uint8_t txData,
+
385  uint32_t timeout
+
386  )
+
387 {
+
388  uint32_t timeout2 = timeout;
+
389 
+
390  //If interrupts are not used, poll for flags
+
391  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
392  //Poll for transmit interrupt flag.
+
393  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout) ;
+
394 
+
395  //Check if transfer timed out
+
396  if (timeout == 0){
+
397  return (STATUS_FAIL);
+
398  }
+
399  }
+
400 
+
401  //Send single byte data.
+
402  HWREG16(baseAddress + OFS_UCBxTXBUF) = txData;
+
403 
+
404  //Poll for transmit interrupt flag.
+
405  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout2) ;
+
406 
+
407  //Check if transfer timed out
+
408  if (timeout2 == 0){
+
409  return (STATUS_FAIL);
+
410  }
+
411 
+
412  //Send stop condition.
+
413  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
414 
+
415  return(STATUS_SUCCESS);
+
416 }
+
417 
+
418 void EUSCI_B_I2C_masterSendStart (uint16_t baseAddress)
+
419 {
+
420  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTT;
+
421 }
+
422 
+
423 void EUSCI_B_I2C_masterSendMultiByteStop (uint16_t baseAddress)
+
424 {
+
425  //If interrupts are not used, poll for flags
+
426  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
427  //Poll for transmit interrupt flag.
+
428  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) ;
+
429  }
+
430 
+
431  //Send stop condition.
+
432  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
433 }
+
434 
+
435 bool EUSCI_B_I2C_masterSendMultiByteStopWithTimeout (uint16_t baseAddress,
+
436  uint32_t timeout)
+
437 {
+
438  //If interrupts are not used, poll for flags
+
439  if (!(HWREG16(baseAddress + OFS_UCBxIE) & UCTXIE)){
+
440  //Poll for transmit interrupt flag.
+
441  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCTXIFG)) && --timeout) ;
+
442 
+
443  //Check if transfer timed out
+
444  if (timeout == 0){
+
445  return (STATUS_FAIL);
+
446  }
+
447  }
+
448 
+
449  //Send stop condition.
+
450  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
451 
+
452  return (STATUS_SUCCESS);
+
453 }
+
454 
+
455 void EUSCI_B_I2C_masterReceiveStart (uint16_t baseAddress)
+
456 {
+
457  //Set USCI in Receive mode
+
458  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCTR;
+
459  //Send start
+
460  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTT;
+
461 }
+
462 
+
463 uint8_t EUSCI_B_I2C_masterReceiveMultiByteNext (uint16_t baseAddress)
+
464 {
+
465  return (HWREG16(baseAddress + OFS_UCBxRXBUF));
+
466 }
+
467 
+
468 uint8_t EUSCI_B_I2C_masterReceiveMultiByteFinish (uint16_t baseAddress)
+
469 {
+
470  //Send stop condition.
+
471  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
472 
+
473  //Wait for Stop to finish
+
474  while (HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTXSTP)
+
475 
+
476  // Wait for RX buffer
+
477  while (!(HWREG16(baseAddress + OFS_UCBxIFG) & UCRXIFG)) ;
+
478 
+
479  //Capture data from receive buffer after setting stop bit due to
+
480  //MSP430 I2C critical timing.
+
481  return (HWREG16(baseAddress + OFS_UCBxRXBUF));
+
482 }
+
483 
+
484 bool EUSCI_B_I2C_masterReceiveMultiByteFinishWithTimeout (uint16_t baseAddress,
+
485  uint8_t *txData,
+
486  uint32_t timeout
+
487  )
+
488 {
+
489  uint32_t timeout2 = timeout;
+
490 
+
491  //Send stop condition.
+
492  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
493 
+
494  //Wait for Stop to finish
+
495  while ((HWREG16(baseAddress + OFS_UCBxCTLW0) & UCTXSTP) && --timeout);
+
496 
+
497  //Check if transfer timed out
+
498  if (timeout == 0){
+
499  return (STATUS_FAIL);
+
500  }
+
501 
+
502  // Wait for RX buffer
+
503  while ((!(HWREG16(baseAddress + OFS_UCBxIFG) & UCRXIFG)) && --timeout2);
+
504 
+
505  //Check if transfer timed out
+
506  if (timeout2 == 0){
+
507  return (STATUS_FAIL);
+
508  }
+
509 
+
510  //Capture data from receive buffer after setting stop bit due to
+
511  //MSP430 I2C critical timing.
+
512  *txData = (HWREG8(baseAddress + OFS_UCBxRXBUF));
+
513 
+
514  return (STATUS_SUCCESS);
+
515 }
+
516 
+
517 void EUSCI_B_I2C_masterReceiveMultiByteStop (uint16_t baseAddress)
+
518 {
+
519  //Send stop condition.
+
520  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCTXSTP;
+
521 }
+
522 
+
523 void EUSCI_B_I2C_enableMultiMasterMode(uint16_t baseAddress)
+
524 {
+
525  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
526  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCMM;
+
527 }
+
528 
+
529 void EUSCI_B_I2C_disableMultiMasterMode(uint16_t baseAddress)
+
530 {
+
531 
+
532  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
533  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCMM;
+
534 }
+
535 
+
536 uint8_t EUSCI_B_I2C_masterReceiveSingle (uint16_t baseAddress)
+
537 {
+
538  //Polling RXIFG0 if RXIE is not enabled
+
539  if(!(HWREG16(baseAddress + OFS_UCBxIE) & UCRXIE0)) {
+
540  while(!(HWREG16(baseAddress + OFS_UCBxIFG) & UCRXIFG0));
+
541  }
+
542 
+
543  //Read a byte.
+
544  return (HWREG16(baseAddress + OFS_UCBxRXBUF));
+
545 }
+
546 
+
547 uint32_t EUSCI_B_I2C_getReceiveBufferAddress (uint16_t baseAddress)
+
548 {
+
549  return ( baseAddress + OFS_UCBxRXBUF );
+
550 }
+
551 
+
552 uint32_t EUSCI_B_I2C_getTransmitBufferAddress (uint16_t baseAddress)
+
553 {
+
554  return ( baseAddress + OFS_UCBxTXBUF );
+
555 }
+
556 void EUSCI_B_I2C_setTimeout(uint16_t baseAddress, uint16_t timeout)
+
557 {
+
558  uint16_t tempUCBxCTLW0;
+
559 
+
560  //Save value of UCSWRST bit before we disable eUSCI module
+
561  tempUCBxCTLW0 = HWREG16(baseAddress + OFS_UCBxCTLW0);
+
562  //Disable the USCI module
+
563  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
564 
+
565  //Set timeout
+
566  HWREG16(baseAddress + OFS_UCBxCTLW1) = (HWREG16(baseAddress + OFS_UCBxCTLW1) & (~UCCLTO_3)) | timeout;
+
567 
+
568  //Restore value of UCSWRST bit
+
569  HWREG16(baseAddress + OFS_UCBxCTLW0) = tempUCBxCTLW0;
+
570 }
+
571 
+
572 #endif
+
573 //*****************************************************************************
+
574 //
+
577 //
+
578 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_FAIL
Definition: hw_memmap.h:23
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/eusci__b__i2c_8h.html b/Documentation/html/eusci__b__i2c_8h.html new file mode 100644 index 0000000..3d043de --- /dev/null +++ b/Documentation/html/eusci__b__i2c_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_i2c.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_i2c.h File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__b__i2c_8h_source.html b/Documentation/html/eusci__b__i2c_8h_source.html new file mode 100644 index 0000000..200f9ee --- /dev/null +++ b/Documentation/html/eusci__b__i2c_8h_source.html @@ -0,0 +1,550 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_i2c.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_i2c.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_b_i2c.h - Driver for the EUSCI_B_I2C Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_EUSCI_B_I2C_H__
+
8 #define __MSP430WARE_EUSCI_B_I2C_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_EUSCI_Bx__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
30 //
+
31 //*****************************************************************************
+
32 typedef struct EUSCI_B_I2C_initMasterParam {
+
38  uint8_t selectClockSource;
+
41  uint32_t i2cClk;
+
46  uint32_t dataRate;
+
48  uint8_t byteCounterThreshold;
+
54  uint8_t autoSTOPGeneration;
+
55 } EUSCI_B_I2C_initMasterParam;
+
56 
+
57 //*****************************************************************************
+
58 //
+
60 //
+
61 //*****************************************************************************
+
62 typedef struct EUSCI_B_I2C_initSlaveParam {
+
64  uint8_t slaveAddress;
+
71  uint8_t slaveAddressOffset;
+
76  uint32_t slaveOwnAddressEnable;
+
77 } EUSCI_B_I2C_initSlaveParam;
+
78 
+
79 
+
80 //*****************************************************************************
+
81 //
+
82 // The following are values that can be passed to the param parameter for
+
83 // functions: EUSCI_B_I2C_initMaster().
+
84 //
+
85 //*****************************************************************************
+
86 #define EUSCI_B_I2C_NO_AUTO_STOP UCASTP_0
+
87 #define EUSCI_B_I2C_SET_BYTECOUNT_THRESHOLD_FLAG UCASTP_1
+
88 #define EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD UCASTP_2
+
89 
+
90 //*****************************************************************************
+
91 //
+
92 // The following are values that can be passed to the param parameter for
+
93 // functions: EUSCI_B_I2C_initMaster().
+
94 //
+
95 //*****************************************************************************
+
96 #define EUSCI_B_I2C_SET_DATA_RATE_400KBPS 400000
+
97 #define EUSCI_B_I2C_SET_DATA_RATE_100KBPS 100000
+
98 
+
99 //*****************************************************************************
+
100 //
+
101 // The following are values that can be passed to the param parameter for
+
102 // functions: EUSCI_B_I2C_initMaster().
+
103 //
+
104 //*****************************************************************************
+
105 #define EUSCI_B_I2C_CLOCKSOURCE_ACLK UCSSEL__ACLK
+
106 #define EUSCI_B_I2C_CLOCKSOURCE_SMCLK UCSSEL__SMCLK
+
107 
+
108 //*****************************************************************************
+
109 //
+
110 // The following are values that can be passed to the param parameter for
+
111 // functions: EUSCI_B_I2C_initSlave().
+
112 //
+
113 //*****************************************************************************
+
114 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET0 0x00
+
115 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET1 0x02
+
116 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET2 0x04
+
117 #define EUSCI_B_I2C_OWN_ADDRESS_OFFSET3 0x06
+
118 
+
119 //*****************************************************************************
+
120 //
+
121 // The following are values that can be passed to the param parameter for
+
122 // functions: EUSCI_B_I2C_initSlave().
+
123 //
+
124 //*****************************************************************************
+
125 #define EUSCI_B_I2C_OWN_ADDRESS_DISABLE 0x00
+
126 #define EUSCI_B_I2C_OWN_ADDRESS_ENABLE UCOAEN
+
127 
+
128 //*****************************************************************************
+
129 //
+
130 // The following are values that can be passed to the mode parameter for
+
131 // functions: EUSCI_B_I2C_setMode() as well as returned by the
+
132 // EUSCI_B_I2C_getMode() function.
+
133 //
+
134 //*****************************************************************************
+
135 #define EUSCI_B_I2C_TRANSMIT_MODE UCTR
+
136 #define EUSCI_B_I2C_RECEIVE_MODE 0x0000
+
137 
+
138 //*****************************************************************************
+
139 //
+
140 // The following are values that can be passed to the mask parameter for
+
141 // functions: EUSCI_B_I2C_enableInterrupt(), EUSCI_B_I2C_disableInterrupt(),
+
142 // EUSCI_B_I2C_clearInterrupt(), and EUSCI_B_I2C_getInterruptStatus() as well
+
143 // as returned by the EUSCI_B_I2C_getInterruptStatus() function.
+
144 //
+
145 //*****************************************************************************
+
146 #define EUSCI_B_I2C_NAK_INTERRUPT UCNACKIE
+
147 #define EUSCI_B_I2C_ARBITRATIONLOST_INTERRUPT UCALIE
+
148 #define EUSCI_B_I2C_STOP_INTERRUPT UCSTPIE
+
149 #define EUSCI_B_I2C_START_INTERRUPT UCSTTIE
+
150 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT0 UCTXIE0
+
151 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT1 UCTXIE1
+
152 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT2 UCTXIE2
+
153 #define EUSCI_B_I2C_TRANSMIT_INTERRUPT3 UCTXIE3
+
154 #define EUSCI_B_I2C_RECEIVE_INTERRUPT0 UCRXIE0
+
155 #define EUSCI_B_I2C_RECEIVE_INTERRUPT1 UCRXIE1
+
156 #define EUSCI_B_I2C_RECEIVE_INTERRUPT2 UCRXIE2
+
157 #define EUSCI_B_I2C_RECEIVE_INTERRUPT3 UCRXIE3
+
158 #define EUSCI_B_I2C_BIT9_POSITION_INTERRUPT UCBIT9IE
+
159 #define EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT UCCLTOIE
+
160 #define EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT UCBCNTIE
+
161 
+
162 //*****************************************************************************
+
163 //
+
164 // The following are values that can be passed toThe following are values that
+
165 // can be returned by the EUSCI_B_I2C_isBusBusy() function.
+
166 //
+
167 //*****************************************************************************
+
168 #define EUSCI_B_I2C_BUS_BUSY UCBBUSY
+
169 #define EUSCI_B_I2C_BUS_NOT_BUSY 0x00
+
170 
+
171 //*****************************************************************************
+
172 //
+
173 // The following are values that can be passed toThe following are values that
+
174 // can be returned by the EUSCI_B_I2C_masterIsStopSent() function.
+
175 //
+
176 //*****************************************************************************
+
177 #define EUSCI_B_I2C_STOP_SEND_COMPLETE 0x00
+
178 #define EUSCI_B_I2C_SENDING_STOP UCTXSTP
+
179 
+
180 //*****************************************************************************
+
181 //
+
182 // The following are values that can be passed toThe following are values that
+
183 // can be returned by the EUSCI_B_I2C_masterIsStartSent() function.
+
184 //
+
185 //*****************************************************************************
+
186 #define EUSCI_B_I2C_START_SEND_COMPLETE 0x00
+
187 #define EUSCI_B_I2C_SENDING_START UCTXSTT
+
188 
+
189 //*****************************************************************************
+
190 //
+
191 // The following are values that can be passed to the timeout parameter for
+
192 // functions: EUSCI_B_I2C_setTimeout().
+
193 //
+
194 //*****************************************************************************
+
195 #define EUSCI_B_I2C_TIMEOUT_DISABLE UCCLTO_0
+
196 #define EUSCI_B_I2C_TIMEOUT_28_MS UCCLTO_1
+
197 #define EUSCI_B_I2C_TIMEOUT_31_MS UCCLTO_2
+
198 #define EUSCI_B_I2C_TIMEOUT_34_MS UCCLTO_3
+
199 
+
200 //*****************************************************************************
+
201 //
+
202 // Prototypes for the APIs.
+
203 //
+
204 //*****************************************************************************
+
205 
+
206 //*****************************************************************************
+
207 //
+
219 //
+
220 //*****************************************************************************
+
221 extern void EUSCI_B_I2C_initMaster(uint16_t baseAddress,
+
222  EUSCI_B_I2C_initMasterParam *param);
+
223 
+
224 //*****************************************************************************
+
225 //
+
237 //
+
238 //*****************************************************************************
+
239 extern void EUSCI_B_I2C_initSlave(uint16_t baseAddress,
+
240  EUSCI_B_I2C_initSlaveParam *param);
+
241 
+
242 //*****************************************************************************
+
243 //
+
253 //
+
254 //*****************************************************************************
+
255 extern void EUSCI_B_I2C_enable(uint16_t baseAddress);
+
256 
+
257 //*****************************************************************************
+
258 //
+
268 //
+
269 //*****************************************************************************
+
270 extern void EUSCI_B_I2C_disable(uint16_t baseAddress);
+
271 
+
272 //*****************************************************************************
+
273 //
+
285 //
+
286 //*****************************************************************************
+
287 extern void EUSCI_B_I2C_setSlaveAddress(uint16_t baseAddress,
+
288  uint8_t slaveAddress);
+
289 
+
290 //*****************************************************************************
+
291 //
+
307 //
+
308 //*****************************************************************************
+
309 extern void EUSCI_B_I2C_setMode(uint16_t baseAddress,
+
310  uint16_t mode);
+
311 
+
312 //*****************************************************************************
+
313 //
+
326 //
+
327 //*****************************************************************************
+
328 extern uint8_t EUSCI_B_I2C_getMode(uint16_t baseAddress);
+
329 
+
330 //*****************************************************************************
+
331 //
+
343 //
+
344 //*****************************************************************************
+
345 extern void EUSCI_B_I2C_slavePutData(uint16_t baseAddress,
+
346  uint8_t transmitData);
+
347 
+
348 //*****************************************************************************
+
349 //
+
358 //
+
359 //*****************************************************************************
+
360 extern uint8_t EUSCI_B_I2C_slaveGetData(uint16_t baseAddress);
+
361 
+
362 //*****************************************************************************
+
363 //
+
376 //
+
377 //*****************************************************************************
+
378 extern uint16_t EUSCI_B_I2C_isBusBusy(uint16_t baseAddress);
+
379 
+
380 //*****************************************************************************
+
381 //
+
393 //
+
394 //*****************************************************************************
+
395 extern uint16_t EUSCI_B_I2C_masterIsStopSent(uint16_t baseAddress);
+
396 
+
397 //*****************************************************************************
+
398 //
+
410 //
+
411 //*****************************************************************************
+
412 extern uint16_t EUSCI_B_I2C_masterIsStartSent(uint16_t baseAddress);
+
413 
+
414 //*****************************************************************************
+
415 //
+
447 //
+
448 //*****************************************************************************
+
449 extern void EUSCI_B_I2C_enableInterrupt(uint16_t baseAddress,
+
450  uint16_t mask);
+
451 
+
452 //*****************************************************************************
+
453 //
+
485 //
+
486 //*****************************************************************************
+
487 extern void EUSCI_B_I2C_disableInterrupt(uint16_t baseAddress,
+
488  uint16_t mask);
+
489 
+
490 //*****************************************************************************
+
491 //
+
523 //
+
524 //*****************************************************************************
+
525 extern void EUSCI_B_I2C_clearInterrupt(uint16_t baseAddress,
+
526  uint16_t mask);
+
527 
+
528 //*****************************************************************************
+
529 //
+
577 //
+
578 //*****************************************************************************
+
579 extern uint16_t EUSCI_B_I2C_getInterruptStatus(uint16_t baseAddress,
+
580  uint16_t mask);
+
581 
+
582 //*****************************************************************************
+
583 //
+
597 //
+
598 //*****************************************************************************
+
599 extern void EUSCI_B_I2C_masterSendSingleByte(uint16_t baseAddress,
+
600  uint8_t txData);
+
601 
+
602 //*****************************************************************************
+
603 //
+
616 //
+
617 //*****************************************************************************
+
618 extern uint8_t EUSCI_B_I2C_masterReceiveSingleByte(uint16_t baseAddress);
+
619 
+
620 //*****************************************************************************
+
621 //
+
636 //
+
637 //*****************************************************************************
+
638 extern bool EUSCI_B_I2C_masterSendSingleByteWithTimeout(uint16_t baseAddress,
+
639  uint8_t txData,
+
640  uint32_t timeout);
+
641 
+
642 //*****************************************************************************
+
643 //
+
656 //
+
657 //*****************************************************************************
+
658 extern void EUSCI_B_I2C_masterSendMultiByteStart(uint16_t baseAddress,
+
659  uint8_t txData);
+
660 
+
661 //*****************************************************************************
+
662 //
+
676 //
+
677 //*****************************************************************************
+
678 extern bool EUSCI_B_I2C_masterSendMultiByteStartWithTimeout(uint16_t baseAddress,
+
679  uint8_t txData,
+
680  uint32_t timeout);
+
681 
+
682 //*****************************************************************************
+
683 //
+
696 //
+
697 //*****************************************************************************
+
698 extern void EUSCI_B_I2C_masterSendMultiByteNext(uint16_t baseAddress,
+
699  uint8_t txData);
+
700 
+
701 //*****************************************************************************
+
702 //
+
716 //
+
717 //*****************************************************************************
+
718 extern bool EUSCI_B_I2C_masterSendMultiByteNextWithTimeout(uint16_t baseAddress,
+
719  uint8_t txData,
+
720  uint32_t timeout);
+
721 
+
722 //*****************************************************************************
+
723 //
+
737 //
+
738 //*****************************************************************************
+
739 extern void EUSCI_B_I2C_masterSendMultiByteFinish(uint16_t baseAddress,
+
740  uint8_t txData);
+
741 
+
742 //*****************************************************************************
+
743 //
+
758 //
+
759 //*****************************************************************************
+
760 extern bool EUSCI_B_I2C_masterSendMultiByteFinishWithTimeout(uint16_t baseAddress,
+
761  uint8_t txData,
+
762  uint32_t timeout);
+
763 
+
764 //*****************************************************************************
+
765 //
+
775 //
+
776 //*****************************************************************************
+
777 extern void EUSCI_B_I2C_masterSendStart(uint16_t baseAddress);
+
778 
+
779 //*****************************************************************************
+
780 //
+
793 //
+
794 //*****************************************************************************
+
795 extern void EUSCI_B_I2C_masterSendMultiByteStop(uint16_t baseAddress);
+
796 
+
797 //*****************************************************************************
+
798 //
+
812 //
+
813 //*****************************************************************************
+
814 extern bool EUSCI_B_I2C_masterSendMultiByteStopWithTimeout(uint16_t baseAddress,
+
815  uint32_t timeout);
+
816 
+
817 //*****************************************************************************
+
818 //
+
829 //
+
830 //*****************************************************************************
+
831 extern void EUSCI_B_I2C_masterReceiveStart(uint16_t baseAddress);
+
832 
+
833 //*****************************************************************************
+
834 //
+
843 //
+
844 //*****************************************************************************
+
845 extern uint8_t EUSCI_B_I2C_masterReceiveMultiByteNext(uint16_t baseAddress);
+
846 
+
847 //*****************************************************************************
+
848 //
+
860 //
+
861 //*****************************************************************************
+
862 extern uint8_t EUSCI_B_I2C_masterReceiveMultiByteFinish(uint16_t baseAddress);
+
863 
+
864 //*****************************************************************************
+
865 //
+
880 //
+
881 //*****************************************************************************
+
882 extern bool EUSCI_B_I2C_masterReceiveMultiByteFinishWithTimeout(uint16_t baseAddress,
+
883  uint8_t *txData,
+
884  uint32_t timeout);
+
885 
+
886 //*****************************************************************************
+
887 //
+
898 //
+
899 //*****************************************************************************
+
900 extern void EUSCI_B_I2C_masterReceiveMultiByteStop(uint16_t baseAddress);
+
901 
+
902 //*****************************************************************************
+
903 //
+
914 //
+
915 //*****************************************************************************
+
916 extern void EUSCI_B_I2C_enableMultiMasterMode(uint16_t baseAddress);
+
917 
+
918 //*****************************************************************************
+
919 //
+
930 //
+
931 //*****************************************************************************
+
932 extern void EUSCI_B_I2C_disableMultiMasterMode(uint16_t baseAddress);
+
933 
+
934 //*****************************************************************************
+
935 //
+
944 //
+
945 //*****************************************************************************
+
946 extern uint8_t EUSCI_B_I2C_masterReceiveSingle(uint16_t baseAddress);
+
947 
+
948 //*****************************************************************************
+
949 //
+
958 //
+
959 //*****************************************************************************
+
960 extern uint32_t EUSCI_B_I2C_getReceiveBufferAddress(uint16_t baseAddress);
+
961 
+
962 //*****************************************************************************
+
963 //
+
972 //
+
973 //*****************************************************************************
+
974 extern uint32_t EUSCI_B_I2C_getTransmitBufferAddress(uint16_t baseAddress);
+
975 
+
976 //*****************************************************************************
+
977 //
+
1001 //
+
1002 //*****************************************************************************
+
1003 extern void EUSCI_B_I2C_setTimeout(uint16_t baseAddress,
+
1004  uint16_t timeout);
+
1005 
+
1006 //*****************************************************************************
+
1007 //
+
1008 // Mark the end of the C bindings section for C++ compilers.
+
1009 //
+
1010 //*****************************************************************************
+
1011 #ifdef __cplusplus
+
1012 }
+
1013 #endif
+
1014 
+
1015 #endif
+
1016 #endif // __MSP430WARE_EUSCI_B_I2C_H__
+ +
+
+ + + + diff --git a/Documentation/html/eusci__b__spi_8c.html b/Documentation/html/eusci__b__spi_8c.html new file mode 100644 index 0000000..42ea996 --- /dev/null +++ b/Documentation/html/eusci__b__spi_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_spi.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_spi.c File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__b__spi_8c_source.html b/Documentation/html/eusci__b__spi_8c_source.html new file mode 100644 index 0000000..0e3dc88 --- /dev/null +++ b/Documentation/html/eusci__b__spi_8c_source.html @@ -0,0 +1,299 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_spi.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_spi.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_b_spi.c - Driver for the eusci_b_spi Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_EUSCI_Bx__
+
17 #include "eusci_b_spi.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void EUSCI_B_SPI_initMaster (uint16_t baseAddress,
+
22  EUSCI_B_SPI_initMasterParam *param)
+
23 {
+
24  //Disable the USCI Module
+
25  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
26 
+
27  //Reset OFS_UCBxCTLW0 values
+
28  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCCKPH + UCCKPL + UC7BIT + UCMSB +
+
29  UCMST + UCMODE_3 + UCSYNC);
+
30 
+
31  //Reset OFS_UCBxCTLW0 values
+
32  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCSSEL_3);
+
33 
+
34  //Select Clock
+
35  HWREG16(baseAddress + OFS_UCBxCTLW0) |= (uint16_t)param->selectClockSource;
+
36 
+
37  HWREG16(baseAddress + OFS_UCBxBRW) =
+
38  (uint16_t)(param->clockSourceFrequency / param->desiredSpiClock);
+
39 
+
40  /*
+
41  * Configure as SPI master mode.
+
42  * Clock phase select, polarity, msb
+
43  * UCMST = Master mode
+
44  * UCSYNC = Synchronous mode
+
45  * UCMODE_0 = 3-pin SPI
+
46  */
+
47  HWREG16(baseAddress + OFS_UCBxCTLW0) |= (
+
48  param->msbFirst +
+
49  param->clockPhase +
+
50  param->clockPolarity +
+
51  UCMST +
+
52  UCSYNC +
+
53  param->spiMode
+
54  );
+
55 }
+
56 
+
57 void EUSCI_B_SPI_select4PinFunctionality (uint16_t baseAddress,
+
58  uint16_t select4PinFunctionality
+
59  )
+
60 {
+
61  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCSTEM;
+
62  HWREG16(baseAddress + OFS_UCBxCTLW0) |= select4PinFunctionality;
+
63 }
+
64 
+
65 void EUSCI_B_SPI_changeMasterClock (uint16_t baseAddress,
+
66  EUSCI_B_SPI_changeMasterClockParam *param)
+
67 {
+
68  //Disable the USCI Module
+
69  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
70 
+
71  HWREG16(baseAddress + OFS_UCBxBRW) =
+
72  (uint16_t)(param->clockSourceFrequency / param->desiredSpiClock);
+
73 
+
74  //Reset the UCSWRST bit to enable the USCI Module
+
75  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCSWRST);
+
76 }
+
77 
+
78 void EUSCI_B_SPI_initSlave (uint16_t baseAddress, EUSCI_B_SPI_initSlaveParam *param)
+
79 {
+
80  //Disable USCI Module
+
81  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
82 
+
83  //Reset OFS_UCBxCTLW0 register
+
84  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCMSB +
+
85  UC7BIT +
+
86  UCMST +
+
87  UCCKPL +
+
88  UCCKPH +
+
89  UCMODE_3
+
90  );
+
91 
+
92  //Clock polarity, phase select, msbFirst, SYNC, Mode0
+
93  HWREG16(baseAddress + OFS_UCBxCTLW0) |= (param->clockPhase +
+
94  param->clockPolarity +
+
95  param->msbFirst +
+
96  UCSYNC +
+
97  param->spiMode
+
98  );
+
99 }
+
100 
+
101 void EUSCI_B_SPI_changeClockPhasePolarity (uint16_t baseAddress,
+
102  uint16_t clockPhase,
+
103  uint16_t clockPolarity
+
104  )
+
105 {
+
106  //Disable the USCI Module
+
107  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
108 
+
109  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCCKPH + UCCKPL);
+
110 
+
111  HWREG16(baseAddress + OFS_UCBxCTLW0) |= (
+
112  clockPhase +
+
113  clockPolarity
+
114  );
+
115 
+
116  //Reset the UCSWRST bit to enable the USCI Module
+
117  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCSWRST);
+
118 }
+
119 
+
120 void EUSCI_B_SPI_transmitData ( uint16_t baseAddress,
+
121  uint8_t transmitData
+
122  )
+
123 {
+
124  HWREG16(baseAddress + OFS_UCBxTXBUF) = transmitData;
+
125 }
+
126 
+
127 uint8_t EUSCI_B_SPI_receiveData (uint16_t baseAddress)
+
128 {
+
129  return ( HWREG16(baseAddress + OFS_UCBxRXBUF)) ;
+
130 }
+
131 
+
132 void EUSCI_B_SPI_enableInterrupt (uint16_t baseAddress,
+
133  uint16_t mask
+
134  )
+
135 {
+
136  HWREG16(baseAddress + OFS_UCBxIE) |= mask;
+
137 }
+
138 
+
139 void EUSCI_B_SPI_disableInterrupt (uint16_t baseAddress,
+
140  uint16_t mask
+
141  )
+
142 {
+
143  HWREG16(baseAddress + OFS_UCBxIE) &= ~mask;
+
144 }
+
145 
+
146 uint8_t EUSCI_B_SPI_getInterruptStatus (uint16_t baseAddress,
+
147  uint8_t mask
+
148  )
+
149 {
+
150  return ( HWREG16(baseAddress + OFS_UCBxIFG) & mask );
+
151 }
+
152 
+
153 void EUSCI_B_SPI_clearInterrupt (uint16_t baseAddress,
+
154  uint16_t mask
+
155  )
+
156 {
+
157  HWREG16(baseAddress + OFS_UCBxIFG) &= ~mask;
+
158 }
+
159 
+
160 void EUSCI_B_SPI_enable (uint16_t baseAddress)
+
161 {
+
162  //Reset the UCSWRST bit to enable the USCI Module
+
163  HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~(UCSWRST);
+
164 }
+
165 
+
166 void EUSCI_B_SPI_disable (uint16_t baseAddress)
+
167 {
+
168  //Set the UCSWRST bit to disable the USCI Module
+
169  HWREG16(baseAddress + OFS_UCBxCTLW0) |= UCSWRST;
+
170 }
+
171 
+
172 uint32_t EUSCI_B_SPI_getReceiveBufferAddress (uint16_t baseAddress)
+
173 {
+
174  return ( baseAddress + OFS_UCBxRXBUF );
+
175 }
+
176 
+
177 uint32_t EUSCI_B_SPI_getTransmitBufferAddress (uint16_t baseAddress)
+
178 {
+
179  return ( baseAddress + OFS_UCBxTXBUF );
+
180 }
+
181 
+
182 uint16_t EUSCI_B_SPI_isBusy (uint16_t baseAddress)
+
183 {
+
184  //Return the bus busy status.
+
185  return (HWREG16(baseAddress + OFS_UCBxSTATW) & UCBUSY);
+
186 }
+
187 
+
188 
+
189 #endif
+
190 //*****************************************************************************
+
191 //
+
194 //
+
195 //*****************************************************************************
+ + +
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/eusci__b__spi_8h.html b/Documentation/html/eusci__b__spi_8h.html new file mode 100644 index 0000000..43622c3 --- /dev/null +++ b/Documentation/html/eusci__b__spi_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_spi.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_spi.h File Reference
+
+ +
+ + + + diff --git a/Documentation/html/eusci__b__spi_8h_source.html b/Documentation/html/eusci__b__spi_8h_source.html new file mode 100644 index 0000000..f95825e --- /dev/null +++ b/Documentation/html/eusci__b__spi_8h_source.html @@ -0,0 +1,368 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/eusci_b_spi.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_spi.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // eusci_b_spi.h - Driver for the EUSCI_B_SPI Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_EUSCI_B_SPI_H__
+
8 #define __MSP430WARE_EUSCI_B_SPI_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_EUSCI_Bx__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 #include "inc/hw_memmap.h"
+
26 //*****************************************************************************
+
27 //
+
30 //
+
31 //*****************************************************************************
+
32 typedef struct EUSCI_B_SPI_initMasterParam {
+
38  uint8_t selectClockSource;
+
40  uint32_t clockSourceFrequency;
+
42  uint32_t desiredSpiClock;
+
47  uint16_t msbFirst;
+
52  uint16_t clockPhase;
+
57  uint16_t clockPolarity;
+
63  uint16_t spiMode;
+
64 } EUSCI_B_SPI_initMasterParam;
+
65 
+
66 //*****************************************************************************
+
67 //
+
69 //
+
70 //*****************************************************************************
+
71 typedef struct EUSCI_B_SPI_initSlaveParam {
+
76  uint16_t msbFirst;
+
81  uint16_t clockPhase;
+
86  uint16_t clockPolarity;
+
92  uint16_t spiMode;
+
93 } EUSCI_B_SPI_initSlaveParam;
+
94 
+
95 //*****************************************************************************
+
96 //
+
99 //
+
100 //*****************************************************************************
+
101 typedef struct EUSCI_B_SPI_changeMasterClockParam {
+
103  uint32_t clockSourceFrequency;
+
105  uint32_t desiredSpiClock;
+
106 } EUSCI_B_SPI_changeMasterClockParam;
+
107 
+
108 
+
109 //*****************************************************************************
+
110 //
+
111 // The following are values that can be passed to the clockPhase parameter for
+
112 // functions: EUSCI_B_SPI_changeClockPhasePolarity(); the param parameter for
+
113 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
+
114 //
+
115 //*****************************************************************************
+
116 #define EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00
+
117 #define EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT UCCKPH
+
118 
+
119 //*****************************************************************************
+
120 //
+
121 // The following are values that can be passed to the param parameter for
+
122 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
+
123 //
+
124 //*****************************************************************************
+
125 #define EUSCI_B_SPI_MSB_FIRST UCMSB
+
126 #define EUSCI_B_SPI_LSB_FIRST 0x00
+
127 
+
128 //*****************************************************************************
+
129 //
+
130 // The following are values that can be passed to the param parameter for
+
131 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave(); the
+
132 // clockPolarity parameter for functions:
+
133 // EUSCI_B_SPI_changeClockPhasePolarity().
+
134 //
+
135 //*****************************************************************************
+
136 #define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH UCCKPL
+
137 #define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00
+
138 
+
139 //*****************************************************************************
+
140 //
+
141 // The following are values that can be passed to the param parameter for
+
142 // functions: EUSCI_B_SPI_initMaster().
+
143 //
+
144 //*****************************************************************************
+
145 #define EUSCI_B_SPI_CLOCKSOURCE_ACLK UCSSEL__ACLK
+
146 #define EUSCI_B_SPI_CLOCKSOURCE_SMCLK UCSSEL__SMCLK
+
147 
+
148 //*****************************************************************************
+
149 //
+
150 // The following are values that can be passed to the param parameter for
+
151 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
+
152 //
+
153 //*****************************************************************************
+
154 #define EUSCI_B_SPI_3PIN UCMODE_0
+
155 #define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH UCMODE_1
+
156 #define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW UCMODE_2
+
157 
+
158 //*****************************************************************************
+
159 //
+
160 // The following are values that can be passed to the select4PinFunctionality
+
161 // parameter for functions: EUSCI_B_SPI_select4PinFunctionality().
+
162 //
+
163 //*****************************************************************************
+
164 #define EUSCI_B_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x0000
+
165 #define EUSCI_B_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE UCSTEM
+
166 
+
167 //*****************************************************************************
+
168 //
+
169 // The following are values that can be passed to the mask parameter for
+
170 // functions: EUSCI_B_SPI_enableInterrupt(), EUSCI_B_SPI_disableInterrupt(),
+
171 // EUSCI_B_SPI_getInterruptStatus(), and EUSCI_B_SPI_clearInterrupt() as well
+
172 // as returned by the EUSCI_B_SPI_getInterruptStatus() function.
+
173 //
+
174 //*****************************************************************************
+
175 #define EUSCI_B_SPI_TRANSMIT_INTERRUPT UCTXIE
+
176 #define EUSCI_B_SPI_RECEIVE_INTERRUPT UCRXIE
+
177 
+
178 //*****************************************************************************
+
179 //
+
180 // The following are values that can be passed toThe following are values that
+
181 // can be returned by the EUSCI_B_SPI_isBusy() function.
+
182 //
+
183 //*****************************************************************************
+
184 #define EUSCI_B_SPI_BUSY UCBUSY
+
185 #define EUSCI_B_SPI_NOT_BUSY 0x00
+
186 
+
187 //*****************************************************************************
+
188 //
+
189 // Prototypes for the APIs.
+
190 //
+
191 //*****************************************************************************
+
192 
+
193 //*****************************************************************************
+
194 //
+
208 //
+
209 //*****************************************************************************
+
210 extern void EUSCI_B_SPI_initMaster(uint16_t baseAddress,
+
211  EUSCI_B_SPI_initMasterParam *param);
+
212 
+
213 //*****************************************************************************
+
214 //
+
229 //
+
230 //*****************************************************************************
+
231 extern void EUSCI_B_SPI_select4PinFunctionality(uint16_t baseAddress,
+
232  uint16_t select4PinFunctionality);
+
233 
+
234 //*****************************************************************************
+
235 //
+
245 //
+
246 //*****************************************************************************
+
247 extern void EUSCI_B_SPI_changeMasterClock(uint16_t baseAddress,
+
248  EUSCI_B_SPI_changeMasterClockParam *param);
+
249 
+
250 //*****************************************************************************
+
251 //
+
265 //
+
266 //*****************************************************************************
+
267 extern void EUSCI_B_SPI_initSlave(uint16_t baseAddress,
+
268  EUSCI_B_SPI_initSlaveParam *param);
+
269 
+
270 //*****************************************************************************
+
271 //
+
290 //
+
291 //*****************************************************************************
+
292 extern void EUSCI_B_SPI_changeClockPhasePolarity(uint16_t baseAddress,
+
293  uint16_t clockPhase,
+
294  uint16_t clockPolarity);
+
295 
+
296 //*****************************************************************************
+
297 //
+
307 //
+
308 //*****************************************************************************
+
309 extern void EUSCI_B_SPI_transmitData(uint16_t baseAddress,
+
310  uint8_t transmitData);
+
311 
+
312 //*****************************************************************************
+
313 //
+
322 //
+
323 //*****************************************************************************
+
324 extern uint8_t EUSCI_B_SPI_receiveData(uint16_t baseAddress);
+
325 
+
326 //*****************************************************************************
+
327 //
+
343 //
+
344 //*****************************************************************************
+
345 extern void EUSCI_B_SPI_enableInterrupt(uint16_t baseAddress,
+
346  uint16_t mask);
+
347 
+
348 //*****************************************************************************
+
349 //
+
365 //
+
366 //*****************************************************************************
+
367 extern void EUSCI_B_SPI_disableInterrupt(uint16_t baseAddress,
+
368  uint16_t mask);
+
369 
+
370 //*****************************************************************************
+
371 //
+
387 //
+
388 //*****************************************************************************
+
389 extern uint8_t EUSCI_B_SPI_getInterruptStatus(uint16_t baseAddress,
+
390  uint8_t mask);
+
391 
+
392 //*****************************************************************************
+
393 //
+
405 //
+
406 //*****************************************************************************
+
407 extern void EUSCI_B_SPI_clearInterrupt(uint16_t baseAddress,
+
408  uint16_t mask);
+
409 
+
410 //*****************************************************************************
+
411 //
+
421 //
+
422 //*****************************************************************************
+
423 extern void EUSCI_B_SPI_enable(uint16_t baseAddress);
+
424 
+
425 //*****************************************************************************
+
426 //
+
436 //
+
437 //*****************************************************************************
+
438 extern void EUSCI_B_SPI_disable(uint16_t baseAddress);
+
439 
+
440 //*****************************************************************************
+
441 //
+
450 //
+
451 //*****************************************************************************
+
452 extern uint32_t EUSCI_B_SPI_getReceiveBufferAddress(uint16_t baseAddress);
+
453 
+
454 //*****************************************************************************
+
455 //
+
464 //
+
465 //*****************************************************************************
+
466 extern uint32_t EUSCI_B_SPI_getTransmitBufferAddress(uint16_t baseAddress);
+
467 
+
468 //*****************************************************************************
+
469 //
+
481 //
+
482 //*****************************************************************************
+
483 extern uint16_t EUSCI_B_SPI_isBusy(uint16_t baseAddress);
+
484 
+
485 //*****************************************************************************
+
486 //
+
487 // Mark the end of the C bindings section for C++ compilers.
+
488 //
+
489 //*****************************************************************************
+
490 #ifdef __cplusplus
+
491 }
+
492 #endif
+
493 
+
494 #endif
+
495 #endif // __MSP430WARE_EUSCI_B_SPI_H__
+ +
+
+ + + + diff --git a/Documentation/html/files.html b/Documentation/html/files.html index 499b74b..a3d37cb 100644 --- a/Documentation/html/files.html +++ b/Documentation/html/files.html @@ -93,13 +93,104 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
Here is a list of all files with brief descriptions:
-
[detail level 1234]
+
[detail level 12345678]
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Hardware
 Meta
  Software
  Code Composer Studio Workspace
  SunseekerTelemetryAndLightingSystem
 main.c
  Libraries
  driverlib
  MSP430F5xx_6xx
  inc
 hw_memmap.h
 version.h
 adc10_a.c
 adc10_a.h
 adc12_a.c
 adc12_a.h
 aes.c
 aes.h
 battbak.c
 battbak.h
 comp_b.c
 comp_b.h
 crc.c
 crc.h
 ctsd16.c
 ctsd16.h
 dac12_a.c
 dac12_a.h
 dma.c
 dma.h
 driverlib.h
 eusci_a_spi.c
 eusci_a_spi.h
 eusci_a_uart.c
 eusci_a_uart.h
 eusci_b_i2c.c
 eusci_b_i2c.h
 eusci_b_spi.c
 eusci_b_spi.h
 flashctl.c
 flashctl.h
 gpio.c
 gpio.h
 lcd_b.c
 lcd_b.h
 lcd_c.c
 lcd_c.h
 ldopwr.c
 ldopwr.h
 lextab.py
 mpy32.c
 mpy32.h
 oa.c
 oa.h
 pmap.c
 pmap.h
 pmm.c
 pmm.h
 ram.c
 ram.h
 ref.c
 ref.h
 rtc_a.c
 rtc_a.h
 rtc_b.c
 rtc_b.h
 rtc_c.c
 rtc_c.h
 sd24_b.c
 sd24_b.h
 sfr.c
 sfr.h
 sysctl.c
 sysctl.h
 tec.c
 tec.h
 timer_a.c
 timer_a.h
 timer_b.c
 timer_b.h
 timer_d.c
 timer_d.h
 tlv.c
 tlv.h
 ucs.c
 ucs.h
 usci_a_spi.c
 usci_a_spi.h
 usci_a_uart.c
 usci_a_uart.h
 usci_b_i2c.c
 usci_b_i2c.h
 usci_b_spi.c
 usci_b_spi.h
 wdt_a.c
 wdt_a.h
 yacctab.py
 main.c
@@ -107,7 +198,7 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); }); diff --git a/Documentation/html/files_dup.js b/Documentation/html/files_dup.js index 5b0d271..c9e145a 100644 --- a/Documentation/html/files_dup.js +++ b/Documentation/html/files_dup.js @@ -1,6 +1,6 @@ var files_dup = [ - [ "Hardware", "dir_6cc751a9e685a986d41d35de353de328.html", "dir_6cc751a9e685a986d41d35de353de328" ], + [ "Hardware", "dir_6cc751a9e685a986d41d35de353de328.html", null ], [ "Meta", "dir_7795a02a4813dcd036f04e5f7854f185.html", null ], [ "Software", "dir_4e9c05acfa2c3671b8618fcb95d57d96.html", "dir_4e9c05acfa2c3671b8618fcb95d57d96" ] ]; \ No newline at end of file diff --git a/Documentation/html/flashctl_8c.html b/Documentation/html/flashctl_8c.html new file mode 100644 index 0000000..68c7b75 --- /dev/null +++ b/Documentation/html/flashctl_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/flashctl.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
flashctl.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/flashctl_8c_source.html b/Documentation/html/flashctl_8c_source.html new file mode 100644 index 0000000..0dfef74 --- /dev/null +++ b/Documentation/html/flashctl_8c_source.html @@ -0,0 +1,384 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/flashctl.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
flashctl.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // flashctl.c - Driver for the flashctl Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_FLASH__
+
17 #include "flashctl.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 void FlashCtl_eraseSegment ( uint8_t *flash_ptr){
+
22  //Clear Lock bit
+
23  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
24 
+
25  //Set Erase bit
+
26  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + ERASE;
+
27 
+
28  //Dummy write to erase Flash seg
+
29  *flash_ptr = 0;
+
30 
+
31  //test busy
+
32  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
33 
+
34  //Clear ERASE bit
+
35  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
36 
+
37  //Set LOCK bit
+
38  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
39 }
+
40 
+
41 void FlashCtl_eraseBank ( uint8_t *flash_ptr){
+
42  uint16_t interruptState;
+
43 
+
44  //Clear Lock bit
+
45  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
46 
+
47  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY);
+
48 
+
49  //FLASH34 errata: no concurrent access to flash bank while erasing
+
50  interruptState = __get_interrupt_state();
+
51  __disable_interrupt();
+
52  __no_operation();
+
53 
+
54  //Set MERAS bit
+
55  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + MERAS;
+
56 
+
57  //Dummy write to erase Flash seg
+
58  *flash_ptr = 0;
+
59 
+
60  //test busy
+
61  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY);
+
62 
+
63  //FLASH34 errata
+
64  //Re-enable interrupt state to whatever it was before
+
65  if (interruptState & GIE)
+
66  {
+
67  __enable_interrupt();
+
68  }
+
69 
+
70  //Clear MERAS bit
+
71  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
72 
+
73  //Set LOCK bit
+
74  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
75 }
+
76 
+
77 void FlashCtl_performMassErase ( uint8_t *flash_ptr){
+
78  //Clear Lock bit
+
79  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
80 
+
81  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
82 
+
83  //Set MERAS bit
+
84  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + MERAS + ERASE;
+
85 
+
86  //Dummy write to erase Flash seg
+
87  *flash_ptr = 0;
+
88 
+
89  //test busy
+
90  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
91 
+
92  //Clear MERAS bit
+
93  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
94 
+
95  //Set LOCK bit
+
96  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
97 }
+
98 
+
99 bool FlashCtl_performEraseCheck (uint8_t *flash_ptr,
+
100  uint16_t numberOfBytes
+
101  )
+
102 {
+
103  uint16_t i;
+
104 
+
105  for (i = 0; i < numberOfBytes; i++)
+
106  {
+
107  //was erasing successfull?
+
108  if ((*(flash_ptr + i)) != 0xFF){
+
109  return ( STATUS_FAIL) ;
+
110  }
+
111  }
+
112  return ( STATUS_SUCCESS) ;
+
113 }
+
114 
+
115 void FlashCtl_write8 (uint8_t *data_ptr,
+
116  uint8_t *flash_ptr,
+
117  uint16_t count
+
118  )
+
119 {
+
120  //Clear Lock bit
+
121  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
122 
+
123  //Enable byte/word write mode
+
124  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + WRT;
+
125 
+
126  while (count > 0)
+
127  {
+
128  //test busy
+
129  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
130 
+
131  //Write to Flash
+
132  *flash_ptr++ = *data_ptr++;
+
133  count--;
+
134  }
+
135 
+
136  //Clear WRT bit
+
137  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
138 
+
139  //Set LOCK bit
+
140  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
141 }
+
142 
+
143 void FlashCtl_write16 (uint16_t *data_ptr,
+
144  uint16_t *flash_ptr,
+
145  uint16_t count
+
146  )
+
147 {
+
148  //Clear Lock bit
+
149  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
150 
+
151  //Enable byte/word write mode
+
152  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + WRT;
+
153 
+
154  while (count > 0)
+
155  {
+
156  //test busy
+
157  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
158 
+
159  //Write to Flash
+
160  *flash_ptr++ = *data_ptr++;
+
161  count--;
+
162  }
+
163 
+
164  //Clear WRT bit
+
165  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
166 
+
167  //Set LOCK bit
+
168  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
169 }
+
170 
+
171 void FlashCtl_write32 (uint32_t *data_ptr,
+
172  uint32_t *flash_ptr,
+
173  uint16_t count
+
174  )
+
175 {
+
176  //Clear Lock bit
+
177  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
178 
+
179  //Enable long-word write
+
180  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + BLKWRT;
+
181 
+
182  while (count > 0)
+
183  {
+
184  //test busy
+
185  while (HWREG8(FLASH_BASE + OFS_FCTL3) & BUSY) ;
+
186 
+
187  //Write to Flash
+
188  *flash_ptr++ = *data_ptr++;
+
189 
+
190  count--;
+
191  }
+
192 
+
193  //Clear BLKWRT bit
+
194  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
195 
+
196  //Set LOCK bit
+
197  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
198 }
+
199 
+
200 void FlashCtl_fillMemory32 (uint32_t value,
+
201  uint32_t *flash_ptr,
+
202  uint16_t count
+
203  )
+
204 {
+
205  //Clear Lock bit
+
206  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY;
+
207 
+
208  //Enable long-word write
+
209  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY + BLKWRT;
+
210 
+
211  //test busy
+
212  while (count > 0)
+
213  {
+
214  while ((HWREG8(FLASH_BASE + OFS_FCTL3)) & BUSY) ;
+
215 
+
216  //Write to Flash
+
217  *flash_ptr++ = value;
+
218 
+
219  count--;
+
220  }
+
221 
+
222  //Clear BLKWRT bit
+
223  HWREG16(FLASH_BASE + OFS_FCTL1) = FWKEY;
+
224 
+
225  //Set LOCK bit
+
226  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY + LOCK;
+
227 }
+
228 
+
229 uint8_t FlashCtl_getStatus (uint8_t mask
+
230  )
+
231 {
+
232  return ((HWREG8(FLASH_BASE + OFS_FCTL3) & mask ));
+
233 }
+
234 
+
235 void FlashCtl_lockInfoA (void)
+
236 {
+
237  //Disable global interrupts while doing RMW operation on LOCKA bit
+
238  uint16_t gieStatus;
+
239  gieStatus = __get_SR_register() & GIE; //Store current SR register
+
240  __disable_interrupt(); //Disable global interrupt
+
241 
+
242  //Set the LOCKA bit in FCTL3.
+
243  //Since LOCKA toggles when you write a 1 (and writing 0 has no effect),
+
244  //read the register, XOR with LOCKA mask, mask the lower byte
+
245  //and write it back.
+
246  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY
+
247  + ((HWREG16(FLASH_BASE + OFS_FCTL3) ^ LOCKA) & 0xFF);
+
248 
+
249  //Reinstate SR register to restore global interrupt enable status
+
250  __bis_SR_register(gieStatus);
+
251 }
+
252 
+
253 void FlashCtl_unlockInfoA (void)
+
254 {
+
255  //Disable global interrupts while doing RMW operation on LOCKA bit
+
256  uint16_t gieStatus;
+
257  gieStatus = __get_SR_register() & GIE; //Store current SR register
+
258  __disable_interrupt(); //Disable global interrupt
+
259 
+
260  //Clear the LOCKA bit in FCTL3.
+
261  //Since LOCKA toggles when you write a 1 (and writing 0 has no effect),
+
262  //read the register, mask the lower byte, and write it back.
+
263  HWREG16(FLASH_BASE + OFS_FCTL3) = FWKEY
+
264  + (HWREG16(FLASH_BASE + OFS_FCTL3) & 0xFF);
+
265 
+
266  //Reinstate SR register to restore global interrupt enable status
+
267  __bis_SR_register(gieStatus);
+
268 }
+
269 
+
270 
+
271 #endif
+
272 //*****************************************************************************
+
273 //
+
276 //
+
277 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
#define STATUS_FAIL
Definition: hw_memmap.h:23
+
#define STATUS_SUCCESS
Definition: hw_memmap.h:22
+
+
+ + + + diff --git a/Documentation/html/flashctl_8h.html b/Documentation/html/flashctl_8h.html new file mode 100644 index 0000000..72d2096 --- /dev/null +++ b/Documentation/html/flashctl_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/flashctl.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
flashctl.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/flashctl_8h_source.html b/Documentation/html/flashctl_8h_source.html new file mode 100644 index 0000000..01b7de7 --- /dev/null +++ b/Documentation/html/flashctl_8h_source.html @@ -0,0 +1,234 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/flashctl.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
flashctl.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // flashctl.h - Driver for the FLASHCTL Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_FLASHCTL_H__
+
8 #define __MSP430WARE_FLASHCTL_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_FLASH__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // The following are values that can be passed to the mask parameter for
+
28 // functions: FlashCtl_getStatus() as well as returned by the
+
29 // FlashCtl_getStatus() function.
+
30 //
+
31 //*****************************************************************************
+
32 #define FLASHCTL_READY_FOR_NEXT_WRITE WAIT
+
33 #define FLASHCTL_ACCESS_VIOLATION_INTERRUPT_FLAG ACCVIFG
+
34 #define FLASHCTL_PASSWORD_WRITTEN_INCORRECTLY KEYV
+
35 #define FLASHCTL_BUSY BUSY
+
36 
+
37 //*****************************************************************************
+
38 //
+
39 // Prototypes for the APIs.
+
40 //
+
41 //*****************************************************************************
+
42 
+
43 //*****************************************************************************
+
44 //
+
54 //
+
55 //*****************************************************************************
+
56 extern void FlashCtl_eraseSegment(uint8_t *flash_ptr);
+
57 
+
58 //*****************************************************************************
+
59 //
+
68 //
+
69 //*****************************************************************************
+
70 extern void FlashCtl_eraseBank(uint8_t *flash_ptr);
+
71 
+
72 //*****************************************************************************
+
73 //
+
86 //
+
87 //*****************************************************************************
+
88 extern void FlashCtl_performMassErase(uint8_t *flash_ptr);
+
89 
+
90 //*****************************************************************************
+
91 //
+
101 //
+
102 //*****************************************************************************
+
103 extern bool FlashCtl_performEraseCheck(uint8_t *flash_ptr,
+
104  uint16_t numberOfBytes);
+
105 
+
106 //*****************************************************************************
+
107 //
+
119 //
+
120 //*****************************************************************************
+
121 extern void FlashCtl_write8(uint8_t *data_ptr,
+
122  uint8_t *flash_ptr,
+
123  uint16_t count);
+
124 
+
125 //*****************************************************************************
+
126 //
+
139 //
+
140 //*****************************************************************************
+
141 extern void FlashCtl_write16(uint16_t *data_ptr,
+
142  uint16_t *flash_ptr,
+
143  uint16_t count);
+
144 
+
145 //*****************************************************************************
+
146 //
+
159 //
+
160 //*****************************************************************************
+
161 extern void FlashCtl_write32(uint32_t *data_ptr,
+
162  uint32_t *flash_ptr,
+
163  uint16_t count);
+
164 
+
165 //*****************************************************************************
+
166 //
+
179 //
+
180 //*****************************************************************************
+
181 extern void FlashCtl_fillMemory32(uint32_t value,
+
182  uint32_t *flash_ptr,
+
183  uint16_t count);
+
184 
+
185 //*****************************************************************************
+
186 //
+
206 //
+
207 //*****************************************************************************
+
208 extern uint8_t FlashCtl_getStatus(uint8_t mask);
+
209 
+
210 //*****************************************************************************
+
211 //
+
220 //
+
221 //*****************************************************************************
+
222 extern void FlashCtl_lockInfoA(void);
+
223 
+
224 //*****************************************************************************
+
225 //
+
233 //
+
234 //*****************************************************************************
+
235 extern void FlashCtl_unlockInfoA(void);
+
236 
+
237 //*****************************************************************************
+
238 //
+
239 // Mark the end of the C bindings section for C++ compilers.
+
240 //
+
241 //*****************************************************************************
+
242 #ifdef __cplusplus
+
243 }
+
244 #endif
+
245 
+
246 #endif
+
247 #endif // __MSP430WARE_FLASHCTL_H__
+ +
+
+ + + + diff --git a/Documentation/html/globals.html b/Documentation/html/globals.html index 85803f7..b900b16 100644 --- a/Documentation/html/globals.html +++ b/Documentation/html/globals.html @@ -89,16 +89,52 @@ $(document).ready(function(){initNavTree('globals.html',''); initResizable(); })
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
diff --git a/Documentation/html/globals_defs.html b/Documentation/html/globals_defs.html new file mode 100644 index 0000000..9ccec3d --- /dev/null +++ b/Documentation/html/globals_defs.html @@ -0,0 +1,138 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Globals + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/Documentation/html/globals_func.html b/Documentation/html/globals_func.html index 095f42b..f668b3a 100644 --- a/Documentation/html/globals_func.html +++ b/Documentation/html/globals_func.html @@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('globals_func.html',''); initResizable( diff --git a/Documentation/html/gpio_8c.html b/Documentation/html/gpio_8c.html new file mode 100644 index 0000000..27292fb --- /dev/null +++ b/Documentation/html/gpio_8c.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/gpio.c File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gpio.c File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/gpio_8c_source.html b/Documentation/html/gpio_8c_source.html new file mode 100644 index 0000000..20003c5 --- /dev/null +++ b/Documentation/html/gpio_8c_source.html @@ -0,0 +1,554 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/gpio.c Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gpio.c
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // gpio.c - Driver for the gpio Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 //*****************************************************************************
+
8 //
+
11 //
+
12 //*****************************************************************************
+
13 
+
14 #include "inc/hw_memmap.h"
+
15 
+
16 #ifdef __MSP430_HAS_PORT1_R__
+
17 #include "gpio.h"
+
18 
+
19 #include <assert.h>
+
20 
+
21 static const uint16_t GPIO_PORT_TO_BASE[] = {
+
22  0x00,
+
23 #if defined(__MSP430_HAS_PORT1_R__)
+
24  __MSP430_BASEADDRESS_PORT1_R__,
+
25 #elif defined(__MSP430_HAS_PORT1__)
+
26  __MSP430_BASEADDRESS_PORT1__,
+
27 #else
+
28  0xFFFF,
+
29 #endif
+
30 #if defined(__MSP430_HAS_PORT2_R__)
+
31  __MSP430_BASEADDRESS_PORT2_R__,
+
32 #elif defined(__MSP430_HAS_PORT2__)
+
33  __MSP430_BASEADDRESS_PORT2__,
+
34 #else
+
35  0xFFFF,
+
36 #endif
+
37 #if defined(__MSP430_HAS_PORT3_R__)
+
38  __MSP430_BASEADDRESS_PORT3_R__,
+
39 #elif defined(__MSP430_HAS_PORT3__)
+
40  __MSP430_BASEADDRESS_PORT3__,
+
41 #else
+
42  0xFFFF,
+
43 #endif
+
44 #if defined(__MSP430_HAS_PORT4_R__)
+
45  __MSP430_BASEADDRESS_PORT4_R__,
+
46 #elif defined(__MSP430_HAS_PORT4__)
+
47  __MSP430_BASEADDRESS_PORT4__,
+
48 #else
+
49  0xFFFF,
+
50 #endif
+
51 #if defined(__MSP430_HAS_PORT5_R__)
+
52  __MSP430_BASEADDRESS_PORT5_R__,
+
53 #elif defined(__MSP430_HAS_PORT5__)
+
54  __MSP430_BASEADDRESS_PORT5__,
+
55 #else
+
56  0xFFFF,
+
57 #endif
+
58 #if defined(__MSP430_HAS_PORT6_R__)
+
59  __MSP430_BASEADDRESS_PORT6_R__,
+
60 #elif defined(__MSP430_HAS_PORT6__)
+
61  __MSP430_BASEADDRESS_PORT6__,
+
62 #else
+
63  0xFFFF,
+
64 #endif
+
65 #if defined(__MSP430_HAS_PORT7_R__)
+
66  __MSP430_BASEADDRESS_PORT7_R__,
+
67 #elif defined(__MSP430_HAS_PORT7__)
+
68  __MSP430_BASEADDRESS_PORT7__,
+
69 #else
+
70  0xFFFF,
+
71 #endif
+
72 #if defined(__MSP430_HAS_PORT8_R__)
+
73  __MSP430_BASEADDRESS_PORT8_R__,
+
74 #elif defined(__MSP430_HAS_PORT8__)
+
75  __MSP430_BASEADDRESS_PORT8__,
+
76 #else
+
77  0xFFFF,
+
78 #endif
+
79 #if defined(__MSP430_HAS_PORT9_R__)
+
80  __MSP430_BASEADDRESS_PORT9_R__,
+
81 #elif defined(__MSP430_HAS_PORT9__)
+
82  __MSP430_BASEADDRESS_PORT9__,
+
83 #else
+
84  0xFFFF,
+
85 #endif
+
86 #if defined(__MSP430_HAS_PORT10_R__)
+
87  __MSP430_BASEADDRESS_PORT10_R__,
+
88 #elif defined(__MSP430_HAS_PORT10__)
+
89  __MSP430_BASEADDRESS_PORT10__,
+
90 #else
+
91  0xFFFF,
+
92 #endif
+
93 #if defined(__MSP430_HAS_PORT11_R__)
+
94  __MSP430_BASEADDRESS_PORT11_R__,
+
95 #elif defined(__MSP430_HAS_PORT11__)
+
96  __MSP430_BASEADDRESS_PORT11__,
+
97 #else
+
98  0xFFFF,
+
99 #endif
+
100  0xFFFF,
+
101 #if defined(__MSP430_HAS_PORTJ_R__)
+
102  __MSP430_BASEADDRESS_PORTJ_R__
+
103 #elif defined(__MSP430_HAS_PORTJ__)
+
104  __MSP430_BASEADDRESS_PORTJ__
+
105 #else
+
106  0xFFFF
+
107 #endif
+
108 };
+
109 
+
110 void GPIO_setAsOutputPin(uint8_t selectedPort, uint16_t selectedPins) {
+
111 
+
112  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
113 
+
114  #ifndef NDEBUG
+
115  if(baseAddress == 0xFFFF) {
+
116  return;
+
117  }
+
118  #endif
+
119 
+
120  // Shift by 8 if port is even (upper 8-bits)
+
121  if((selectedPort & 1) ^ 1) {
+
122  selectedPins <<= 8;
+
123  }
+
124 
+
125  HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins;
+
126  HWREG16(baseAddress + OFS_PADIR) |= selectedPins;
+
127 
+
128  return;
+
129 }
+
130 
+
131 void GPIO_setAsInputPin(uint8_t selectedPort, uint16_t selectedPins) {
+
132 
+
133  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
134 
+
135  #ifndef NDEBUG
+
136  if(baseAddress == 0xFFFF) {
+
137  return;
+
138  }
+
139  #endif
+
140 
+
141  // Shift by 8 if port is even (upper 8-bits)
+
142  if((selectedPort & 1) ^ 1) {
+
143  selectedPins <<= 8;
+
144  }
+
145 
+
146  HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins;
+
147  HWREG16(baseAddress + OFS_PADIR) &= ~selectedPins;
+
148  HWREG16(baseAddress + OFS_PAREN) &= ~selectedPins;
+
149 }
+
150 
+
151 void GPIO_setAsPeripheralModuleFunctionOutputPin(uint8_t selectedPort,
+
152  uint16_t selectedPins
+
153 ) {
+
154 
+
155  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
156 
+
157  #ifndef NDEBUG
+
158  if(baseAddress == 0xFFFF) {
+
159  return;
+
160  }
+
161  #endif
+
162 
+
163  // Shift by 8 if port is even (upper 8-bits)
+
164  if((selectedPort & 1) ^ 1) {
+
165  selectedPins <<= 8;
+
166  }
+
167 
+
168  HWREG16(baseAddress + OFS_PADIR) |= selectedPins;
+
169  HWREG16(baseAddress + OFS_PASEL) |= selectedPins;
+
170 }
+
171 
+
172 void GPIO_setAsPeripheralModuleFunctionInputPin(uint8_t selectedPort,
+
173  uint16_t selectedPins
+
174 ) {
+
175  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
176 
+
177  #ifndef NDEBUG
+
178  if(baseAddress == 0xFFFF) {
+
179  return;
+
180  }
+
181  #endif
+
182 
+
183  // Shift by 8 if port is even (upper 8-bits)
+
184  if((selectedPort & 1) ^ 1) {
+
185  selectedPins <<= 8;
+
186  }
+
187 
+
188  HWREG16(baseAddress + OFS_PADIR) &= ~selectedPins;
+
189  HWREG16(baseAddress + OFS_PASEL) |= selectedPins;
+
190 }
+
191 
+
192 void GPIO_setOutputHighOnPin (uint8_t selectedPort,
+
193  uint16_t selectedPins) {
+
194 
+
195  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
196 
+
197  #ifndef NDEBUG
+
198  if(baseAddress == 0xFFFF) {
+
199  return;
+
200  }
+
201  #endif
+
202 
+
203  // Shift by 8 if port is even (upper 8-bits)
+
204  if((selectedPort & 1) ^ 1) {
+
205  selectedPins <<= 8;
+
206  }
+
207 
+
208  HWREG16(baseAddress + OFS_PAOUT) |= selectedPins;
+
209 }
+
210 
+
211 void GPIO_setOutputLowOnPin (uint8_t selectedPort, uint16_t selectedPins) {
+
212 
+
213  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
214 
+
215  #ifndef NDEBUG
+
216  if(baseAddress == 0xFFFF) {
+
217  return;
+
218  }
+
219  #endif
+
220 
+
221  // Shift by 8 if port is even (upper 8-bits)
+
222  if((selectedPort & 1) ^ 1) {
+
223  selectedPins <<= 8;
+
224  }
+
225 
+
226  HWREG16(baseAddress + OFS_PAOUT) &= ~selectedPins;
+
227 }
+
228 
+
229 void GPIO_toggleOutputOnPin (uint8_t selectedPort, uint16_t selectedPins) {
+
230 
+
231  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
232 
+
233  #ifndef NDEBUG
+
234  if(baseAddress == 0xFFFF) {
+
235  return;
+
236  }
+
237  #endif
+
238 
+
239  // Shift by 8 if port is even (upper 8-bits)
+
240  if((selectedPort & 1) ^ 1) {
+
241  selectedPins <<= 8;
+
242  }
+
243 
+
244  HWREG16(baseAddress + OFS_PAOUT) ^= selectedPins;
+
245 }
+
246 
+
247 void GPIO_setAsInputPinWithPullDownResistor(uint8_t selectedPort,
+
248  uint16_t selectedPins) {
+
249 
+
250  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
251 
+
252  #ifndef NDEBUG
+
253  if(baseAddress == 0xFFFF) {
+
254  return;
+
255  }
+
256  #endif
+
257 
+
258  // Shift by 8 if port is even (upper 8-bits)
+
259  if((selectedPort & 1) ^ 1) {
+
260  selectedPins <<= 8;
+
261  }
+
262 
+
263  HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins;
+
264 
+
265  HWREG16(baseAddress + OFS_PADIR) &= ~selectedPins;
+
266  HWREG16(baseAddress + OFS_PAREN) |= selectedPins;
+
267  HWREG16(baseAddress + OFS_PAOUT) &= ~selectedPins;
+
268 }
+
269 
+
270 void GPIO_setAsInputPinWithPullUpResistor(uint8_t selectedPort,
+
271  uint16_t selectedPins) {
+
272 
+
273  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
274 
+
275  #ifndef NDEBUG
+
276  if(baseAddress == 0xFFFF) {
+
277  return;
+
278  }
+
279  #endif
+
280 
+
281  // Shift by 8 if port is even (upper 8-bits)
+
282  if((selectedPort & 1) ^ 1) {
+
283  selectedPins <<= 8;
+
284  }
+
285 
+
286  HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins;
+
287  HWREG16(baseAddress + OFS_PADIR) &= ~selectedPins;
+
288  HWREG16(baseAddress + OFS_PAREN) |= selectedPins;
+
289  HWREG16(baseAddress + OFS_PAOUT) |= selectedPins;
+
290 }
+
291 
+
292 uint8_t GPIO_getInputPinValue(uint8_t selectedPort,
+
293  uint16_t selectedPins) {
+
294 
+
295  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
296 
+
297  #ifndef NDEBUG
+
298  if(baseAddress == 0xFFFF) {
+
299  return;
+
300  }
+
301  #endif
+
302 
+
303  // Shift by 8 if port is even (upper 8-bits)
+
304  if((selectedPort & 1) ^ 1) {
+
305  selectedPins <<= 8;
+
306  }
+
307 
+
308  uint16_t inputPinValue = HWREG16(baseAddress + OFS_PAIN) & (selectedPins);
+
309 
+
310  if(inputPinValue > 0){
+
311  return (GPIO_INPUT_PIN_HIGH);
+
312  }
+
313  return (GPIO_INPUT_PIN_LOW);
+
314 }
+
315 
+
316 void GPIO_enableInterrupt(uint8_t selectedPort, uint16_t selectedPins) {
+
317 
+
318  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
319 
+
320  #ifndef NDEBUG
+
321  if(baseAddress == 0xFFFF) {
+
322  return;
+
323  }
+
324  #endif
+
325 
+
326  // Shift by 8 if port is even (upper 8-bits)
+
327  if((selectedPort & 1) ^ 1) {
+
328  selectedPins <<= 8;
+
329  }
+
330 
+
331  HWREG16(baseAddress + OFS_PAIE) |= selectedPins;
+
332 }
+
333 
+
334 void GPIO_disableInterrupt(uint8_t selectedPort, uint16_t selectedPins) {
+
335 
+
336  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
337 
+
338  #ifndef NDEBUG
+
339  if(baseAddress == 0xFFFF) {
+
340  return;
+
341  }
+
342  #endif
+
343 
+
344  // Shift by 8 if port is even (upper 8-bits)
+
345  if((selectedPort & 1) ^ 1) {
+
346  selectedPins <<= 8;
+
347  }
+
348 
+
349  HWREG16(baseAddress + OFS_PAIE) &= ~selectedPins;
+
350 }
+
351 
+
352 uint16_t GPIO_getInterruptStatus(uint8_t selectedPort, uint16_t selectedPins) {
+
353 
+
354  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
355 
+
356  #ifndef NDEBUG
+
357  if(baseAddress == 0xFFFF) {
+
358  return;
+
359  }
+
360  #endif
+
361 
+
362  // Shift by 8 if port is even (upper 8-bits)
+
363  if((selectedPort & 1) ^ 1) {
+
364  if((baseAddress & 0x1) ^ 0x1)
+
365  {
+
366  return (HWREG8(baseAddress + OFS_PAIFG_H) & selectedPins);
+
367  }
+
368  else
+
369  {
+
370  return (HWREG8(baseAddress + OFS_PAIFG) & selectedPins);
+
371  }
+
372  }
+
373  else {
+
374  return (HWREG16(baseAddress + OFS_PAIFG) & selectedPins);
+
375  }
+
376 }
+
377 
+
378 void GPIO_clearInterrupt(uint8_t selectedPort, uint16_t selectedPins) {
+
379 
+
380  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
381 
+
382  #ifndef NDEBUG
+
383  if(baseAddress == 0xFFFF) {
+
384  return;
+
385  }
+
386  #endif
+
387 
+
388  // Shift by 8 if port is even (upper 8-bits)
+
389  if((selectedPort & 1) ^ 1) {
+
390  selectedPins <<= 8;
+
391  }
+
392 
+
393  HWREG16(baseAddress + OFS_PAIFG) &= ~selectedPins;
+
394 }
+
395 
+
396 void GPIO_selectInterruptEdge(uint8_t selectedPort, uint16_t selectedPins,
+
397  uint8_t edgeSelect) {
+
398 
+
399  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
400 
+
401  #ifndef NDEBUG
+
402  if(baseAddress == 0xFFFF) {
+
403  return;
+
404  }
+
405  #endif
+
406 
+
407  // Shift by 8 if port is even (upper 8-bits)
+
408  if((selectedPort & 1) ^ 1) {
+
409  selectedPins <<= 8;
+
410  }
+
411 
+
412  if (GPIO_LOW_TO_HIGH_TRANSITION == edgeSelect){
+
413  HWREG16(baseAddress + OFS_PAIES) &= ~selectedPins;
+
414  }
+
415  else {
+
416  HWREG16(baseAddress + OFS_PAIES) |= selectedPins;
+
417  }
+
418 }
+
419 
+
420 void GPIO_setDriveStrength(uint8_t selectedPort, uint16_t selectedPins,
+
421  uint8_t driveStrength) {
+
422 
+
423  uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];
+
424 
+
425  #ifndef NDEBUG
+
426  if(baseAddress == 0xFFFF) {
+
427  return;
+
428  }
+
429  #endif
+
430 
+
431  // Shift by 8 if port is even (upper 8-bits)
+
432  if((selectedPort & 1) ^ 1) {
+
433  selectedPins <<= 8;
+
434  }
+
435 
+
436  if(GPIO_REDUCED_OUTPUT_DRIVE_STRENGTH == driveStrength) {
+
437  HWREG16(baseAddress + OFS_PADS) &= ~selectedPins;
+
438  } else {
+
439  HWREG16(baseAddress + OFS_PADS) |= selectedPins;
+
440  }
+
441 }
+
442 
+
443 #endif
+
444 //*****************************************************************************
+
445 //
+
448 //
+
449 //*****************************************************************************
+ + +
#define HWREG8(x)
Definition: hw_memmap.h:41
+
#define HWREG16(x)
Definition: hw_memmap.h:39
+
+
+ + + + diff --git a/Documentation/html/gpio_8h.html b/Documentation/html/gpio_8h.html new file mode 100644 index 0000000..913a8a0 --- /dev/null +++ b/Documentation/html/gpio_8h.html @@ -0,0 +1,108 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/gpio.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gpio.h File Reference
+
+
+
#include "inc/hw_memmap.h"
+
+

Go to the source code of this file.

+
+
+ + + + diff --git a/Documentation/html/gpio_8h_source.html b/Documentation/html/gpio_8h_source.html new file mode 100644 index 0000000..83978d9 --- /dev/null +++ b/Documentation/html/gpio_8h_source.html @@ -0,0 +1,355 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/gpio.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gpio.h
+
+
+Go to the documentation of this file.
1 //*****************************************************************************
+
2 //
+
3 // gpio.h - Driver for the GPIO Module.
+
4 //
+
5 //*****************************************************************************
+
6 
+
7 #ifndef __MSP430WARE_GPIO_H__
+
8 #define __MSP430WARE_GPIO_H__
+
9 
+
10 #include "inc/hw_memmap.h"
+
11 
+
12 #ifdef __MSP430_HAS_PORT1_R__
+
13 
+
14 //*****************************************************************************
+
15 //
+
16 // If building with a C++ compiler, make all of the definitions in this header
+
17 // have a C binding.
+
18 //
+
19 //*****************************************************************************
+
20 #ifdef __cplusplus
+
21 extern "C"
+
22 {
+
23 #endif
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // The following are values that can be passed to the selectedPort parameter
+
28 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),
+
29 // GPIO_setAsPeripheralModuleFunctionOutputPin(),
+
30 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),
+
31 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),
+
32 // GPIO_setAsInputPinWithPullDownResistor(),
+
33 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),
+
34 // GPIO_selectInterruptEdge(), GPIO_setDriveStrength(), GPIO_enableInterrupt(),
+
35 // GPIO_disableInterrupt(), GPIO_getInterruptStatus(), and
+
36 // GPIO_clearInterrupt().
+
37 //
+
38 //*****************************************************************************
+
39 #define GPIO_PORT_P1 1
+
40 #define GPIO_PORT_P2 2
+
41 #define GPIO_PORT_P3 3
+
42 #define GPIO_PORT_P4 4
+
43 #define GPIO_PORT_P5 5
+
44 #define GPIO_PORT_P6 6
+
45 #define GPIO_PORT_P7 7
+
46 #define GPIO_PORT_P8 8
+
47 #define GPIO_PORT_P9 9
+
48 #define GPIO_PORT_P10 10
+
49 #define GPIO_PORT_P11 11
+
50 #define GPIO_PORT_PA 1
+
51 #define GPIO_PORT_PB 3
+
52 #define GPIO_PORT_PC 5
+
53 #define GPIO_PORT_PD 7
+
54 #define GPIO_PORT_PE 9
+
55 #define GPIO_PORT_PF 11
+
56 #define GPIO_PORT_PJ 13
+
57 
+
58 //*****************************************************************************
+
59 //
+
60 // The following are values that can be passed to the selectedPins parameter
+
61 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),
+
62 // GPIO_setAsPeripheralModuleFunctionOutputPin(),
+
63 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),
+
64 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),
+
65 // GPIO_setAsInputPinWithPullDownResistor(),
+
66 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),
+
67 // GPIO_enableInterrupt(), GPIO_disableInterrupt(), GPIO_getInterruptStatus(),
+
68 // GPIO_clearInterrupt(), GPIO_selectInterruptEdge(), and
+
69 // GPIO_setDriveStrength() as well as returned by the GPIO_getInterruptStatus()
+
70 // function.
+
71 //
+
72 //*****************************************************************************
+
73 #define GPIO_PIN0 (0x0001)
+
74 #define GPIO_PIN1 (0x0002)
+
75 #define GPIO_PIN2 (0x0004)
+
76 #define GPIO_PIN3 (0x0008)
+
77 #define GPIO_PIN4 (0x0010)
+
78 #define GPIO_PIN5 (0x0020)
+
79 #define GPIO_PIN6 (0x0040)
+
80 #define GPIO_PIN7 (0x0080)
+
81 #define GPIO_PIN8 (0x0100)
+
82 #define GPIO_PIN9 (0x0200)
+
83 #define GPIO_PIN10 (0x0400)
+
84 #define GPIO_PIN11 (0x0800)
+
85 #define GPIO_PIN12 (0x1000)
+
86 #define GPIO_PIN13 (0x2000)
+
87 #define GPIO_PIN14 (0x4000)
+
88 #define GPIO_PIN15 (0x8000)
+
89 #define GPIO_PIN_ALL8 (0xFF)
+
90 #define GPIO_PIN_ALL16 (0xFFFF)
+
91 
+
92 //*****************************************************************************
+
93 //
+
94 // The following are values that can be passed to the edgeSelect parameter for
+
95 // functions: GPIO_selectInterruptEdge().
+
96 //
+
97 //*****************************************************************************
+
98 #define GPIO_HIGH_TO_LOW_TRANSITION (0x01)
+
99 #define GPIO_LOW_TO_HIGH_TRANSITION (0x00)
+
100 
+
101 //*****************************************************************************
+
102 //
+
103 // The following are values that can be passed toThe following are values that
+
104 // can be returned by the GPIO_getInputPinValue() function.
+
105 //
+
106 //*****************************************************************************
+
107 #define GPIO_INPUT_PIN_HIGH (0x01)
+
108 #define GPIO_INPUT_PIN_LOW (0x00)
+
109 
+
110 //*****************************************************************************
+
111 //
+
112 // The following are values that can be passed to the driveStrength parameter
+
113 // for functions: GPIO_setDriveStrength().
+
114 //
+
115 //*****************************************************************************
+
116 #define GPIO_REDUCED_OUTPUT_DRIVE_STRENGTH 0x00
+
117 #define GPIO_FULL_OUTPUT_DRIVE_STRENGTH 0x01
+
118 
+
119 //*****************************************************************************
+
120 //
+
121 // Prototypes for the APIs.
+
122 //
+
123 //*****************************************************************************
+
124 
+
125 //*****************************************************************************
+
126 //
+
175 //
+
176 //*****************************************************************************
+
177 extern void GPIO_setAsOutputPin(uint8_t selectedPort,
+
178  uint16_t selectedPins);
+
179 
+
180 //*****************************************************************************
+
181 //
+
231 //
+
232 //*****************************************************************************
+
233 extern void GPIO_setAsInputPin(uint8_t selectedPort,
+
234  uint16_t selectedPins);
+
235 
+
236 //*****************************************************************************
+
237 //
+
290 //
+
291 //*****************************************************************************
+
292 extern void GPIO_setAsPeripheralModuleFunctionOutputPin(uint8_t selectedPort,
+
293  uint16_t selectedPins);
+
294 
+
295 //*****************************************************************************
+
296 //
+
349 //
+
350 //*****************************************************************************
+
351 extern void GPIO_setAsPeripheralModuleFunctionInputPin(uint8_t selectedPort,
+
352  uint16_t selectedPins);
+
353 
+
354 //*****************************************************************************
+
355 //
+
404 //
+
405 //*****************************************************************************
+
406 extern void GPIO_setOutputHighOnPin(uint8_t selectedPort,
+
407  uint16_t selectedPins);
+
408 
+
409 //*****************************************************************************
+
410 //
+
459 //
+
460 //*****************************************************************************
+
461 extern void GPIO_setOutputLowOnPin(uint8_t selectedPort,
+
462  uint16_t selectedPins);
+
463 
+
464 //*****************************************************************************
+
465 //
+
514 //
+
515 //*****************************************************************************
+
516 extern void GPIO_toggleOutputOnPin(uint8_t selectedPort,
+
517  uint16_t selectedPins);
+
518 
+
519 //*****************************************************************************
+
520 //
+
571 //
+
572 //*****************************************************************************
+
573 extern void GPIO_setAsInputPinWithPullDownResistor(uint8_t selectedPort,
+
574  uint16_t selectedPins);
+
575 
+
576 //*****************************************************************************
+
577 //
+
628 //
+
629 //*****************************************************************************
+
630 extern void GPIO_setAsInputPinWithPullUpResistor(uint8_t selectedPort,
+
631  uint16_t selectedPins);
+
632 
+
633 //*****************************************************************************
+
634 //
+
684 //
+
685 //*****************************************************************************
+
686 extern uint8_t GPIO_getInputPinValue(uint8_t selectedPort,
+
687  uint16_t selectedPins);
+
688 
+
689 //*****************************************************************************
+
690 //
+
740 //
+
741 //*****************************************************************************
+
742 extern void GPIO_enableInterrupt(uint8_t selectedPort,
+
743  uint16_t selectedPins);
+
744 
+
745 //*****************************************************************************
+
746 //
+
796 //
+
797 //*****************************************************************************
+
798 extern void GPIO_disableInterrupt(uint8_t selectedPort,
+
799  uint16_t selectedPins);
+
800 
+
801 //*****************************************************************************
+
802 //
+
870 //
+
871 //*****************************************************************************
+
872 extern uint16_t GPIO_getInterruptStatus(uint8_t selectedPort,
+
873  uint16_t selectedPins);
+
874 
+
875 //*****************************************************************************
+
876 //
+
926 //
+
927 //*****************************************************************************
+
928 extern void GPIO_clearInterrupt(uint8_t selectedPort,
+
929  uint16_t selectedPins);
+
930 
+
931 //*****************************************************************************
+
932 //
+
989 //
+
990 //*****************************************************************************
+
991 extern void GPIO_selectInterruptEdge(uint8_t selectedPort,
+
992  uint16_t selectedPins,
+
993  uint8_t edgeSelect);
+
994 
+
995 //*****************************************************************************
+
996 //
+
1051 //
+
1052 //*****************************************************************************
+
1053 extern void GPIO_setDriveStrength(uint8_t selectedPort,
+
1054  uint16_t selectedPins,
+
1055  uint8_t driveStrength);
+
1056 
+
1057 //*****************************************************************************
+
1058 //
+
1059 // Mark the end of the C bindings section for C++ compilers.
+
1060 //
+
1061 //*****************************************************************************
+
1062 #ifdef __cplusplus
+
1063 }
+
1064 #endif
+
1065 
+
1066 #endif
+
1067 #endif // __MSP430WARE_GPIO_H__
+ +
+
+ + + + diff --git a/Documentation/html/group__adc10__a__api.html b/Documentation/html/group__adc10__a__api.html new file mode 100644 index 0000000..af3acb7 --- /dev/null +++ b/Documentation/html/group__adc10__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: adc10_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc10_a
+
+
+
+
+ + + + diff --git a/Documentation/html/group__adc12__a__api.html b/Documentation/html/group__adc12__a__api.html new file mode 100644 index 0000000..824ac0b --- /dev/null +++ b/Documentation/html/group__adc12__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: adc12_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
adc12_a
+
+
+
+
+ + + + diff --git a/Documentation/html/group__aes__api.html b/Documentation/html/group__aes__api.html new file mode 100644 index 0000000..72a9351 --- /dev/null +++ b/Documentation/html/group__aes__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: aes + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
aes
+
+
+
+
+ + + + diff --git a/Documentation/html/group__battbak__api.html b/Documentation/html/group__battbak__api.html new file mode 100644 index 0000000..6c66c0e --- /dev/null +++ b/Documentation/html/group__battbak__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: battbak + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
battbak
+
+
+
+
+ + + + diff --git a/Documentation/html/group__comp__b__api.html b/Documentation/html/group__comp__b__api.html new file mode 100644 index 0000000..b653491 --- /dev/null +++ b/Documentation/html/group__comp__b__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: comp_b + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
comp_b
+
+
+
+
+ + + + diff --git a/Documentation/html/group__crc__api.html b/Documentation/html/group__crc__api.html new file mode 100644 index 0000000..275f140 --- /dev/null +++ b/Documentation/html/group__crc__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: crc + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
crc
+
+
+
+
+ + + + diff --git a/Documentation/html/group__ctsd16__api.html b/Documentation/html/group__ctsd16__api.html new file mode 100644 index 0000000..249827a --- /dev/null +++ b/Documentation/html/group__ctsd16__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: ctsd16 + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ctsd16
+
+
+
+
+ + + + diff --git a/Documentation/html/group__dac12__a__api.html b/Documentation/html/group__dac12__a__api.html new file mode 100644 index 0000000..441177d --- /dev/null +++ b/Documentation/html/group__dac12__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: dac12_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dac12_a
+
+
+
+
+ + + + diff --git a/Documentation/html/group__dma__api.html b/Documentation/html/group__dma__api.html new file mode 100644 index 0000000..82fada3 --- /dev/null +++ b/Documentation/html/group__dma__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: dma + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
dma
+
+
+
+
+ + + + diff --git a/Documentation/html/group__eusci__a__spi__api.html b/Documentation/html/group__eusci__a__spi__api.html new file mode 100644 index 0000000..ae05f62 --- /dev/null +++ b/Documentation/html/group__eusci__a__spi__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: eusci_a_spi + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_spi
+
+
+
+
+ + + + diff --git a/Documentation/html/group__eusci__a__uart__api.html b/Documentation/html/group__eusci__a__uart__api.html new file mode 100644 index 0000000..799670a --- /dev/null +++ b/Documentation/html/group__eusci__a__uart__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: eusci_a_uart + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_a_uart
+
+
+
+
+ + + + diff --git a/Documentation/html/group__eusci__b__i2c__api.html b/Documentation/html/group__eusci__b__i2c__api.html new file mode 100644 index 0000000..ed0a2dc --- /dev/null +++ b/Documentation/html/group__eusci__b__i2c__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: eusci_b_i2c + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_i2c
+
+
+
+
+ + + + diff --git a/Documentation/html/group__eusci__b__spi__api.html b/Documentation/html/group__eusci__b__spi__api.html new file mode 100644 index 0000000..c672645 --- /dev/null +++ b/Documentation/html/group__eusci__b__spi__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: eusci_b_spi + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
eusci_b_spi
+
+
+
+
+ + + + diff --git a/Documentation/html/group__flashctl__api.html b/Documentation/html/group__flashctl__api.html new file mode 100644 index 0000000..fb72769 --- /dev/null +++ b/Documentation/html/group__flashctl__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: flashctl + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
flashctl
+
+
+
+
+ + + + diff --git a/Documentation/html/group__gpio__api.html b/Documentation/html/group__gpio__api.html new file mode 100644 index 0000000..8c591f7 --- /dev/null +++ b/Documentation/html/group__gpio__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: gpio + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
gpio
+
+
+
+
+ + + + diff --git a/Documentation/html/group__lcd__b__api.html b/Documentation/html/group__lcd__b__api.html new file mode 100644 index 0000000..838abf7 --- /dev/null +++ b/Documentation/html/group__lcd__b__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: lcd_b + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
lcd_b
+
+
+
+
+ + + + diff --git a/Documentation/html/group__lcd__c__api.html b/Documentation/html/group__lcd__c__api.html new file mode 100644 index 0000000..7365998 --- /dev/null +++ b/Documentation/html/group__lcd__c__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: lcd_c + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
lcd_c
+
+
+
+
+ + + + diff --git a/Documentation/html/group__ldopwr__api.html b/Documentation/html/group__ldopwr__api.html new file mode 100644 index 0000000..f93c627 --- /dev/null +++ b/Documentation/html/group__ldopwr__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: ldopwr + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ldopwr
+
+
+
+
+ + + + diff --git a/Documentation/html/group__mpy32__api.html b/Documentation/html/group__mpy32__api.html new file mode 100644 index 0000000..b16da3b --- /dev/null +++ b/Documentation/html/group__mpy32__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: mpy32 + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
mpy32
+
+
+
+
+ + + + diff --git a/Documentation/html/group__oa__api.html b/Documentation/html/group__oa__api.html new file mode 100644 index 0000000..976833b --- /dev/null +++ b/Documentation/html/group__oa__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: oa + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
oa
+
+
+
+
+ + + + diff --git a/Documentation/html/group__pmap__api.html b/Documentation/html/group__pmap__api.html new file mode 100644 index 0000000..7d4072a --- /dev/null +++ b/Documentation/html/group__pmap__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: pmap + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
pmap
+
+
+
+
+ + + + diff --git a/Documentation/html/group__pmm__api.html b/Documentation/html/group__pmm__api.html new file mode 100644 index 0000000..06ae3e1 --- /dev/null +++ b/Documentation/html/group__pmm__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: pmm + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
pmm
+
+
+
+
+ + + + diff --git a/Documentation/html/group__ram__api.html b/Documentation/html/group__ram__api.html new file mode 100644 index 0000000..e975c47 --- /dev/null +++ b/Documentation/html/group__ram__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: ram + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ram
+
+
+
+
+ + + + diff --git a/Documentation/html/group__ref__api.html b/Documentation/html/group__ref__api.html new file mode 100644 index 0000000..67ffaf8 --- /dev/null +++ b/Documentation/html/group__ref__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: ref + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ref
+
+
+
+
+ + + + diff --git a/Documentation/html/group__rtc__a__api.html b/Documentation/html/group__rtc__a__api.html new file mode 100644 index 0000000..143e44d --- /dev/null +++ b/Documentation/html/group__rtc__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: rtc_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
rtc_a
+
+
+
+
+ + + + diff --git a/Documentation/html/group__rtc__b__api.html b/Documentation/html/group__rtc__b__api.html new file mode 100644 index 0000000..0b0c83d --- /dev/null +++ b/Documentation/html/group__rtc__b__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: rtc_b + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
rtc_b
+
+
+
+
+ + + + diff --git a/Documentation/html/group__rtc__c__api.html b/Documentation/html/group__rtc__c__api.html new file mode 100644 index 0000000..4aa8e0a --- /dev/null +++ b/Documentation/html/group__rtc__c__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: rtc_c + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
rtc_c
+
+
+
+
+ + + + diff --git a/Documentation/html/group__sd24__b__api.html b/Documentation/html/group__sd24__b__api.html new file mode 100644 index 0000000..eec03e0 --- /dev/null +++ b/Documentation/html/group__sd24__b__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: sd24_b + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
sd24_b
+
+
+
+
+ + + + diff --git a/Documentation/html/group__sfr__api.html b/Documentation/html/group__sfr__api.html new file mode 100644 index 0000000..84c2270 --- /dev/null +++ b/Documentation/html/group__sfr__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: sfr + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
sfr
+
+
+
+
+ + + + diff --git a/Documentation/html/group__sysctl__api.html b/Documentation/html/group__sysctl__api.html new file mode 100644 index 0000000..bcece1f --- /dev/null +++ b/Documentation/html/group__sysctl__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: sysctl + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
sysctl
+
+
+
+
+ + + + diff --git a/Documentation/html/group__tec__api.html b/Documentation/html/group__tec__api.html new file mode 100644 index 0000000..fd58fd1 --- /dev/null +++ b/Documentation/html/group__tec__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: tec + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
tec
+
+
+
+
+ + + + diff --git a/Documentation/html/group__timer__a__api.html b/Documentation/html/group__timer__a__api.html new file mode 100644 index 0000000..5c9a3a1 --- /dev/null +++ b/Documentation/html/group__timer__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: timer_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
timer_a
+
+
+
+
+ + + + diff --git a/Documentation/html/group__timer__b__api.html b/Documentation/html/group__timer__b__api.html new file mode 100644 index 0000000..4cb5506 --- /dev/null +++ b/Documentation/html/group__timer__b__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: timer_b + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
timer_b
+
+
+
+
+ + + + diff --git a/Documentation/html/group__timer__d__api.html b/Documentation/html/group__timer__d__api.html new file mode 100644 index 0000000..d0bfd8a --- /dev/null +++ b/Documentation/html/group__timer__d__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: timer_d + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
timer_d
+
+
+
+
+ + + + diff --git a/Documentation/html/group__tlv__api.html b/Documentation/html/group__tlv__api.html new file mode 100644 index 0000000..3138b92 --- /dev/null +++ b/Documentation/html/group__tlv__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: tlv + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
tlv
+
+
+
+
+ + + + diff --git a/Documentation/html/group__ucs__api.html b/Documentation/html/group__ucs__api.html new file mode 100644 index 0000000..7161819 --- /dev/null +++ b/Documentation/html/group__ucs__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: ucs + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ucs
+
+
+
+
+ + + + diff --git a/Documentation/html/group__usci__a__spi__api.html b/Documentation/html/group__usci__a__spi__api.html new file mode 100644 index 0000000..8b52aa5 --- /dev/null +++ b/Documentation/html/group__usci__a__spi__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: usci_a_spi + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
usci_a_spi
+
+
+
+
+ + + + diff --git a/Documentation/html/group__usci__a__uart__api.html b/Documentation/html/group__usci__a__uart__api.html new file mode 100644 index 0000000..016b078 --- /dev/null +++ b/Documentation/html/group__usci__a__uart__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: usci_a_uart + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
usci_a_uart
+
+
+
+
+ + + + diff --git a/Documentation/html/group__usci__b__i2c__api.html b/Documentation/html/group__usci__b__i2c__api.html new file mode 100644 index 0000000..4ba8919 --- /dev/null +++ b/Documentation/html/group__usci__b__i2c__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: usci_b_i2c + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
usci_b_i2c
+
+
+
+
+ + + + diff --git a/Documentation/html/group__usci__b__spi__api.html b/Documentation/html/group__usci__b__spi__api.html new file mode 100644 index 0000000..3dc8fb9 --- /dev/null +++ b/Documentation/html/group__usci__b__spi__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: usci_b_spi + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
usci_b_spi
+
+
+
+
+ + + + diff --git a/Documentation/html/group__wdt__a__api.html b/Documentation/html/group__wdt__a__api.html new file mode 100644 index 0000000..84578ba --- /dev/null +++ b/Documentation/html/group__wdt__a__api.html @@ -0,0 +1,104 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: wdt_a + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
wdt_a
+
+
+
+
+ + + + diff --git a/Documentation/html/hardware.html b/Documentation/html/hardware.html index 57f4396..712c85d 100644 --- a/Documentation/html/hardware.html +++ b/Documentation/html/hardware.html @@ -118,7 +118,7 @@ Design Reminders diff --git a/Documentation/html/hardware.js b/Documentation/html/hardware.js index 409ea2b..87b094b 100644 --- a/Documentation/html/hardware.js +++ b/Documentation/html/hardware.js @@ -3,7 +3,7 @@ var hardware = [ "Design Reminders", "hardware.html#autotoc_md1", null ], [ "Design Choices", "design_choices.html", [ [ "JTAG Interface", "design_choices.html#autotoc_md2", null ], - [ "Microcontroller Peripheral Connections", "design_choices.html#autotoc_md3", null ] + [ "Microcontroller Connections", "design_choices.html#autotoc_md3", null ] ] ], [ "Device Specifications", "device_specifications.html", null ] ]; \ No newline at end of file diff --git a/Documentation/html/hw__memmap_8h.html b/Documentation/html/hw__memmap_8h.html new file mode 100644 index 0000000..bedf859 --- /dev/null +++ b/Documentation/html/hw__memmap_8h.html @@ -0,0 +1,256 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/inc/hw_memmap.h File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
hw_memmap.h File Reference
+
+
+
#include <msp430.h>
+#include "msp430f5xx_6xxgeneric.h"
+#include "stdint.h"
+#include "stdbool.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + +

+Macros

#define __DRIVERLIB_MSP430F5XX_6XX_FAMILY__
 
#define STATUS_SUCCESS   0x01
 
#define STATUS_FAIL   0x00
 
#define NDEBUG
 
#define HWREG32(x)    (*((volatile uint32_t *)((uint16_t)x)))
 
#define HWREG16(x)    (*((volatile uint16_t *)((uint16_t)x)))
 
#define HWREG8(x)    (*((volatile uint8_t *)((uint16_t)x)))
 
+

Macro Definition Documentation

+ +

◆ __DRIVERLIB_MSP430F5XX_6XX_FAMILY__

+ +
+
+ + + + +
#define __DRIVERLIB_MSP430F5XX_6XX_FAMILY__
+
+ +

Definition at line 4 of file hw_memmap.h.

+ +
+
+ +

◆ HWREG16

+ +
+
+ + + + + + + + +
#define HWREG16( x)    (*((volatile uint16_t *)((uint16_t)x)))
+
+ +

Definition at line 39 of file hw_memmap.h.

+ +
+
+ +

◆ HWREG32

+ +
+
+ + + + + + + + +
#define HWREG32( x)    (*((volatile uint32_t *)((uint16_t)x)))
+
+ +

Definition at line 37 of file hw_memmap.h.

+ +
+
+ +

◆ HWREG8

+ +
+
+ + + + + + + + +
#define HWREG8( x)    (*((volatile uint8_t *)((uint16_t)x)))
+
+ +

Definition at line 41 of file hw_memmap.h.

+ +
+
+ +

◆ NDEBUG

+ +
+
+ + + + +
#define NDEBUG
+
+ +

Definition at line 30 of file hw_memmap.h.

+ +
+
+ +

◆ STATUS_FAIL

+ +
+
+ + + + +
#define STATUS_FAIL   0x00
+
+ +

Definition at line 23 of file hw_memmap.h.

+ +
+
+ +

◆ STATUS_SUCCESS

+ +
+
+ + + + +
#define STATUS_SUCCESS   0x01
+
+ +

Definition at line 22 of file hw_memmap.h.

+ +
+
+
+
+ + + + diff --git a/Documentation/html/hw__memmap_8h.js b/Documentation/html/hw__memmap_8h.js new file mode 100644 index 0000000..fdcc043 --- /dev/null +++ b/Documentation/html/hw__memmap_8h.js @@ -0,0 +1,10 @@ +var hw__memmap_8h = +[ + [ "__DRIVERLIB_MSP430F5XX_6XX_FAMILY__", "hw__memmap_8h.html#a97af2b5e31182f676ac18b271c0edebf", null ], + [ "HWREG16", "hw__memmap_8h.html#a7bb830016238e9f911612eddc5e58143", null ], + [ "HWREG32", "hw__memmap_8h.html#a005bc3d0bebdd1031a77f1fba8947998", null ], + [ "HWREG8", "hw__memmap_8h.html#a437bba8c6aaa7542f8d7522146157b42", null ], + [ "NDEBUG", "hw__memmap_8h.html#a8de3ed741dadc9c979a4ff17c0a9116e", null ], + [ "STATUS_FAIL", "hw__memmap_8h.html#a9024ed05f7df784637ef7b44ca8caf97", null ], + [ "STATUS_SUCCESS", "hw__memmap_8h.html#ae56fdb340b23940f7a64ed2e37c1774a", null ] +]; \ No newline at end of file diff --git a/Documentation/html/hw__memmap_8h_source.html b/Documentation/html/hw__memmap_8h_source.html new file mode 100644 index 0000000..286e597 --- /dev/null +++ b/Documentation/html/hw__memmap_8h_source.html @@ -0,0 +1,150 @@ + + + + + + + +2020-2021 Sunseeker Telemetry and Lighting System: Software/Code Composer Studio Workspace/SunseekerTelemetryAndLightingSystem/Libraries/driverlib/MSP430F5xx_6xx/inc/hw_memmap.h Source File + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
2020-2021 Sunseeker Telemetry and Lighting System +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
hw_memmap.h
+
+
+Go to the documentation of this file.
1 #ifndef __HW_MEMMAP__
+
2 #define __HW_MEMMAP__
+
3 
+
4 #define __DRIVERLIB_MSP430F5XX_6XX_FAMILY__
+
5 //*****************************************************************************
+
6 //
+
7 // Include device specific header file
+
8 //
+
9 //*****************************************************************************
+
10 #include <msp430.h>
+
11 
+
12 #include "msp430f5xx_6xxgeneric.h"
+
13 
+
14 #include "stdint.h"
+
15 #include "stdbool.h"
+
16 
+
17 //*****************************************************************************
+
18 //
+
19 // SUCCESS and FAILURE for API return value
+
20 //
+
21 //*****************************************************************************
+
22 #define STATUS_SUCCESS 0x01
+
23 #define STATUS_FAIL 0x00
+
24 
+
25 //*****************************************************************************
+
26 //
+
27 // Macro for enabling assert statements for debugging
+
28 //
+
29 //*****************************************************************************
+
30 #define NDEBUG
+
31 
+
32 //*****************************************************************************
+
33 //
+
34 // Macros for hardware access
+
35 //
+
36 //*****************************************************************************
+
37 #define HWREG32(x) \
+
38  (*((volatile uint32_t *)((uint16_t)x)))
+
39 #define HWREG16(x) \
+
40  (*((volatile uint16_t *)((uint16_t)x)))
+
41 #define HWREG8(x) \
+
42  (*((volatile uint8_t *)((uint16_t)x)))
+
43 
+
44 
+
45 #endif // #ifndef __HW_MEMMAP__
+
+
+ + + + diff --git a/Documentation/html/index.html b/Documentation/html/index.html index 27af132..6469684 100644 --- a/Documentation/html/index.html +++ b/Documentation/html/index.html @@ -92,14 +92,14 @@ $(document).ready(function(){initNavTree('index.html',''); initResizable(); });
Home
-

+

About

What this project is about (TODO)

-

+

Documentation

For Documentation, we will use "doxygen" to easily create documentation pages for the project. This will be accessible in a variety of means, but primarily through HTML pages accessible through a browser, covering all aspects of the project.

More information here: Documentation Guide

-

+

Tips from Dr. Bazuin

  • Make sub-circuits/sub-designs for schematics to keep things organized and modular/copy-able
  • @@ -119,14 +119,14 @@ Tips from Dr. Bazuin

  • Make peripherals like output on one side and inputs on the other
  • Use SPI Chip Select as a separate command (Use 3-pin SPI and then just use GPIO for Chip Select)
  • -

    +

    Tips from Dr. Gomez

    -

    +

    TODO List