Interface: tos.platform.msp430.HPLUSARTControl

interface HPLUSARTControl

Commands
command void disableI2C() Disables the I2C module
command result_t disableRxIntr()
command void disableSPI() Disables the USART when in SPI mode.
command result_t disableTxIntr()
command void disableUART() Disables both the Rx and the Tx UART modules.
command void disableUARTRx() Disables the UART RX module.
command void disableUARTTx() Disables the UART TX module.
command void enableI2C() Enables the I2C module (register flags)
command result_t enableRxIntr()
command void enableSPI() Enables the USART when in SPI mode.
command result_t enableTxIntr()
command void enableUART() Enables both the Rx and the Tx UART modules.
command void enableUARTRx() Enables the UART RX functionality of the USART module.
command void enableUARTTx() Enables the UART TX functionality of the USART module.
command msp430_usartmode_t getMode() Returns an enum value corresponding to the current mode of the USART module.
command bool isI2C() Returns TRUE if the module is set to I2C mode for MSP430 parts that support hardware I2C.
command result_t isRxIntrPending() SUCCESS if RX interrupt pending, flag is cleared automatically
command bool isSPI() Returns TRUE if the USART is set to SPI mode
command result_t isTxEmpty() SUCCESS if the TX buffer is empty and all of the bits have been shifted out
command result_t isTxIntrPending() SUCCESS if TX interrupt pending, flag is cleared automatically
command bool isUART() Returns TRUE if the USART is set to UART mode (both RX and TX)
command bool isUARTrx() Returns TRUE if the USART has UART RX mode enabled
command bool isUARTtx() Returns TRUE if the USART has UART TX mode enabled
command uint8_t rx() Get current value from RX-buffer.
command void setClockRate(uint16_t baudrate, uint8_t mctl)
command void setClockSource(uint8_t source)
command void setMode(msp430_usartmode_t mode) Sets the USART mode to one of the options from msp430_usartmode_t defined in MSP430USART.h
command void setModeI2C() Switches USART to I2C mode for MSP430 parts that support hardware I2C.
command void setModeSPI() Switches USART to SPI mode.
command void setModeUART() Switches USART to UART mode (RX and TX enabled) Interrupts disabled by default.
command void setModeUART_RX() Switches USART to UART RX mode (TX pins disabled)..
command void setModeUART_TX() Switches USART to UART TX mode (RX pins disabled).
command result_t tx(uint8_t data) Transmit a byte of data.

Commands - Details

disableI2C

command void disableI2C()

Disables the I2C module

disableRxIntr

command result_t disableRxIntr()

disableSPI

command void disableSPI()

Disables the USART when in SPI mode.

disableTxIntr

command result_t disableTxIntr()

disableUART

command void disableUART()

Disables both the Rx and the Tx UART modules.

disableUARTRx

command void disableUARTRx()

Disables the UART RX module.

disableUARTTx

command void disableUARTTx()

Disables the UART TX module.

enableI2C

command void enableI2C()

Enables the I2C module (register flags)

enableRxIntr

command result_t enableRxIntr()

enableSPI

command void enableSPI()

Enables the USART when in SPI mode.

enableTxIntr

command result_t enableTxIntr()

enableUART

command void enableUART()

Enables both the Rx and the Tx UART modules.

enableUARTRx

command void enableUARTRx()

Enables the UART RX functionality of the USART module.

enableUARTTx

command void enableUARTTx()

Enables the UART TX functionality of the USART module.

getMode

command msp430_usartmode_t getMode()

Returns an enum value corresponding to the current mode of the USART module. Allows one to read the module mode, change it, and then reset it back to its original state after use.

isI2C

command bool isI2C()

Returns TRUE if the module is set to I2C mode for MSP430 parts that support hardware I2C.

isRxIntrPending

command result_t isRxIntrPending()

SUCCESS if RX interrupt pending, flag is cleared automatically

isSPI

command bool isSPI()

Returns TRUE if the USART is set to SPI mode

isTxEmpty

command result_t isTxEmpty()

SUCCESS if the TX buffer is empty and all of the bits have been shifted out

isTxIntrPending

command result_t isTxIntrPending()

SUCCESS if TX interrupt pending, flag is cleared automatically

isUART

command bool isUART()

Returns TRUE if the USART is set to UART mode (both RX and TX)

isUARTrx

command bool isUARTrx()

Returns TRUE if the USART has UART RX mode enabled

isUARTtx

command bool isUARTtx()

Returns TRUE if the USART has UART TX mode enabled

rx

command uint8_t rx()

Get current value from RX-buffer.

Returns:
SUCCESS always.

setClockRate

command void setClockRate(uint16_t baudrate, uint8_t mctl)

setClockSource

command void setClockSource(uint8_t source)

setMode

command void setMode(msp430_usartmode_t mode)

Sets the USART mode to one of the options from msp430_usartmode_t defined in MSP430USART.h

Returns:
SUCCESS if the mode was changed

setModeI2C

command void setModeI2C()

Switches USART to I2C mode for MSP430 parts that support hardware I2C. Interrupts disabled by default.

setModeSPI

command void setModeSPI()

Switches USART to SPI mode.

setModeUART

command void setModeUART()

Switches USART to UART mode (RX and TX enabled) Interrupts disabled by default.

setModeUART_RX

command void setModeUART_RX()

Switches USART to UART RX mode (TX pins disabled).. Interrupts disabled by default.

setModeUART_TX

command void setModeUART_TX()

Switches USART to UART TX mode (RX pins disabled). Interrupts disabled by default.

tx

command result_t tx(uint8_t data)

Transmit a byte of data. When the transmission is completed, txDone is generated. Only then a new byte may be transmitted, otherwise the previous byte will be overwritten. The mode of transmission (UART or SPI) depends on the current state of the USART, which must be managed by a higher layer.

Returns:
SUCCESS always.