91 #ifndef BSP430_PERIPH_USCI_H
92 #define BSP430_PERIPH_USCI_H
104 #define BSP430_MODULE_USCI defined(__MSP430_HAS_USCI__)
106 #if defined(BSP430_DOXYGEN) || (BSP430_MODULE_USCI - 0)
112 #ifndef BSP430_USCI_UART_MAX_BAUD
113 #define BSP430_USCI_UART_MAX_BAUD 1000000UL
129 #define BSP430_PERIPH_USCI_A0_BASEADDRESS_ 0x0060
130 #define BSP430_PERIPH_USCI_A1_BASEADDRESS_ 0x00d0
131 #define BSP430_PERIPH_USCI_B0_BASEADDRESS_ 0x0068
132 #define BSP430_PERIPH_USCI_B1_BASEADDRESS_ 0x00d8
153 #ifndef configBSP430_HAL_USCI_A0
154 #define configBSP430_HAL_USCI_A0 0
158 #if (configBSP430_HAL_USCI_A0 - 0)
170 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_USCI_A0 - 0)
171 #define BSP430_HAL_USCI_A0 (&xBSP430hal_USCI_A0_)
190 #ifndef configBSP430_HAL_USCI_A1
191 #define configBSP430_HAL_USCI_A1 0
195 #if (configBSP430_HAL_USCI_A1 - 0)
207 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_USCI_A1 - 0)
208 #define BSP430_HAL_USCI_A1 (&xBSP430hal_USCI_A1_)
227 #ifndef configBSP430_HAL_USCI_B0
228 #define configBSP430_HAL_USCI_B0 0
232 #if (configBSP430_HAL_USCI_B0 - 0)
244 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_USCI_B0 - 0)
245 #define BSP430_HAL_USCI_B0 (&xBSP430hal_USCI_B0_)
264 #ifndef configBSP430_HAL_USCI_B1
265 #define configBSP430_HAL_USCI_B1 0
269 #if (configBSP430_HAL_USCI_B1 - 0)
281 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_USCI_B1 - 0)
282 #define BSP430_HAL_USCI_B1 (&xBSP430hal_USCI_B1_)
306 #ifndef configBSP430_HPL_USCI_A0
307 #define configBSP430_HPL_USCI_A0 (configBSP430_HAL_USCI_A0 - 0)
310 #if (configBSP430_HAL_USCI_A0 - 0) && ! (configBSP430_HPL_USCI_A0 - 0)
311 #warning configBSP430_HAL_USCI_A0 requested without configBSP430_HPL_USCI_A0
320 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_A0 - 0)
321 #define BSP430_PERIPH_USCI_A0 ((tBSP430periphHandle)(BSP430_PERIPH_USCI_A0_BASEADDRESS_))
339 #ifndef configBSP430_HPL_USCI_A1
340 #define configBSP430_HPL_USCI_A1 (configBSP430_HAL_USCI_A1 - 0)
343 #if (configBSP430_HAL_USCI_A1 - 0) && ! (configBSP430_HPL_USCI_A1 - 0)
344 #warning configBSP430_HAL_USCI_A1 requested without configBSP430_HPL_USCI_A1
353 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_A1 - 0)
354 #define BSP430_PERIPH_USCI_A1 ((tBSP430periphHandle)(BSP430_PERIPH_USCI_A1_BASEADDRESS_))
372 #ifndef configBSP430_HPL_USCI_B0
373 #define configBSP430_HPL_USCI_B0 (configBSP430_HAL_USCI_B0 - 0)
376 #if (configBSP430_HAL_USCI_B0 - 0) && ! (configBSP430_HPL_USCI_B0 - 0)
377 #warning configBSP430_HAL_USCI_B0 requested without configBSP430_HPL_USCI_B0
386 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_B0 - 0)
387 #define BSP430_PERIPH_USCI_B0 ((tBSP430periphHandle)(BSP430_PERIPH_USCI_B0_BASEADDRESS_))
405 #ifndef configBSP430_HPL_USCI_B1
406 #define configBSP430_HPL_USCI_B1 (configBSP430_HAL_USCI_B1 - 0)
409 #if (configBSP430_HAL_USCI_B1 - 0) && ! (configBSP430_HPL_USCI_B1 - 0)
410 #warning configBSP430_HAL_USCI_B1 requested without configBSP430_HPL_USCI_B1
419 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_B1 - 0)
420 #define BSP430_PERIPH_USCI_B1 ((tBSP430periphHandle)(BSP430_PERIPH_USCI_B1_BASEADDRESS_))
435 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_A0 - 0)
436 #define BSP430_HPL_USCI_A0 ((volatile sBSP430hplUSCI *)BSP430_PERIPH_USCI_A0)
446 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_A1 - 0)
447 #define BSP430_HPL_USCI_A1 ((volatile sBSP430hplUSCI *)BSP430_PERIPH_USCI_A1)
457 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_B0 - 0)
458 #define BSP430_HPL_USCI_B0 ((volatile sBSP430hplUSCI *)BSP430_PERIPH_USCI_B0)
468 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_USCI_B1 - 0)
469 #define BSP430_HPL_USCI_B1 ((volatile sBSP430hplUSCI *)BSP430_PERIPH_USCI_B1)
494 #ifndef configBSP430_HAL_USCI_AB0RX_ISR
495 #define configBSP430_HAL_USCI_AB0RX_ISR ((configBSP430_HAL_USCI_A0 - 0) || (configBSP430_HAL_USCI_B0 - 0))
498 #if ((configBSP430_HAL_0_ISR - 0) \
499 && ! ((configBSP430_HAL_USCI_A0RX - 0) | (configBSP430_HAL_USCI_B0 - 0)))
500 #warning configBSP430_HAL_USCI_AB0RX_ISR requested without configBSP430_HAL_USCI_A0 or configBSP430_HAL_USCI_B0
519 #ifndef configBSP430_HAL_USCI_AB0TX_ISR
520 #define configBSP430_HAL_USCI_AB0TX_ISR ((configBSP430_HAL_USCI_A0 - 0) | (configBSP430_HAL_USCI_B0 - 0))
523 #if ((configBSP430_HAL_0_ISR - 0) \
524 && ! ((configBSP430_HAL_USCI_A0TX - 0) | (configBSP430_HAL_USCI_B0 - 0)))
525 #warning configBSP430_HAL_USCI_AB0TX_ISR requested without configBSP430_HAL_USCI_A0 or configBSP430_HAL_USCI_B0
544 #ifndef configBSP430_HAL_USCI_AB1RX_ISR
545 #define configBSP430_HAL_USCI_AB1RX_ISR ((configBSP430_HAL_USCI_A1 - 0) || (configBSP430_HAL_USCI_B1 - 0))
548 #if ((configBSP430_HAL_1_ISR - 0) \
549 && ! ((configBSP430_HAL_USCI_A1RX - 0) | (configBSP430_HAL_USCI_B1 - 0)))
550 #warning configBSP430_HAL_USCI_AB1RX_ISR requested without configBSP430_HAL_USCI_A1 or configBSP430_HAL_USCI_B1
569 #ifndef configBSP430_HAL_USCI_AB1TX_ISR
570 #define configBSP430_HAL_USCI_AB1TX_ISR ((configBSP430_HAL_USCI_A1 - 0) | (configBSP430_HAL_USCI_B1 - 0))
573 #if ((configBSP430_HAL_1_ISR - 0) \
574 && ! ((configBSP430_HAL_USCI_A1TX - 0) | (configBSP430_HAL_USCI_B1 - 0)))
575 #warning configBSP430_HAL_USCI_AB1TX_ISR requested without configBSP430_HAL_USCI_A1 or configBSP430_HAL_USCI_B1
584 unsigned char ctl0_byte,
585 unsigned char ctl1_byte,
590 unsigned char ctl0_byte,
591 unsigned char ctl1_byte,
592 unsigned int prescaler);
596 unsigned char ctl0_byte,
597 unsigned char ctl1_byte,
598 unsigned int prescaler);
629 const uint8_t * tx_data,
646 const uint8_t * tx_data,
663 #if (configBSP430_HPL_USCI_A0 - 0)
669 #if (configBSP430_HPL_USCI_A1 - 0)
675 #if (configBSP430_HPL_USCI_B0 - 0)
681 #if (configBSP430_HPL_USCI_B1 - 0)
705 #if (configBSP430_HAL_USCI_A0 - 0)
711 #if (configBSP430_HAL_USCI_A1 - 0)
717 #if (configBSP430_HAL_USCI_B0 - 0)
723 #if (configBSP430_HAL_USCI_B1 - 0)
static BSP430_CORE_INLINE hBSP430halSERIAL hBSP430usciLookup(tBSP430periphHandle periph)
Definition: usci.h:701
int iBSP430usciClose(hBSP430halSERIAL xUSCI)
#define BSP430_HPL_USCI_A0
Definition: usci.h:436
static BSP430_CORE_INLINE volatile sBSP430hplUSCI * xBSP430hplLookupUSCI(tBSP430periphHandle periph)
Definition: usci.h:659
int iBSP430usciUARTrxByte_rh(hBSP430halSERIAL device)
struct sBSP430hplUSCI sBSP430hplUSCI
unsigned char ctl1
Definition: usci.h:119
#define BSP430_HPL_USCI_A1
Definition: usci.h:447
void vBSP430usciFlush_ni(hBSP430halSERIAL device)
#define BSP430_HAL_USCI_A0
Definition: usci.h:171
int iBSP430usciI2CsetAddresses_rh(hBSP430halSERIAL hal, int own_address, int slave_address)
Definition: serial_.h:193
void vBSP430usciWakeupTransmit_rh(hBSP430halSERIAL device)
#define BSP430_PERIPH_USCI_A0
Definition: usci.h:321
int iBSP430usciUARTtxASCIIZ_rh(hBSP430halSERIAL device, const char *str)
unsigned char rxbuf
Definition: usci.h:124
unsigned char txbuf
Definition: usci.h:125
#define BSP430_HPL_USCI_B0
Definition: usci.h:458
hBSP430halSERIAL hBSP430usciOpenSPI(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
int iBSP430usciI2CtxData_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len)
#define BSP430_CORE_INLINE
Definition: core.h:439
hBSP430halSERIAL hBSP430usciOpenUART(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned long baud)
const char * xBSP430usciName(tBSP430periphHandle periph)
Generic peripheral support for MSP430 MCUs.
hBSP430halSERIAL hBSP430usciOpenI2C(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
#define BSP430_PERIPH_USCI_B1
Definition: usci.h:420
int iBSP430usciI2CrxData_rh(hBSP430halSERIAL hal, uint8_t *rx_data, size_t rx_len)
int iBSP430usciUARTtxByte_rh(hBSP430halSERIAL device, uint8_t c)
#define BSP430_PERIPH_USCI_B0
Definition: usci.h:387
unsigned char br0
Definition: usci.h:120
unsigned char ctl0
Definition: usci.h:118
unsigned char br1
Definition: usci.h:121
int iBSP430usciSetReset_rh(hBSP430halSERIAL hal, int resetp)
unsigned char mctl
Definition: usci.h:122
#define BSP430_HAL_USCI_A1
Definition: usci.h:208
#define BSP430_HAL_USCI_B0
Definition: usci.h:245
int tBSP430periphHandle
Definition: periph.h:106
#define BSP430_HAL_USCI_B1
Definition: usci.h:282
int iBSP430usciSPITxRx_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len, size_t rx_len, uint8_t *rx_data)
Structures for abstracted serial interface.
#define BSP430_PERIPH_USCI_A1
Definition: usci.h:354
int iBSP430usciUARTtxData_rh(hBSP430halSERIAL device, const uint8_t *data, size_t len)
int iBSP430usciSetHold_rh(hBSP430halSERIAL hal, int holdp)
unsigned char stat
Definition: usci.h:123
#define BSP430_HPL_USCI_B1
Definition: usci.h:469