84 #ifndef BSP430_PERIPH_EUSCI_H
85 #define BSP430_PERIPH_EUSCI_H
97 #define BSP430_MODULE_EUSCI (defined(__MSP430_HAS_EUSCI_A0__) \
98 || defined(__MSP430_HAS_EUSCI_B0__))
100 #if defined(BSP430_DOXYGEN) || (BSP430_MODULE_EUSCI - 0)
106 #ifndef BSP430_EUSCI_UART_MAX_BAUD
107 #define BSP430_EUSCI_UART_MAX_BAUD 1000000UL
120 unsigned int _unused_0x04;
140 unsigned int _unused_0x14;
141 unsigned int _unused_0x16;
142 unsigned int _unused_0x18;
158 unsigned int _unused_0x04;
176 unsigned int _unused_0x10;
177 unsigned int _unused_0x12;
185 unsigned int _unused_0x22;
186 unsigned int _unused_0x24;
187 unsigned int _unused_0x26;
188 unsigned int _unused_0x28;
195 #define BSP430_PERIPH_EUSCI_A0_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A0__
196 #define BSP430_PERIPH_EUSCI_A1_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A1__
197 #define BSP430_PERIPH_EUSCI_A2_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A2__
198 #define BSP430_PERIPH_EUSCI_A3_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A3__
199 #define BSP430_PERIPH_EUSCI_B0_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_B0__
200 #define BSP430_PERIPH_EUSCI_B1_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_B1__
221 #ifndef configBSP430_HAL_EUSCI_A0
222 #define configBSP430_HAL_EUSCI_A0 0
226 #if (configBSP430_HAL_EUSCI_A0 - 0)
238 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A0 - 0)
239 #define BSP430_HAL_EUSCI_A0 (&xBSP430hal_EUSCI_A0_)
258 #ifndef configBSP430_HAL_EUSCI_A1
259 #define configBSP430_HAL_EUSCI_A1 0
263 #if (configBSP430_HAL_EUSCI_A1 - 0)
275 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A1 - 0)
276 #define BSP430_HAL_EUSCI_A1 (&xBSP430hal_EUSCI_A1_)
295 #ifndef configBSP430_HAL_EUSCI_A2
296 #define configBSP430_HAL_EUSCI_A2 0
300 #if (configBSP430_HAL_EUSCI_A2 - 0)
312 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A2 - 0)
313 #define BSP430_HAL_EUSCI_A2 (&xBSP430hal_EUSCI_A2_)
332 #ifndef configBSP430_HAL_EUSCI_A3
333 #define configBSP430_HAL_EUSCI_A3 0
337 #if (configBSP430_HAL_EUSCI_A3 - 0)
349 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A3 - 0)
350 #define BSP430_HAL_EUSCI_A3 (&xBSP430hal_EUSCI_A3_)
369 #ifndef configBSP430_HAL_EUSCI_B0
370 #define configBSP430_HAL_EUSCI_B0 0
374 #if (configBSP430_HAL_EUSCI_B0 - 0)
386 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_B0 - 0)
387 #define BSP430_HAL_EUSCI_B0 (&xBSP430hal_EUSCI_B0_)
406 #ifndef configBSP430_HAL_EUSCI_B1
407 #define configBSP430_HAL_EUSCI_B1 0
411 #if (configBSP430_HAL_EUSCI_B1 - 0)
423 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_B1 - 0)
424 #define BSP430_HAL_EUSCI_B1 (&xBSP430hal_EUSCI_B1_)
447 #ifndef configBSP430_HPL_EUSCI_A0
448 #define configBSP430_HPL_EUSCI_A0 (configBSP430_HAL_EUSCI_A0 - 0)
451 #if (configBSP430_HAL_EUSCI_A0 - 0) && ! (configBSP430_HPL_EUSCI_A0 - 0)
452 #warning configBSP430_HAL_EUSCI_A0 requested without configBSP430_HPL_EUSCI_A0
461 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A0 - 0)
462 #define BSP430_PERIPH_EUSCI_A0 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A0_BASEADDRESS_))
480 #ifndef configBSP430_HPL_EUSCI_A1
481 #define configBSP430_HPL_EUSCI_A1 (configBSP430_HAL_EUSCI_A1 - 0)
484 #if (configBSP430_HAL_EUSCI_A1 - 0) && ! (configBSP430_HPL_EUSCI_A1 - 0)
485 #warning configBSP430_HAL_EUSCI_A1 requested without configBSP430_HPL_EUSCI_A1
494 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A1 - 0)
495 #define BSP430_PERIPH_EUSCI_A1 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A1_BASEADDRESS_))
513 #ifndef configBSP430_HPL_EUSCI_A2
514 #define configBSP430_HPL_EUSCI_A2 (configBSP430_HAL_EUSCI_A2 - 0)
517 #if (configBSP430_HAL_EUSCI_A2 - 0) && ! (configBSP430_HPL_EUSCI_A2 - 0)
518 #warning configBSP430_HAL_EUSCI_A2 requested without configBSP430_HPL_EUSCI_A2
527 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A2 - 0)
528 #define BSP430_PERIPH_EUSCI_A2 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A2_BASEADDRESS_))
546 #ifndef configBSP430_HPL_EUSCI_A3
547 #define configBSP430_HPL_EUSCI_A3 (configBSP430_HAL_EUSCI_A3 - 0)
550 #if (configBSP430_HAL_EUSCI_A3 - 0) && ! (configBSP430_HPL_EUSCI_A3 - 0)
551 #warning configBSP430_HAL_EUSCI_A3 requested without configBSP430_HPL_EUSCI_A3
560 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A3 - 0)
561 #define BSP430_PERIPH_EUSCI_A3 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A3_BASEADDRESS_))
576 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A0 - 0)
577 #define BSP430_HPL_EUSCI_A0 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A0)
587 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A1 - 0)
588 #define BSP430_HPL_EUSCI_A1 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A1)
598 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A2 - 0)
599 #define BSP430_HPL_EUSCI_A2 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A2)
609 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A3 - 0)
610 #define BSP430_HPL_EUSCI_A3 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A3)
633 #ifndef configBSP430_HAL_EUSCI_A0_ISR
634 #define configBSP430_HAL_EUSCI_A0_ISR (configBSP430_HAL_EUSCI_A0 - 0)
637 #if (configBSP430_HAL_EUSCI_A0_ISR - 0) && ! (configBSP430_HAL_EUSCI_A0 - 0)
638 #warning configBSP430_HAL_EUSCI_A0_ISR requested without configBSP430_HAL_EUSCI_A0
656 #ifndef configBSP430_HAL_EUSCI_A1_ISR
657 #define configBSP430_HAL_EUSCI_A1_ISR (configBSP430_HAL_EUSCI_A1 - 0)
660 #if (configBSP430_HAL_EUSCI_A1_ISR - 0) && ! (configBSP430_HAL_EUSCI_A1 - 0)
661 #warning configBSP430_HAL_EUSCI_A1_ISR requested without configBSP430_HAL_EUSCI_A1
679 #ifndef configBSP430_HAL_EUSCI_A2_ISR
680 #define configBSP430_HAL_EUSCI_A2_ISR (configBSP430_HAL_EUSCI_A2 - 0)
683 #if (configBSP430_HAL_EUSCI_A2_ISR - 0) && ! (configBSP430_HAL_EUSCI_A2 - 0)
684 #warning configBSP430_HAL_EUSCI_A2_ISR requested without configBSP430_HAL_EUSCI_A2
702 #ifndef configBSP430_HAL_EUSCI_A3_ISR
703 #define configBSP430_HAL_EUSCI_A3_ISR (configBSP430_HAL_EUSCI_A3 - 0)
706 #if (configBSP430_HAL_EUSCI_A3_ISR - 0) && ! (configBSP430_HAL_EUSCI_A3 - 0)
707 #warning configBSP430_HAL_EUSCI_A3_ISR requested without configBSP430_HAL_EUSCI_A3
730 #ifndef configBSP430_HPL_EUSCI_B0
731 #define configBSP430_HPL_EUSCI_B0 (configBSP430_HAL_EUSCI_B0 - 0)
734 #if (configBSP430_HAL_EUSCI_B0 - 0) && ! (configBSP430_HPL_EUSCI_B0 - 0)
735 #warning configBSP430_HAL_EUSCI_B0 requested without configBSP430_HPL_EUSCI_B0
744 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B0 - 0)
745 #define BSP430_PERIPH_EUSCI_B0 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_B0_BASEADDRESS_))
763 #ifndef configBSP430_HPL_EUSCI_B1
764 #define configBSP430_HPL_EUSCI_B1 (configBSP430_HAL_EUSCI_B1 - 0)
767 #if (configBSP430_HAL_EUSCI_B1 - 0) && ! (configBSP430_HPL_EUSCI_B1 - 0)
768 #warning configBSP430_HAL_EUSCI_B1 requested without configBSP430_HPL_EUSCI_B1
777 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B1 - 0)
778 #define BSP430_PERIPH_EUSCI_B1 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_B1_BASEADDRESS_))
793 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B0 - 0)
794 #define BSP430_HPL_EUSCI_B0 ((volatile sBSP430hplEUSCIB *)BSP430_PERIPH_EUSCI_B0)
804 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B1 - 0)
805 #define BSP430_HPL_EUSCI_B1 ((volatile sBSP430hplEUSCIB *)BSP430_PERIPH_EUSCI_B1)
828 #ifndef configBSP430_HAL_EUSCI_B0_ISR
829 #define configBSP430_HAL_EUSCI_B0_ISR (configBSP430_HAL_EUSCI_B0 - 0)
832 #if (configBSP430_HAL_EUSCI_B0_ISR - 0) && ! (configBSP430_HAL_EUSCI_B0 - 0)
833 #warning configBSP430_HAL_EUSCI_B0_ISR requested without configBSP430_HAL_EUSCI_B0
851 #ifndef configBSP430_HAL_EUSCI_B1_ISR
852 #define configBSP430_HAL_EUSCI_B1_ISR (configBSP430_HAL_EUSCI_B1 - 0)
855 #if (configBSP430_HAL_EUSCI_B1_ISR - 0) && ! (configBSP430_HAL_EUSCI_B1 - 0)
856 #warning configBSP430_HAL_EUSCI_B1_ISR requested without configBSP430_HAL_EUSCI_B1
864 unsigned char ctl0_byte,
865 unsigned char ctl1_byte,
870 unsigned char ctl0_byte,
871 unsigned char ctl1_byte,
872 unsigned int prescaler);
876 unsigned char ctl0_byte,
877 unsigned char ctl1_byte,
878 unsigned int prescaler);
909 const uint8_t * tx_data,
927 const uint8_t * tx_data,
946 #if (configBSP430_HPL_EUSCI_A0 - 0)
952 #if (configBSP430_HPL_EUSCI_A1 - 0)
958 #if (configBSP430_HPL_EUSCI_A2 - 0)
964 #if (configBSP430_HPL_EUSCI_A2 - 0)
991 #if (configBSP430_HPL_EUSCI_B0 - 0)
997 #if (configBSP430_HPL_EUSCI_B1 - 0)
1023 #if (configBSP430_HAL_EUSCI_A0 - 0)
1029 #if (configBSP430_HAL_EUSCI_A1 - 0)
1035 #if (configBSP430_HAL_EUSCI_A2 - 0)
1041 #if (configBSP430_HAL_EUSCI_A3 - 0)
1047 #if (configBSP430_HAL_EUSCI_B0 - 0)
1053 #if (configBSP430_HAL_EUSCI_B1 - 0)
#define BSP430_HAL_EUSCI_A0
Definition: eusci.h:239
unsigned int mctlw
Definition: eusci.h:128
int iBSP430eusciSetReset_rh(hBSP430halSERIAL hal, int resetp)
unsigned int ctlw1
Definition: eusci.h:119
int iBSP430eusciClose(hBSP430halSERIAL hal)
void vBSP430eusciWakeupTransmit_rh(hBSP430halSERIAL device)
unsigned int i2csa
Definition: eusci.h:184
int iBSP430eusciI2CtxData_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len)
unsigned int statw
Definition: eusci.h:167
#define BSP430_HPL_EUSCI_A1
Definition: eusci.h:588
#define BSP430_HPL_EUSCI_B0
Definition: eusci.h:794
unsigned char stat
Definition: eusci.h:169
unsigned int ctlw0
Definition: eusci.h:113
unsigned int ctlw1
Definition: eusci.h:157
#define BSP430_HAL_EUSCI_A3
Definition: eusci.h:350
unsigned int irctl
Definition: eusci.h:134
hBSP430halSERIAL hBSP430eusciOpenI2C(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
unsigned char bcnt
Definition: eusci.h:170
unsigned int addrx
Definition: eusci.h:182
Definition: serial_.h:193
unsigned int i2coa2
Definition: eusci.h:180
struct sBSP430hplEUSCIB sBSP430hplEUSCIB
int iBSP430eusciUARTtxByte_rh(hBSP430halSERIAL device, uint8_t c)
int iBSP430eusciUARTrxByte_rh(hBSP430halSERIAL device)
unsigned int addmask
Definition: eusci.h:183
static BSP430_CORE_INLINE volatile sBSP430hplEUSCIB * xBSP430hplLookupEUSCIB(tBSP430periphHandle periph)
Definition: eusci.h:986
unsigned char br0
Definition: eusci.h:124
unsigned char br1
Definition: eusci.h:125
unsigned char ctl0
Definition: eusci.h:116
hBSP430halSERIAL hBSP430eusciOpenSPI(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
#define BSP430_HAL_EUSCI_B1
Definition: eusci.h:424
unsigned int ctlw0
Definition: eusci.h:151
int iBSP430eusciI2CrxData_rh(hBSP430halSERIAL hal, uint8_t *rx_data, size_t rx_len)
void vBSP430eusciFlush_ni(hBSP430halSERIAL device)
unsigned char irtctl
Definition: eusci.h:136
#define BSP430_CORE_INLINE
Definition: core.h:439
Generic peripheral support for MSP430 MCUs.
unsigned int txbuf
Definition: eusci.h:175
#define BSP430_HPL_EUSCI_A0
Definition: eusci.h:577
#define BSP430_HAL_EUSCI_B0
Definition: eusci.h:387
int iBSP430eusciSPITxRx_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len, size_t rx_len, uint8_t *rx_data)
int iBSP430eusciI2CsetAddresses_rh(hBSP430halSERIAL hal, int own_address, int slave_address)
#define BSP430_PERIPH_EUSCI_A2
Definition: eusci.h:528
unsigned int tbcnt
Definition: eusci.h:173
unsigned int brw
Definition: eusci.h:122
unsigned char ctl0
Definition: eusci.h:154
int iBSP430eusciSetHold_rh(hBSP430halSERIAL hal, int holdp)
unsigned char br1
Definition: eusci.h:163
#define BSP430_HAL_EUSCI_A1
Definition: eusci.h:276
#define BSP430_PERIPH_EUSCI_B0
Definition: eusci.h:745
unsigned char irrctl
Definition: eusci.h:137
unsigned int txbuf
Definition: eusci.h:131
static BSP430_CORE_INLINE hBSP430halSERIAL hBSP430eusciLookup(tBSP430periphHandle periph)
Definition: eusci.h:1018
unsigned int i2coa1
Definition: eusci.h:179
#define BSP430_PERIPH_EUSCI_A3
Definition: eusci.h:561
unsigned char ctl1
Definition: eusci.h:153
#define BSP430_HPL_EUSCI_A2
Definition: eusci.h:599
#define BSP430_PERIPH_EUSCI_B1
Definition: eusci.h:778
unsigned int rxbuf
Definition: eusci.h:174
unsigned int abctl
Definition: eusci.h:132
int iBSP430eusciUARTtxData_rh(hBSP430halSERIAL device, const uint8_t *data, size_t len)
int iBSP430eusciUARTtxASCIIZ_rh(hBSP430halSERIAL device, const char *str)
struct sBSP430hplEUSCIA sBSP430hplEUSCIA
static BSP430_CORE_INLINE volatile sBSP430hplEUSCIA * xBSP430hplLookupEUSCIA(tBSP430periphHandle periph)
Definition: eusci.h:941
unsigned int iv
Definition: eusci.h:191
unsigned char br0
Definition: eusci.h:162
unsigned int statw
Definition: eusci.h:129
int tBSP430periphHandle
Definition: periph.h:106
unsigned int rxbuf
Definition: eusci.h:130
#define BSP430_HPL_EUSCI_B1
Definition: eusci.h:805
unsigned int brw
Definition: eusci.h:160
Structures for abstracted serial interface.
const char * xBSP430eusciName(tBSP430periphHandle periph)
#define BSP430_HAL_EUSCI_A2
Definition: eusci.h:313
#define BSP430_PERIPH_EUSCI_A1
Definition: eusci.h:495
unsigned int ie
Definition: eusci.h:143
unsigned int i2coa0
Definition: eusci.h:178
unsigned int i2coa3
Definition: eusci.h:181
unsigned int iv
Definition: eusci.h:145
unsigned int ifg
Definition: eusci.h:144
hBSP430halSERIAL hBSP430eusciOpenUART(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned long baud)
unsigned int ie
Definition: eusci.h:189
unsigned int ifg
Definition: eusci.h:190
#define BSP430_PERIPH_EUSCI_A0
Definition: eusci.h:462
unsigned char ctl1
Definition: eusci.h:115