Functions | |
bool | USCI_A_UART_init (uint16_t baseAddress, USCI_A_UART_initParam *param) |
Advanced initialization routine for the UART block. The values to be written into the clockPrescalar, firstModReg, secondModReg and overSampling parameters should be pre-computed and passed into the initialization function. More... | |
void | USCI_A_UART_transmitData (uint16_t baseAddress, uint8_t transmitData) |
Transmits a byte from the UART Module. More... | |
uint8_t | USCI_A_UART_receiveData (uint16_t baseAddress) |
Receives a byte that has been sent to the UART Module. More... | |
void | USCI_A_UART_enableInterrupt (uint16_t baseAddress, uint8_t mask) |
Enables individual UART interrupt sources. More... | |
void | USCI_A_UART_disableInterrupt (uint16_t baseAddress, uint8_t mask) |
Disables individual UART interrupt sources. More... | |
uint8_t | USCI_A_UART_getInterruptStatus (uint16_t baseAddress, uint8_t mask) |
Gets the current UART interrupt status. More... | |
void | USCI_A_UART_clearInterrupt (uint16_t baseAddress, uint8_t mask) |
Clears UART interrupt sources. More... | |
void | USCI_A_UART_enable (uint16_t baseAddress) |
Enables the UART block. More... | |
void | USCI_A_UART_disable (uint16_t baseAddress) |
Disables the UART block. More... | |
uint8_t | USCI_A_UART_queryStatusFlags (uint16_t baseAddress, uint8_t mask) |
Gets the current UART status flags. More... | |
void | USCI_A_UART_setDormant (uint16_t baseAddress) |
Sets the UART module in dormant mode. More... | |
void | USCI_A_UART_resetDormant (uint16_t baseAddress) |
Re-enables UART module from dormant mode. More... | |
void | USCI_A_UART_transmitAddress (uint16_t baseAddress, uint8_t transmitAddress) |
Transmits the next byte to be transmitted marked as address depending on selected multiprocessor mode. More... | |
void | USCI_A_UART_transmitBreak (uint16_t baseAddress) |
Transmit break. More... | |
uint32_t | USCI_A_UART_getReceiveBufferAddressForDMA (uint16_t baseAddress) |
Returns the address of the RX Buffer of the UART for the DMA module. More... | |
uint32_t | USCI_A_UART_getTransmitBufferAddressForDMA (uint16_t baseAddress) |
Returns the address of the TX Buffer of the UART for the DMA module. More... | |
void USCI_A_UART_clearInterrupt | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Clears UART interrupt sources.
The UART interrupt source is cleared, so that it no longer asserts. The highest interrupt flag is automatically cleared when an interrupt vector generator is used.
baseAddress | is the base address of the USCI_A_UART module. |
mask | is a bit mask of the interrupt sources to be cleared. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register.
void USCI_A_UART_disable | ( | uint16_t | baseAddress | ) |
Disables the UART block.
This will disable operation of the UART block.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits are UCSWRST of UCAxCTL1 register.
void USCI_A_UART_disableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Disables individual UART interrupt sources.
Disables the indicated UART interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the USCI_A_UART module. |
mask | is the bit mask of the interrupt sources to be disabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxCTL1 register and bits of UCAxIE register.
void USCI_A_UART_enable | ( | uint16_t | baseAddress | ) |
Enables the UART block.
This will enable operation of the UART block.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits are UCSWRST of UCAxCTL1 register.
void USCI_A_UART_enableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Enables individual UART interrupt sources.
Enables the indicated UART interrupt sources. The interrupt flag is first and then the corresponding interrupt is enabled. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the USCI_A_UART module. |
mask | is the bit mask of the interrupt sources to be enabled. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxCTL1 register and bits of UCAxIE register.
uint8_t USCI_A_UART_getInterruptStatus | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Gets the current UART interrupt status.
This returns the interrupt status for the UART module based on which flag is passed.
baseAddress | is the base address of the USCI_A_UART module. |
mask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxIFG register.
uint32_t USCI_A_UART_getReceiveBufferAddressForDMA | ( | uint16_t | baseAddress | ) |
Returns the address of the RX Buffer of the UART for the DMA module.
Returns the address of the UART RX Buffer. This can be used in conjunction with the DMA to store the received data directly to memory.
baseAddress | is the base address of the USCI_A_UART module. |
uint32_t USCI_A_UART_getTransmitBufferAddressForDMA | ( | uint16_t | baseAddress | ) |
Returns the address of the TX Buffer of the UART for the DMA module.
Returns the address of the UART TX Buffer. This can be used in conjunction with the DMA to obtain transmitted data directly from memory.
baseAddress | is the base address of the USCI_A_UART module. |
bool USCI_A_UART_init | ( | uint16_t | baseAddress, |
USCI_A_UART_initParam * | param | ||
) |
Advanced initialization routine for the UART block. The values to be written into the clockPrescalar, firstModReg, secondModReg and overSampling parameters should be pre-computed and passed into the initialization function.
Upon successful initialization of the UART block, this function will have initialized the module, but the UART block still remains disabled and must be enabled with USCI_A_UART_enable(). To calculate values for clockPrescalar, firstModReg, secondModReg and overSampling please use the link below.
https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
baseAddress | is the base address of the USCI_A_UART module. |
param | is the pointer to struct for initialization. |
Modified bits are UCPEN, UCPAR, UCMSB, UC7BIT, UCSPB, UCMODEx and UCSYNC of UCAxCTL0 register; bits UCSSELx and UCSWRST of UCAxCTL1 register.
References USCI_A_UART_initParam::clockPrescalar, USCI_A_UART_initParam::firstModReg, USCI_A_UART_initParam::msborLsbFirst, USCI_A_UART_initParam::numberofStopBits, USCI_A_UART_initParam::overSampling, USCI_A_UART_initParam::parity, USCI_A_UART_initParam::secondModReg, USCI_A_UART_initParam::selectClockSource, and USCI_A_UART_initParam::uartMode.
uint8_t USCI_A_UART_queryStatusFlags | ( | uint16_t | baseAddress, |
uint8_t | mask | ||
) |
Gets the current UART status flags.
This returns the status for the UART module based on which flag is passed.
baseAddress | is the base address of the USCI_A_UART module. |
mask | is the masked interrupt flag status to be returned. Mask value is the logical OR of any of the following:
|
Modified bits of UCAxSTAT register.
uint8_t USCI_A_UART_receiveData | ( | uint16_t | baseAddress | ) |
Receives a byte that has been sent to the UART Module.
This function reads a byte of data from the UART receive data Register.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits of UCAxRXBUF register.
void USCI_A_UART_resetDormant | ( | uint16_t | baseAddress | ) |
Re-enables UART module from dormant mode.
Not dormant. All received characters set UCRXIFG.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits are UCDORM of UCAxCTL1 register.
void USCI_A_UART_setDormant | ( | uint16_t | baseAddress | ) |
Sets the UART module in dormant mode.
Puts USCI in sleep mode. Only characters that are preceded by an idle-line or with address bit set UCRXIFG. In UART mode with automatic baud-rate detection, only the combination of a break and sync field sets UCRXIFG.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits of UCAxCTL1 register.
void USCI_A_UART_transmitAddress | ( | uint16_t | baseAddress, |
uint8_t | transmitAddress | ||
) |
Transmits the next byte to be transmitted marked as address depending on selected multiprocessor mode.
baseAddress | is the base address of the USCI_A_UART module. |
transmitAddress | is the next byte to be transmitted |
Modified bits of UCAxTXBUF register and bits of UCAxCTL1 register.
void USCI_A_UART_transmitBreak | ( | uint16_t | baseAddress | ) |
Transmit break.
Transmits a break with the next write to the transmit buffer. In UART mode with automatic baud-rate detection, USCI_A_UART_AUTOMATICBAUDRATE_SYNC(0x55) must be written into UCAxTXBUF to generate the required break/sync fields. Otherwise, DEFAULT_SYNC(0x00) must be written into the transmit buffer. Also ensures module is ready for transmitting the next data.
baseAddress | is the base address of the USCI_A_UART module. |
Modified bits of UCAxTXBUF register and bits of UCAxCTL1 register.
void USCI_A_UART_transmitData | ( | uint16_t | baseAddress, |
uint8_t | transmitData | ||
) |
Transmits a byte from the UART Module.
This function will place the supplied data into UART transmit data register to start transmission
baseAddress | is the base address of the USCI_A_UART module. |
transmitData | data to be transmitted from the UART module |
Modified bits of UCAxTXBUF register.