MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.91.13.01
eusci_a_spi.h
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 //
28 //! \brief Used in the EUSCI_A_SPI_changeMasterClock() function as the param
29 //! parameter.
30 //
31 //*****************************************************************************
33  //! Is the frequency of the selected clock source in Hz
35  //! Is the desired clock rate in Hz for SPI communication
36  uint32_t desiredSpiClock;
38 
39 //*****************************************************************************
40 //
41 //! \brief Used in the EUSCI_A_SPI_initSlave() function as the param parameter.
42 //
43 //*****************************************************************************
45  //! Controls the direction of the receive and transmit shift register.
46  //! \n Valid values are:
47  //! - \b EUSCI_A_SPI_MSB_FIRST
48  //! - \b EUSCI_A_SPI_LSB_FIRST [Default]
49  uint16_t msbFirst;
50  //! Is clock phase select.
51  //! \n Valid values are:
52  //! - \b EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT [Default]
53  //! - \b EUSCI_A_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_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
58  //! - \b EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW [Default]
59  uint16_t clockPolarity;
60  //! Is SPI mode select
61  //! \n Valid values are:
62  //! - \b EUSCI_A_SPI_3PIN
63  //! - \b EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH
64  //! - \b EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW
65  uint16_t spiMode;
67 
68 //*****************************************************************************
69 //
70 //! \brief Used in the EUSCI_A_SPI_initMaster() function as the param
71 //! parameter.
72 //
73 //*****************************************************************************
75  //! Selects Clock source. Refer to device specific datasheet for available
76  //! options.
77  //! \n Valid values are:
78  //! - \b EUSCI_A_SPI_CLOCKSOURCE_UCLK
79  //! - \b EUSCI_A_SPI_CLOCKSOURCE_ACLK
80  //! - \b EUSCI_A_SPI_CLOCKSOURCE_MODCLK
81  //! - \b EUSCI_A_SPI_CLOCKSOURCE_SMCLK
83  //! Is the frequency of the selected clock source in Hz
85  //! Is the desired clock rate in Hz for SPI communication
86  uint32_t desiredSpiClock;
87  //! Controls the direction of the receive and transmit shift register.
88  //! \n Valid values are:
89  //! - \b EUSCI_A_SPI_MSB_FIRST
90  //! - \b EUSCI_A_SPI_LSB_FIRST [Default]
91  uint16_t msbFirst;
92  //! Is clock phase select.
93  //! \n Valid values are:
94  //! - \b EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT [Default]
95  //! - \b EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT
96  uint16_t clockPhase;
97  //! Is clock polarity select
98  //! \n Valid values are:
99  //! - \b EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
100  //! - \b EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW [Default]
101  uint16_t clockPolarity;
102  //! Is SPI mode select
103  //! \n Valid values are:
104  //! - \b EUSCI_A_SPI_3PIN
105  //! - \b EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH
106  //! - \b EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW
107  uint16_t spiMode;
109 
110 
111 //*****************************************************************************
112 //
113 // The following are values that can be passed to the clockPhase parameter for
114 // functions: EUSCI_A_SPI_changeClockPhasePolarity(); the param parameter for
115 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
116 //
117 //*****************************************************************************
118 #define EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT 0x00
119 #define EUSCI_A_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_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
125 //
126 //*****************************************************************************
127 #define EUSCI_A_SPI_MSB_FIRST UCMSB
128 #define EUSCI_A_SPI_LSB_FIRST 0x00
129 
130 //*****************************************************************************
131 //
132 // The following are values that can be passed to the param parameter for
133 // functions: EUSCI_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave(); the
134 // clockPolarity parameter for functions:
135 // EUSCI_A_SPI_changeClockPhasePolarity().
136 //
137 //*****************************************************************************
138 #define EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH UCCKPL
139 #define EUSCI_A_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_A_SPI_initMaster().
145 //
146 //*****************************************************************************
147 #define EUSCI_A_SPI_CLOCKSOURCE_UCLK UCSSEL__UCLK
148 #define EUSCI_A_SPI_CLOCKSOURCE_ACLK 0x40
149 #define EUSCI_A_SPI_CLOCKSOURCE_MODCLK 0x40
150 #define EUSCI_A_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_A_SPI_initMaster(), and EUSCI_A_SPI_initSlave().
156 //
157 //*****************************************************************************
158 #define EUSCI_A_SPI_3PIN UCMODE_0
159 #define EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_HIGH UCMODE_1
160 #define EUSCI_A_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_A_SPI_select4PinFunctionality().
166 //
167 //*****************************************************************************
168 #define EUSCI_A_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS 0x0000
169 #define EUSCI_A_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_A_SPI_enableInterrupt(), EUSCI_A_SPI_disableInterrupt(),
175 // EUSCI_A_SPI_getInterruptStatus(), and EUSCI_A_SPI_clearInterrupt() as well
176 // as returned by the EUSCI_A_SPI_getInterruptStatus() function.
177 //
178 //*****************************************************************************
179 #define EUSCI_A_SPI_TRANSMIT_INTERRUPT UCTXIE
180 #define EUSCI_A_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_A_SPI_isBusy() function.
186 //
187 //*****************************************************************************
188 #define EUSCI_A_SPI_BUSY UCBUSY
189 #define EUSCI_A_SPI_NOT_BUSY 0x00
190 
191 //*****************************************************************************
192 //
193 // The following are values that can be passed to the pinsSelect parameter for
194 // functions: EUSCI_A_SPI_remapPins().
195 //
196 //*****************************************************************************
197 #define EUSCI_A_SPI_REMAP_PINS_FALSE (0x0000)
198 #define EUSCI_A_SPI_REMAP_PINS_TRUE (USCIARMP)
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_A_SPI_enable()
213 //!
214 //! \param baseAddress is the base address of the EUSCI_A_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_A_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_A_SPI module.
234 //! \param select4PinFunctionality selects 4 pin functionality
235 //! Valid values are:
236 //! - \b EUSCI_A_SPI_PREVENT_CONFLICTS_WITH_OTHER_MASTERS
237 //! - \b EUSCI_A_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_A_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_A_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_A_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_A_SPI_enable()
270 //!
271 //! \param baseAddress is the base address of the EUSCI_A_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_A_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_A_SPI module.
289 //! \param clockPhase is clock phase select.
290 //! Valid values are:
291 //! - \b EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT
292 //! [Default]
293 //! - \b EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT
294 //! \param clockPolarity is clock polarity select
295 //! Valid values are:
296 //! - \b EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH
297 //! - \b EUSCI_A_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_A_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_A_SPI module.
317 //! \param transmitData data to be transmitted from the SPI module
318 //!
319 //! \return None
320 //
321 //*****************************************************************************
322 extern void EUSCI_A_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_A_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_A_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_A_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_A_SPI_TRANSMIT_INTERRUPT
351 //! - \b EUSCI_A_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_A_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_A_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_A_SPI_TRANSMIT_INTERRUPT
373 //! - \b EUSCI_A_SPI_RECEIVE_INTERRUPT
374 //!
375 //! Modified bits of \b UCAxIE register.
376 //!
377 //! \return None
378 //
379 //*****************************************************************************
380 extern void EUSCI_A_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_A_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_A_SPI_TRANSMIT_INTERRUPT
394 //! - \b EUSCI_A_SPI_RECEIVE_INTERRUPT
395 //!
396 //! \return Logical OR of any of the following:
397 //! - \b EUSCI_A_SPI_TRANSMIT_INTERRUPT
398 //! - \b EUSCI_A_SPI_RECEIVE_INTERRUPT
399 //! \n indicating the status of the masked interrupts
400 //
401 //*****************************************************************************
402 extern uint8_t EUSCI_A_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_A_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_A_SPI_TRANSMIT_INTERRUPT
413 //! - \b EUSCI_A_SPI_RECEIVE_INTERRUPT
414 //!
415 //! Modified bits of \b UCAxIFG register.
416 //!
417 //! \return None
418 //
419 //*****************************************************************************
420 extern void EUSCI_A_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_A_SPI module.
430 //!
431 //! Modified bits are \b UCSWRST of \b UCAxCTLW0 register.
432 //!
433 //! \return None
434 //
435 //*****************************************************************************
436 extern void EUSCI_A_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_A_SPI module.
445 //!
446 //! Modified bits are \b UCSWRST of \b UCAxCTLW0 register.
447 //!
448 //! \return None
449 //
450 //*****************************************************************************
451 extern void EUSCI_A_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_A_SPI module.
461 //!
462 //! \return the address of the RX Buffer
463 //
464 //*****************************************************************************
465 extern uint32_t EUSCI_A_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_A_SPI module.
475 //!
476 //! \return the address of the TX Buffer
477 //
478 //*****************************************************************************
479 extern uint32_t EUSCI_A_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_A_SPI module.
489 //!
490 //! \return One of the following:
491 //! - \b EUSCI_A_SPI_BUSY
492 //! - \b EUSCI_A_SPI_NOT_BUSY
493 //! \n indicating if the EUSCI_A_SPI is busy
494 //
495 //*****************************************************************************
496 extern uint16_t EUSCI_A_SPI_isBusy(uint16_t baseAddress);
497 
498 //*****************************************************************************
499 //
500 //! \brief Remaps eUSCI_A GPIO pins.
501 //!
502 //! Remaps eUSCI_A 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_a_uart GPIO
506 //! pins.
507 //!
508 //! \param baseAddress is the base address of the EUSCI_A_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_A_SPI_REMAP_PINS_FALSE [Default]
513 //! - \b EUSCI_A_SPI_REMAP_PINS_TRUE
514 //!
515 //! \return None
516 //
517 //*****************************************************************************
518 extern void EUSCI_A_SPI_remapPins(uint16_t baseAddress,
519  uint8_t pinsSelect);
520 
521 //*****************************************************************************
522 //
523 // The following are deprecated #defines.
524 //
525 //*****************************************************************************
526 #define EUSCI_A_SPI_REMAP_PINS_1 EUSCI_A_SPI_REMAP_PINS_FALSE
527 #define EUSCI_A_SPI_REMAP_PINS_2 EUSCI_A_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_A_SPI_H__
void EUSCI_A_SPI_clearInterrupt(uint16_t baseAddress, uint16_t mask)
Clears the selected SPI interrupt status flag.
Definition: eusci_a_spi.c:155
uint8_t EUSCI_A_SPI_getInterruptStatus(uint16_t baseAddress, uint8_t mask)
Gets the current SPI interrupt status.
Definition: eusci_a_spi.c:148
uint16_t spiMode
Definition: eusci_a_spi.h:65
void EUSCI_A_SPI_initMaster(uint16_t baseAddress, EUSCI_A_SPI_initMasterParam *param)
Initializes the SPI Master block.
Definition: eusci_a_spi.c:21
void EUSCI_A_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_a_spi.c:103
void EUSCI_A_SPI_remapPins(uint16_t baseAddress, uint8_t pinsSelect)
Remaps eUSCI_A GPIO pins.
Definition: eusci_a_spi.c:190
uint16_t clockPhase
Definition: eusci_a_spi.h:54
Used in the EUSCI_A_SPI_changeMasterClock() function as the param parameter.
Definition: eusci_a_spi.h:32
Used in the EUSCI_A_SPI_initMaster() function as the param parameter.
Definition: eusci_a_spi.h:74
uint32_t desiredSpiClock
Is the desired clock rate in Hz for SPI communication.
Definition: eusci_a_spi.h:86
uint16_t msbFirst
Definition: eusci_a_spi.h:91
uint32_t EUSCI_A_SPI_getTransmitBufferAddress(uint16_t baseAddress)
Returns the address of the TX Buffer of the SPI for the DMA module.
Definition: eusci_a_spi.c:179
void EUSCI_A_SPI_initSlave(uint16_t baseAddress, EUSCI_A_SPI_initSlaveParam *param)
Initializes the SPI Slave block.
Definition: eusci_a_spi.c:80
uint32_t clockSourceFrequency
Is the frequency of the selected clock source in Hz.
Definition: eusci_a_spi.h:84
void EUSCI_A_SPI_enableInterrupt(uint16_t baseAddress, uint16_t mask)
Enables individual SPI interrupt sources.
Definition: eusci_a_spi.c:134
uint16_t clockPolarity
Definition: eusci_a_spi.h:59
uint16_t msbFirst
Definition: eusci_a_spi.h:49
uint16_t spiMode
Definition: eusci_a_spi.h:107
uint32_t desiredSpiClock
Is the desired clock rate in Hz for SPI communication.
Definition: eusci_a_spi.h:36
void EUSCI_A_SPI_disableInterrupt(uint16_t baseAddress, uint16_t mask)
Disables individual SPI interrupt sources.
Definition: eusci_a_spi.c:141
Used in the EUSCI_A_SPI_initSlave() function as the param parameter.
Definition: eusci_a_spi.h:44
uint32_t EUSCI_A_SPI_getReceiveBufferAddress(uint16_t baseAddress)
Returns the address of the RX Buffer of the SPI for the DMA module.
Definition: eusci_a_spi.c:174
uint16_t clockPhase
Definition: eusci_a_spi.h:96
uint16_t EUSCI_A_SPI_isBusy(uint16_t baseAddress)
Indicates whether or not the SPI bus is busy.
Definition: eusci_a_spi.c:184
uint8_t selectClockSource
Definition: eusci_a_spi.h:82
uint8_t EUSCI_A_SPI_receiveData(uint16_t baseAddress)
Receives a byte that has been sent to the SPI Module.
Definition: eusci_a_spi.c:129
void EUSCI_A_SPI_disable(uint16_t baseAddress)
Disables the SPI block.
Definition: eusci_a_spi.c:168
void EUSCI_A_SPI_transmitData(uint16_t baseAddress, uint8_t transmitData)
Transmits a byte from the SPI Module.
Definition: eusci_a_spi.c:122
void EUSCI_A_SPI_changeMasterClock(uint16_t baseAddress, EUSCI_A_SPI_changeMasterClockParam *param)
Initializes the SPI Master clock. At the end of this function call, SPI module is left enabled...
Definition: eusci_a_spi.c:67
uint16_t clockPolarity
Definition: eusci_a_spi.h:101
void EUSCI_A_SPI_select4PinFunctionality(uint16_t baseAddress, uint16_t select4PinFunctionality)
Selects 4Pin Functionality.
Definition: eusci_a_spi.c:59
uint32_t clockSourceFrequency
Is the frequency of the selected clock source in Hz.
Definition: eusci_a_spi.h:34
void EUSCI_A_SPI_enable(uint16_t baseAddress)
Enables the SPI block.
Definition: eusci_a_spi.c:162

Copyright 2020, Texas Instruments Incorporated