BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Hardware presentation/abstraction for USCI_A/USCI_B on 5xx/6xx devices. More...
Go to the source code of this file.
Data Structures | |
struct | sBSP430hplUSCI5 |
Typedefs | |
typedef struct sBSP430hplUSCI5 | sBSP430hplUSCI5 |
Hardware presentation/abstraction for USCI_A/USCI_B on 5xx/6xx devices.
This version of the Universal Serial Communication Interface is available in the 5xx/6xx family. See bsp430/periph/usci.h and bsp430/periph/eusci.h for related peripherals in other families.
Conventional peripheral handles are BSP430_PERIPH_USCI5_A0, BSP430_PERIPH_USCI5_B0, and others dependent on availability.
Substitute other instance names (e.g., B0) as necessary.
USCI supports an A variant with UART and SPI capabilities, and a B variant with SPI and I2C capabilities. The register maps for the two variants are compatible, and sBSP430hplUSCI5 is used for both variants. This structure is not compatible with the previous generation USCI module.
The USCI5 hardware adaptation layer uses the sBSP430halSERIAL structure from the generic serial adaptation layer. It can also be accessed directly using the functions defined in this module. Both A and B variants are supported by the same HAL structure.
Enabling the HAL layer for a USCI5 instance enables the corresponding interrupt structure by default. USCI5 does not support a secondary ISR.
#define BSP430_HAL_USCI5_A0 (&xBSP430hal_USCI5_A0_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_A0.
This pointer may be used only if configBSP430_HAL_USCI5_A0 is defined to a true value.
#define BSP430_HAL_USCI5_A1 (&xBSP430hal_USCI5_A1_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_A1.
This pointer may be used only if configBSP430_HAL_USCI5_A1 is defined to a true value.
#define BSP430_HAL_USCI5_A2 (&xBSP430hal_USCI5_A2_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_A2.
This pointer may be used only if configBSP430_HAL_USCI5_A2 is defined to a true value.
#define BSP430_HAL_USCI5_A3 (&xBSP430hal_USCI5_A3_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_A3.
This pointer may be used only if configBSP430_HAL_USCI5_A3 is defined to a true value.
#define BSP430_HAL_USCI5_B0 (&xBSP430hal_USCI5_B0_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_B0.
This pointer may be used only if configBSP430_HAL_USCI5_B0 is defined to a true value.
#define BSP430_HAL_USCI5_B1 (&xBSP430hal_USCI5_B1_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_B1.
This pointer may be used only if configBSP430_HAL_USCI5_B1 is defined to a true value.
#define BSP430_HAL_USCI5_B2 (&xBSP430hal_USCI5_B2_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_B2.
This pointer may be used only if configBSP430_HAL_USCI5_B2 is defined to a true value.
#define BSP430_HAL_USCI5_B3 (&xBSP430hal_USCI5_B3_) |
sBSP430halSERIAL HAL handle for BSP430_PERIPH_USCI5_B3.
This pointer may be used only if configBSP430_HAL_USCI5_B3 is defined to a true value.
#define BSP430_HPL_USCI5_A0 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_A0) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_A0.
This pointer to a volatile structure overlaying the USCI5_A0 peripheral register map may be used only if configBSP430_HPL_USCI5_A0 is defined to a true value.
#define BSP430_HPL_USCI5_A1 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_A1) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_A1.
This pointer to a volatile structure overlaying the USCI5_A1 peripheral register map may be used only if configBSP430_HPL_USCI5_A1 is defined to a true value.
#define BSP430_HPL_USCI5_A2 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_A2) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_A2.
This pointer to a volatile structure overlaying the USCI5_A2 peripheral register map may be used only if configBSP430_HPL_USCI5_A2 is defined to a true value.
#define BSP430_HPL_USCI5_A3 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_A3) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_A3.
This pointer to a volatile structure overlaying the USCI5_A3 peripheral register map may be used only if configBSP430_HPL_USCI5_A3 is defined to a true value.
#define BSP430_HPL_USCI5_B0 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_B0) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_B0.
This pointer to a volatile structure overlaying the USCI5_B0 peripheral register map may be used only if configBSP430_HPL_USCI5_B0 is defined to a true value.
#define BSP430_HPL_USCI5_B1 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_B1) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_B1.
This pointer to a volatile structure overlaying the USCI5_B1 peripheral register map may be used only if configBSP430_HPL_USCI5_B1 is defined to a true value.
#define BSP430_HPL_USCI5_B2 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_B2) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_B2.
This pointer to a volatile structure overlaying the USCI5_B2 peripheral register map may be used only if configBSP430_HPL_USCI5_B2 is defined to a true value.
#define BSP430_HPL_USCI5_B3 ((volatile sBSP430hplUSCI5 *)BSP430_PERIPH_USCI5_B3) |
sBSP430hplUSCI5 HPL pointer for BSP430_PERIPH_USCI5_B3.
This pointer to a volatile structure overlaying the USCI5_B3 peripheral register map may be used only if configBSP430_HPL_USCI5_B3 is defined to a true value.
#define BSP430_MODULE_USCI5 |
Defined on inclusion of <bsp430/periph/usci5.h>. The value evaluates to true if the target MCU supports the Universal Serial Communications Interface (5xx/6xx version), and false if it does not.
#define BSP430_PERIPH_USCI5_A0 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_A0_BASEADDRESS_)) |
Handle for the raw USCI5_A0 device.
The handle may be used only if configBSP430_HPL_USCI5_A0 is defined to a true value.
#define BSP430_PERIPH_USCI5_A1 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_A1_BASEADDRESS_)) |
Handle for the raw USCI5_A1 device.
The handle may be used only if configBSP430_HPL_USCI5_A1 is defined to a true value.
#define BSP430_PERIPH_USCI5_A2 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_A2_BASEADDRESS_)) |
Handle for the raw USCI5_A2 device.
The handle may be used only if configBSP430_HPL_USCI5_A2 is defined to a true value.
#define BSP430_PERIPH_USCI5_A3 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_A3_BASEADDRESS_)) |
Handle for the raw USCI5_A3 device.
The handle may be used only if configBSP430_HPL_USCI5_A3 is defined to a true value.
#define BSP430_PERIPH_USCI5_B0 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_B0_BASEADDRESS_)) |
Handle for the raw USCI5_B0 device.
The handle may be used only if configBSP430_HPL_USCI5_B0 is defined to a true value.
#define BSP430_PERIPH_USCI5_B1 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_B1_BASEADDRESS_)) |
Handle for the raw USCI5_B1 device.
The handle may be used only if configBSP430_HPL_USCI5_B1 is defined to a true value.
#define BSP430_PERIPH_USCI5_B2 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_B2_BASEADDRESS_)) |
Handle for the raw USCI5_B2 device.
The handle may be used only if configBSP430_HPL_USCI5_B2 is defined to a true value.
#define BSP430_PERIPH_USCI5_B3 ((tBSP430periphHandle)(BSP430_PERIPH_USCI5_B3_BASEADDRESS_)) |
Handle for the raw USCI5_B3 device.
The handle may be used only if configBSP430_HPL_USCI5_B3 is defined to a true value.
#define BSP430_USCI5_UART_MAX_BAUD 1000000UL |
Maximum baud rate acceptable for UART mode.
Not to say you can actually get this to work, but the API will reject configuration of a UART rate above this.
typedef struct sBSP430hplUSCI5 sBSP430hplUSCI5 |
Register map for USCI_A/USCI_B peripheral on a MSP430 5xx/6xx MCU.
|
static |
Get the HAL handle for a specific USCI5 instance.
periph | The handle identifier, such as BSP430_PERIPH_USCI5_A0. |
hBSP430halSERIAL hBSP430usci5OpenSPI | ( | hBSP430halSERIAL | hal, |
unsigned char | ctl0_byte, | ||
unsigned char | ctl1_byte, | ||
unsigned int | prescaler | ||
) |
USCI5-specific implementation of hBSP430serialOpenSPI()
hBSP430halSERIAL hBSP430usci5OpenUART | ( | hBSP430halSERIAL | hal, |
unsigned char | ctl0_byte, | ||
unsigned char | ctl1_byte, | ||
unsigned long | baud | ||
) |
USCI5-specific implementation of hBSP430serialOpenUART()
int iBSP430usci5Close | ( | hBSP430halSERIAL | xUSCI | ) |
USCI5-specific implementation of iBSP430serialClose()
int iBSP430usci5I2CrxData_rh | ( | hBSP430halSERIAL | hal, |
uint8_t * | rx_data, | ||
size_t | rx_len | ||
) |
USCI5-specific implementation of iBSP430i2cRxData_rh()
int iBSP430usci5I2CsetAddresses_rh | ( | hBSP430halSERIAL | hal, |
int | own_address, | ||
int | slave_address | ||
) |
USCI5-specific implementation of iBSP430i2cSetAddresses_rh()
int iBSP430usci5I2CtxData_rh | ( | hBSP430halSERIAL | hal, |
const uint8_t * | tx_data, | ||
size_t | tx_len | ||
) |
USCI5-specific implementation of iBSP430i2cTxData_rh()
int iBSP430usci5SetHold_rh | ( | hBSP430halSERIAL | hal, |
int | holdp | ||
) |
USCI5-specific implementation of iBSP430serialSetHold_rh()
int iBSP430usci5SetReset_rh | ( | hBSP430halSERIAL | hal, |
int | resetp | ||
) |
USCI5-specific implementation of iBSP430serialSetReset_rh()
int iBSP430usci5SPITxRx_rh | ( | hBSP430halSERIAL | hal, |
const uint8_t * | tx_data, | ||
size_t | tx_len, | ||
size_t | rx_len, | ||
uint8_t * | rx_data | ||
) |
USCI5-specific implementation of iBSP430spiTxRx_rh()
int iBSP430usci5UARTrxByte_rh | ( | hBSP430halSERIAL | device | ) |
USCI5-specific implementation of iBSP430uartRxByte_rh()
int iBSP430usci5UARTtxASCIIZ_rh | ( | hBSP430halSERIAL | device, |
const char * | str | ||
) |
USCI5-specific implementation of iBSP430uartTxASCIIZ_rh()
int iBSP430usci5UARTtxByte_rh | ( | hBSP430halSERIAL | device, |
uint8_t | c | ||
) |
USCI5-specific implementation of iBSP430uartTxByte_rh()
int iBSP430usci5UARTtxData_rh | ( | hBSP430halSERIAL | device, |
const uint8_t * | data, | ||
size_t | len | ||
) |
USCI5-specific implementation of iBSP430uartTxData_rh()
void vBSP430usci5Flush_ni | ( | hBSP430halSERIAL | device | ) |
USCI5-specific implementation of vBSP430serialFlush_ni()
void vBSP430usci5WakeupTransmit_rh | ( | hBSP430halSERIAL | device | ) |
USCI5-specific implementation of vBSP430serialWakeupTransmit_rh()
|
static |
Get the HPL handle for a specific USCI5 instance.
periph | The handle identifier, such as BSP430_PERIPH_USCI5_A0. |
const char* xBSP430usci5Name | ( | tBSP430periphHandle | periph | ) |
Get a human-readable identifier for the USCI5 peripheral
periph | The handle identifier, such as BSP430_PERIPH_USCI5_A0. |