MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.91.13.01
eusci_b_spi.h
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 //
28 //! \brief Used in the EUSCI_B_SPI_initMaster() function as the param
29 //! parameter.
30 //
31 //*****************************************************************************
33  //! Selects Clock source. Refer to device specific datasheet for available
34  //! options.
35  //! \n Valid values are:
36  //! - \b EUSCI_B_SPI_CLOCKSOURCE_UCLK
37  //! - \b EUSCI_B_SPI_CLOCKSOURCE_ACLK
38  //! - \b EUSCI_B_SPI_CLOCKSOURCE_MODCLK
39  //! - \b EUSCI_B_SPI_CLOCKSOURCE_SMCLK
41  //! Is the frequency of the selected clock source in Hz
43  //! Is the desired clock rate in Hz for SPI communication
44  uint32_t desiredSpiClock;
45  //! Controls the direction of the receive and transmit shift register.
46  //! \n Valid values are:
47  //! - \b EUSCI_B_SPI_MSB_FIRST
48  //! - \b EUSCI_B_SPI_LSB_FIRST [Default]
49  uint16_t msbFirst;
50  //! Is clock phase select.
51  //! \n Valid values are:
52  //! - \b EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT [Default]
53  //! - \b EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT
54  uint16_t clockPhase;
55  //! Is clock polarity select
56  //! \n Valid values are:
57  //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
58  //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW [Default]
59  uint16_t clockPolarity;
60  //! Is SPI mode select
61  //! \n Valid values are:
62  //! - \b EUSCI_B_SPI_3PIN
63  //! - \b EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH
64  //! - \b EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW
65  uint16_t spiMode;
67 
68 //*****************************************************************************
69 //
70 //! \brief Used in the EUSCI_B_SPI_initSlave() function as the param parameter.
71 //
72 //*****************************************************************************
74  //! Controls the direction of the receive and transmit shift register.
75  //! \n Valid values are:
76  //! - \b EUSCI_B_SPI_MSB_FIRST
77  //! - \b EUSCI_B_SPI_LSB_FIRST [Default]
78  uint16_t msbFirst;
79  //! Is clock phase select.
80  //! \n Valid values are:
81  //! - \b EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT [Default]
82  //! - \b EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT
83  uint16_t clockPhase;
84  //! Is clock polarity select
85  //! \n Valid values are:
86  //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
87  //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW [Default]
88  uint16_t clockPolarity;
89  //! Is SPI mode select
90  //! \n Valid values are:
91  //! - \b EUSCI_B_SPI_3PIN
92  //! - \b EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH
93  //! - \b EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW
94  uint16_t spiMode;
96 
97 //*****************************************************************************
98 //
99 //! \brief Used in the EUSCI_B_SPI_changeMasterClock() function as the param
100 //! parameter.
101 //
102 //*****************************************************************************
104  //! Is the frequency of the selected clock source in Hz
106  //! Is the desired clock rate in Hz for SPI communication
107  uint32_t desiredSpiClock;
109 
110 
111 //*****************************************************************************
112 //
113 // The following are values that can be passed to the clockPhase parameter for
114 // functions: EUSCI_B_SPI_changeClockPhasePolarity(); the param parameter for
115 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
116 //
117 //*****************************************************************************
118 #define EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00
119 #define EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT UCCKPH
120 
121 //*****************************************************************************
122 //
123 // The following are values that can be passed to the param parameter for
124 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
125 //
126 //*****************************************************************************
127 #define EUSCI_B_SPI_MSB_FIRST UCMSB
128 #define EUSCI_B_SPI_LSB_FIRST 0x00
129 
130 //*****************************************************************************
131 //
132 // The following are values that can be passed to the param parameter for
133 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave(); the
134 // clockPolarity parameter for functions:
135 // EUSCI_B_SPI_changeClockPhasePolarity().
136 //
137 //*****************************************************************************
138 #define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH UCCKPL
139 #define EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW 0x00
140 
141 //*****************************************************************************
142 //
143 // The following are values that can be passed to the param parameter for
144 // functions: EUSCI_B_SPI_initMaster().
145 //
146 //*****************************************************************************
147 #define EUSCI_B_SPI_CLOCKSOURCE_UCLK UCSSEL__UCLK
148 #define EUSCI_B_SPI_CLOCKSOURCE_ACLK 0x40
149 #define EUSCI_B_SPI_CLOCKSOURCE_MODCLK 0x40
150 #define EUSCI_B_SPI_CLOCKSOURCE_SMCLK UCSSEL__SMCLK
151 
152 //*****************************************************************************
153 //
154 // The following are values that can be passed to the param parameter for
155 // functions: EUSCI_B_SPI_initMaster(), and EUSCI_B_SPI_initSlave().
156 //
157 //*****************************************************************************
158 #define EUSCI_B_SPI_3PIN UCMODE_0
159 #define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH UCMODE_1
160 #define EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW UCMODE_2
161 
162 //*****************************************************************************
163 //
164 // The following are values that can be passed to the select4PinFunctionality
165 // parameter for functions: EUSCI_B_SPI_select4PinFunctionality().
166 //
167 //*****************************************************************************
168 #define EUSCI_B_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x0000
169 #define EUSCI_B_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE UCSTEM
170 
171 //*****************************************************************************
172 //
173 // The following are values that can be passed to the mask parameter for
174 // functions: EUSCI_B_SPI_enableInterrupt(), EUSCI_B_SPI_disableInterrupt(),
175 // EUSCI_B_SPI_getInterruptStatus(), and EUSCI_B_SPI_clearInterrupt() as well
176 // as returned by the EUSCI_B_SPI_getInterruptStatus() function.
177 //
178 //*****************************************************************************
179 #define EUSCI_B_SPI_TRANSMIT_INTERRUPT UCTXIE
180 #define EUSCI_B_SPI_RECEIVE_INTERRUPT UCRXIE
181 
182 //*****************************************************************************
183 //
184 // The following are values that can be passed toThe following are values that
185 // can be returned by the EUSCI_B_SPI_isBusy() function.
186 //
187 //*****************************************************************************
188 #define EUSCI_B_SPI_BUSY UCBUSY
189 #define EUSCI_B_SPI_NOT_BUSY 0x00
190 
191 //*****************************************************************************
192 //
193 // The following are values that can be passed to the pinsSelect parameter for
194 // functions: EUSCI_B_SPI_remapPins().
195 //
196 //*****************************************************************************
197 #define EUSCI_B_SPI_REMAP_PINS_FALSE (0x0000)
198 #define EUSCI_B_SPI_REMAP_PINS_TRUE (0x0001)
199 
200 //*****************************************************************************
201 //
202 // Prototypes for the APIs.
203 //
204 //*****************************************************************************
205 
206 //*****************************************************************************
207 //
208 //! \brief Initializes the SPI Master block.
209 //!
210 //! Upon successful initialization of the SPI master block, this function will
211 //! have set the bus speed for the master, but the SPI Master block still
212 //! remains disabled and must be enabled with EUSCI_B_SPI_enable()
213 //!
214 //! \param baseAddress is the base address of the EUSCI_B_SPI Master module.
215 //! \param param is the pointer to struct for master initialization.
216 //!
217 //! Modified bits are \b UCCKPH, \b UCCKPL, \b UC7BIT, \b UCMSB, \b UCSSELx and
218 //! \b UCSWRST of \b UCAxCTLW0 register.
219 //!
220 //! \return STATUS_SUCCESS
221 //
222 //*****************************************************************************
223 extern void EUSCI_B_SPI_initMaster(uint16_t baseAddress,
225 
226 //*****************************************************************************
227 //
228 //! \brief Selects 4Pin Functionality
229 //!
230 //! This function should be invoked only in 4-wire mode. Invoking this function
231 //! has no effect in 3-wire mode.
232 //!
233 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
234 //! \param select4PinFunctionality selects 4 pin functionality
235 //! Valid values are:
236 //! - \b EUSCI_B_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS
237 //! - \b EUSCI_B_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE
238 //!
239 //! Modified bits are \b UCSTEM of \b UCAxCTLW0 register.
240 //!
241 //! \return None
242 //
243 //*****************************************************************************
244 extern void EUSCI_B_SPI_select4PinFunctionality(uint16_t baseAddress,
245  uint16_t select4PinFunctionality);
246 
247 //*****************************************************************************
248 //
249 //! \brief Initializes the SPI Master clock. At the end of this function call,
250 //! SPI module is left enabled.
251 //!
252 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
253 //! \param param is the pointer to struct for master clock setting.
254 //!
255 //! Modified bits are \b UCSWRST of \b UCAxCTLW0 register.
256 //!
257 //! \return None
258 //
259 //*****************************************************************************
260 extern void EUSCI_B_SPI_changeMasterClock(uint16_t baseAddress,
262 
263 //*****************************************************************************
264 //
265 //! \brief Initializes the SPI Slave block.
266 //!
267 //! Upon successful initialization of the SPI slave block, this function will
268 //! have initialized the slave block, but the SPI Slave block still remains
269 //! disabled and must be enabled with EUSCI_B_SPI_enable()
270 //!
271 //! \param baseAddress is the base address of the EUSCI_B_SPI Slave module.
272 //! \param param is the pointer to struct for slave initialization.
273 //!
274 //! Modified bits are \b UCMSB, \b UCMST, \b UC7BIT, \b UCCKPL, \b UCCKPH, \b
275 //! UCMODE and \b UCSWRST of \b UCAxCTLW0 register.
276 //!
277 //! \return STATUS_SUCCESS
278 //
279 //*****************************************************************************
280 extern void EUSCI_B_SPI_initSlave(uint16_t baseAddress,
282 
283 //*****************************************************************************
284 //
285 //! \brief Changes the SPI clock phase and polarity. At the end of this
286 //! function call, SPI module is left enabled.
287 //!
288 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
289 //! \param clockPhase is clock phase select.
290 //! Valid values are:
291 //! - \b EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT
292 //! [Default]
293 //! - \b EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT
294 //! \param clockPolarity is clock polarity select
295 //! Valid values are:
296 //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
297 //! - \b EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW [Default]
298 //!
299 //! Modified bits are \b UCCKPL, \b UCCKPH and \b UCSWRST of \b UCAxCTLW0
300 //! register.
301 //!
302 //! \return None
303 //
304 //*****************************************************************************
305 extern void EUSCI_B_SPI_changeClockPhasePolarity(uint16_t baseAddress,
306  uint16_t clockPhase,
307  uint16_t clockPolarity);
308 
309 //*****************************************************************************
310 //
311 //! \brief Transmits a byte from the SPI Module.
312 //!
313 //! This function will place the supplied data into SPI transmit data register
314 //! to start transmission.
315 //!
316 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
317 //! \param transmitData data to be transmitted from the SPI module
318 //!
319 //! \return None
320 //
321 //*****************************************************************************
322 extern void EUSCI_B_SPI_transmitData(uint16_t baseAddress,
323  uint8_t transmitData);
324 
325 //*****************************************************************************
326 //
327 //! \brief Receives a byte that has been sent to the SPI Module.
328 //!
329 //! This function reads a byte of data from the SPI receive data Register.
330 //!
331 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
332 //!
333 //! \return Returns the byte received from by the SPI module, cast as an
334 //! uint8_t.
335 //
336 //*****************************************************************************
337 extern uint8_t EUSCI_B_SPI_receiveData(uint16_t baseAddress);
338 
339 //*****************************************************************************
340 //
341 //! \brief Enables individual SPI interrupt sources.
342 //!
343 //! Enables the indicated SPI interrupt sources. Only the sources that are
344 //! enabled can be reflected to the processor interrupt; disabled sources have
345 //! no effect on the processor. Does not clear interrupt flags.
346 //!
347 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
348 //! \param mask is the bit mask of the interrupt sources to be enabled.
349 //! Mask value is the logical OR of any of the following:
350 //! - \b EUSCI_B_SPI_TRANSMIT_INTERRUPT
351 //! - \b EUSCI_B_SPI_RECEIVE_INTERRUPT
352 //!
353 //! Modified bits of \b UCAxIFG register and bits of \b UCAxIE register.
354 //!
355 //! \return None
356 //
357 //*****************************************************************************
358 extern void EUSCI_B_SPI_enableInterrupt(uint16_t baseAddress,
359  uint16_t mask);
360 
361 //*****************************************************************************
362 //
363 //! \brief Disables individual SPI interrupt sources.
364 //!
365 //! Disables the indicated SPI interrupt sources. Only the sources that are
366 //! enabled can be reflected to the processor interrupt; disabled sources have
367 //! no effect on the processor.
368 //!
369 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
370 //! \param mask is the bit mask of the interrupt sources to be disabled.
371 //! Mask value is the logical OR of any of the following:
372 //! - \b EUSCI_B_SPI_TRANSMIT_INTERRUPT
373 //! - \b EUSCI_B_SPI_RECEIVE_INTERRUPT
374 //!
375 //! Modified bits of \b UCAxIE register.
376 //!
377 //! \return None
378 //
379 //*****************************************************************************
380 extern void EUSCI_B_SPI_disableInterrupt(uint16_t baseAddress,
381  uint16_t mask);
382 
383 //*****************************************************************************
384 //
385 //! \brief Gets the current SPI interrupt status.
386 //!
387 //! This returns the interrupt status for the SPI module based on which flag is
388 //! passed.
389 //!
390 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
391 //! \param mask is the masked interrupt flag status to be returned.
392 //! Mask value is the logical OR of any of the following:
393 //! - \b EUSCI_B_SPI_TRANSMIT_INTERRUPT
394 //! - \b EUSCI_B_SPI_RECEIVE_INTERRUPT
395 //!
396 //! \return Logical OR of any of the following:
397 //! - \b EUSCI_B_SPI_TRANSMIT_INTERRUPT
398 //! - \b EUSCI_B_SPI_RECEIVE_INTERRUPT
399 //! \n indicating the status of the masked interrupts
400 //
401 //*****************************************************************************
402 extern uint8_t EUSCI_B_SPI_getInterruptStatus(uint16_t baseAddress,
403  uint8_t mask);
404 
405 //*****************************************************************************
406 //
407 //! \brief Clears the selected SPI interrupt status flag.
408 //!
409 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
410 //! \param mask is the masked interrupt flag to be cleared.
411 //! Mask value is the logical OR of any of the following:
412 //! - \b EUSCI_B_SPI_TRANSMIT_INTERRUPT
413 //! - \b EUSCI_B_SPI_RECEIVE_INTERRUPT
414 //!
415 //! Modified bits of \b UCAxIFG register.
416 //!
417 //! \return None
418 //
419 //*****************************************************************************
420 extern void EUSCI_B_SPI_clearInterrupt(uint16_t baseAddress,
421  uint16_t mask);
422 
423 //*****************************************************************************
424 //
425 //! \brief Enables the SPI block.
426 //!
427 //! This will enable operation of the SPI block.
428 //!
429 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
430 //!
431 //! Modified bits are \b UCSWRST of \b UCAxCTLW0 register.
432 //!
433 //! \return None
434 //
435 //*****************************************************************************
436 extern void EUSCI_B_SPI_enable(uint16_t baseAddress);
437 
438 //*****************************************************************************
439 //
440 //! \brief Disables the SPI block.
441 //!
442 //! This will disable operation of the SPI block.
443 //!
444 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
445 //!
446 //! Modified bits are \b UCSWRST of \b UCAxCTLW0 register.
447 //!
448 //! \return None
449 //
450 //*****************************************************************************
451 extern void EUSCI_B_SPI_disable(uint16_t baseAddress);
452 
453 //*****************************************************************************
454 //
455 //! \brief Returns the address of the RX Buffer of the SPI for the DMA module.
456 //!
457 //! Returns the address of the SPI RX Buffer. This can be used in conjunction
458 //! with the DMA to store the received data directly to memory.
459 //!
460 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
461 //!
462 //! \return the address of the RX Buffer
463 //
464 //*****************************************************************************
465 extern uint32_t EUSCI_B_SPI_getReceiveBufferAddress(uint16_t baseAddress);
466 
467 //*****************************************************************************
468 //
469 //! \brief Returns the address of the TX Buffer of the SPI for the DMA module.
470 //!
471 //! Returns the address of the SPI TX Buffer. This can be used in conjunction
472 //! with the DMA to obtain transmitted data directly from memory.
473 //!
474 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
475 //!
476 //! \return the address of the TX Buffer
477 //
478 //*****************************************************************************
479 extern uint32_t EUSCI_B_SPI_getTransmitBufferAddress(uint16_t baseAddress);
480 
481 //*****************************************************************************
482 //
483 //! \brief Indicates whether or not the SPI bus is busy.
484 //!
485 //! This function returns an indication of whether or not the SPI bus is
486 //! busy.This function checks the status of the bus via UCBBUSY bit
487 //!
488 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
489 //!
490 //! \return One of the following:
491 //! - \b EUSCI_B_SPI_BUSY
492 //! - \b EUSCI_B_SPI_NOT_BUSY
493 //! \n indicating if the EUSCI_B_SPI is busy
494 //
495 //*****************************************************************************
496 extern uint16_t EUSCI_B_SPI_isBusy(uint16_t baseAddress);
497 
498 //*****************************************************************************
499 //
500 //! \brief Remaps eUSCI_B GPIO pins.
501 //!
502 //! Remaps eUSCI_B GPIO pins. After calling this function,
503 //! GPIO_setAsPeripheralModuleFunctionInputPin() or
504 //! GPIO_setAsPeripheralModuleFunctionInputPin() still needs to be invoked to
505 //! set peripheral functions. Caution: this will also remap eusci_b_i2c GPIO
506 //! pins.
507 //!
508 //! \param baseAddress is the base address of the EUSCI_B_SPI module.
509 //! \param pinsSelect remapping pins to select. Please refer to device specific
510 //! datasheet for remapping pins details.
511 //! Valid values are:
512 //! - \b EUSCI_B_SPI_REMAP_PINS_FALSE [Default]
513 //! - \b EUSCI_B_SPI_REMAP_PINS_TRUE
514 //!
515 //! \return None
516 //
517 //*****************************************************************************
518 extern void EUSCI_B_SPI_remapPins(uint16_t baseAddress,
519  uint8_t pinsSelect);
520 
521 //*****************************************************************************
522 //
523 // The following are deprecated #defines.
524 //
525 //*****************************************************************************
526 #define EUSCI_B_SPI_REMAP_PINS_1 EUSCI_B_SPI_REMAP_PINS_FALSE
527 #define EUSCI_B_SPI_REMAP_PINS_2 EUSCI_B_SPI_REMAP_PINS_TRUE
528 
529 //*****************************************************************************
530 //
531 // Mark the end of the C bindings section for C++ compilers.
532 //
533 //*****************************************************************************
534 #ifdef __cplusplus
535 }
536 #endif
537 
538 #endif
539 #endif // __MSP430WARE_EUSCI_B_SPI_H__
uint16_t spiMode
Definition: eusci_b_spi.h:94
void EUSCI_B_SPI_disable(uint16_t baseAddress)
Disables the SPI block.
Definition: eusci_b_spi.c:166
uint16_t msbFirst
Definition: eusci_b_spi.h:78
void EUSCI_B_SPI_disableInterrupt(uint16_t baseAddress, uint16_t mask)
Disables individual SPI interrupt sources.
Definition: eusci_b_spi.c:139
void EUSCI_B_SPI_select4PinFunctionality(uint16_t baseAddress, uint16_t select4PinFunctionality)
Selects 4Pin Functionality.
Definition: eusci_b_spi.c:57
void EUSCI_B_SPI_enable(uint16_t baseAddress)
Enables the SPI block.
Definition: eusci_b_spi.c:160
uint8_t EUSCI_B_SPI_receiveData(uint16_t baseAddress)
Receives a byte that has been sent to the SPI Module.
Definition: eusci_b_spi.c:127
void EUSCI_B_SPI_clearInterrupt(uint16_t baseAddress, uint16_t mask)
Clears the selected SPI interrupt status flag.
Definition: eusci_b_spi.c:153
uint32_t clockSourceFrequency
Is the frequency of the selected clock source in Hz.
Definition: eusci_b_spi.h:42
uint16_t EUSCI_B_SPI_isBusy(uint16_t baseAddress)
Indicates whether or not the SPI bus is busy.
Definition: eusci_b_spi.c:182
void EUSCI_B_SPI_initSlave(uint16_t baseAddress, EUSCI_B_SPI_initSlaveParam *param)
Initializes the SPI Slave block.
Definition: eusci_b_spi.c:78
Used in the EUSCI_B_SPI_initMaster() function as the param parameter.
Definition: eusci_b_spi.h:32
Used in the EUSCI_B_SPI_changeMasterClock() function as the param parameter.
Definition: eusci_b_spi.h:103
uint32_t clockSourceFrequency
Is the frequency of the selected clock source in Hz.
Definition: eusci_b_spi.h:105
uint16_t clockPhase
Definition: eusci_b_spi.h:54
uint8_t selectClockSource
Definition: eusci_b_spi.h:40
void EUSCI_B_SPI_changeMasterClock(uint16_t baseAddress, EUSCI_B_SPI_changeMasterClockParam *param)
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled...
Definition: eusci_b_spi.c:65
void EUSCI_B_SPI_enableInterrupt(uint16_t baseAddress, uint16_t mask)
Enables individual SPI interrupt sources.
Definition: eusci_b_spi.c:132
uint32_t desiredSpiClock
Is the desired clock rate in Hz for SPI communication.
Definition: eusci_b_spi.h:107
uint16_t clockPolarity
Definition: eusci_b_spi.h:59
void EUSCI_B_SPI_initMaster(uint16_t baseAddress, EUSCI_B_SPI_initMasterParam *param)
Initializes the SPI Master block.
Definition: eusci_b_spi.c:21
void EUSCI_B_SPI_transmitData(uint16_t baseAddress, uint8_t transmitData)
Transmits a byte from the SPI Module.
Definition: eusci_b_spi.c:120
void EUSCI_B_SPI_changeClockPhasePolarity(uint16_t baseAddress, uint16_t clockPhase, uint16_t clockPolarity)
Changes the SPI clock phase and polarity. At the end of this function call, SPI module is left enable...
Definition: eusci_b_spi.c:101
Used in the EUSCI_B_SPI_initSlave() function as the param parameter.
Definition: eusci_b_spi.h:73
uint32_t EUSCI_B_SPI_getReceiveBufferAddress(uint16_t baseAddress)
Returns the address of the RX Buffer of the SPI for the DMA module.
Definition: eusci_b_spi.c:172
uint16_t msbFirst
Definition: eusci_b_spi.h:49
uint32_t desiredSpiClock
Is the desired clock rate in Hz for SPI communication.
Definition: eusci_b_spi.h:44
void EUSCI_B_SPI_remapPins(uint16_t baseAddress, uint8_t pinsSelect)
Remaps eUSCI_B GPIO pins.
Definition: eusci_b_spi.c:188
uint8_t EUSCI_B_SPI_getInterruptStatus(uint16_t baseAddress, uint8_t mask)
Gets the current SPI interrupt status.
Definition: eusci_b_spi.c:146
uint16_t spiMode
Definition: eusci_b_spi.h:65
uint16_t clockPhase
Definition: eusci_b_spi.h:83
uint32_t EUSCI_B_SPI_getTransmitBufferAddress(uint16_t baseAddress)
Returns the address of the TX Buffer of the SPI for the DMA module.
Definition: eusci_b_spi.c:177
uint16_t clockPolarity
Definition: eusci_b_spi.h:88

Copyright 2020, Texas Instruments Incorporated