Hardware access layer for managing the UART peripheral. More...
Data Structures | |
struct | nrf_uart_config_t |
Structure for UART transmission configuration. More... | |
Enumerations | |
enum | nrf_uart_task_t { NRF_UART_TASK_STARTRX = offsetof(NRF_UART_Type, TASKS_STARTRX) , NRF_UART_TASK_STOPRX = offsetof(NRF_UART_Type, TASKS_STOPRX) , NRF_UART_TASK_STARTTX = offsetof(NRF_UART_Type, TASKS_STARTTX) , NRF_UART_TASK_STOPTX = offsetof(NRF_UART_Type, TASKS_STOPTX) , NRF_UART_TASK_SUSPEND = offsetof(NRF_UART_Type, TASKS_SUSPEND) } |
UART tasks. More... | |
enum | nrf_uart_event_t { NRF_UART_EVENT_CTS = offsetof(NRF_UART_Type, EVENTS_CTS) , NRF_UART_EVENT_NCTS = offsetof(NRF_UART_Type, EVENTS_NCTS) , NRF_UART_EVENT_RXDRDY = offsetof(NRF_UART_Type, EVENTS_RXDRDY) , NRF_UART_EVENT_TXDRDY = offsetof(NRF_UART_Type, EVENTS_TXDRDY) , NRF_UART_EVENT_ERROR = offsetof(NRF_UART_Type, EVENTS_ERROR) , NRF_UART_EVENT_RXTO = offsetof(NRF_UART_Type, EVENTS_RXTO) } |
UART events. More... | |
enum | nrf_uart_int_mask_t { NRF_UART_INT_MASK_CTS = UART_INTENCLR_CTS_Msk , NRF_UART_INT_MASK_NCTS = UART_INTENCLR_NCTS_Msk , NRF_UART_INT_MASK_RXDRDY = UART_INTENCLR_RXDRDY_Msk , NRF_UART_INT_MASK_TXDRDY = UART_INTENCLR_TXDRDY_Msk , NRF_UART_INT_MASK_ERROR = UART_INTENCLR_ERROR_Msk , NRF_UART_INT_MASK_RXTO = UART_INTENCLR_RXTO_Msk } |
UART interrupts. More... | |
enum | nrf_uart_baudrate_t { NRF_UART_BAUDRATE_1200 = UART_BAUDRATE_BAUDRATE_Baud1200 , NRF_UART_BAUDRATE_2400 = UART_BAUDRATE_BAUDRATE_Baud2400 , NRF_UART_BAUDRATE_4800 = UART_BAUDRATE_BAUDRATE_Baud4800 , NRF_UART_BAUDRATE_9600 = UART_BAUDRATE_BAUDRATE_Baud9600 , NRF_UART_BAUDRATE_14400 = UART_BAUDRATE_BAUDRATE_Baud14400 , NRF_UART_BAUDRATE_19200 = UART_BAUDRATE_BAUDRATE_Baud19200 , NRF_UART_BAUDRATE_28800 = UART_BAUDRATE_BAUDRATE_Baud28800 , NRF_UART_BAUDRATE_31250 = UART_BAUDRATE_BAUDRATE_Baud31250 , NRF_UART_BAUDRATE_38400 = UART_BAUDRATE_BAUDRATE_Baud38400 , NRF_UART_BAUDRATE_56000 = UART_BAUDRATE_BAUDRATE_Baud56000 , NRF_UART_BAUDRATE_57600 = UART_BAUDRATE_BAUDRATE_Baud57600 , NRF_UART_BAUDRATE_76800 = UART_BAUDRATE_BAUDRATE_Baud76800 , NRF_UART_BAUDRATE_115200 = UART_BAUDRATE_BAUDRATE_Baud115200 , NRF_UART_BAUDRATE_230400 = UART_BAUDRATE_BAUDRATE_Baud230400 , NRF_UART_BAUDRATE_250000 = UART_BAUDRATE_BAUDRATE_Baud250000 , NRF_UART_BAUDRATE_460800 = UART_BAUDRATE_BAUDRATE_Baud460800 , NRF_UART_BAUDRATE_921600 = UART_BAUDRATE_BAUDRATE_Baud921600 , NRF_UART_BAUDRATE_1000000 = UART_BAUDRATE_BAUDRATE_Baud1M } |
Baudrates supported by UART. More... | |
enum | nrf_uart_error_mask_t { NRF_UART_ERROR_OVERRUN_MASK = UART_ERRORSRC_OVERRUN_Msk , NRF_UART_ERROR_PARITY_MASK = UART_ERRORSRC_PARITY_Msk , NRF_UART_ERROR_FRAMING_MASK = UART_ERRORSRC_FRAMING_Msk , NRF_UART_ERROR_BREAK_MASK = UART_ERRORSRC_BREAK_Msk } |
Types of UART error masks. More... | |
enum | nrf_uart_parity_t { NRF_UART_PARITY_EXCLUDED = UART_CONFIG_PARITY_Excluded << UART_CONFIG_PARITY_Pos , NRF_UART_PARITY_INCLUDED = UART_CONFIG_PARITY_Included << UART_CONFIG_PARITY_Pos } |
Types of UART parity modes. More... | |
enum | nrf_uart_hwfc_t { NRF_UART_HWFC_DISABLED = UART_CONFIG_HWFC_Disabled , NRF_UART_HWFC_ENABLED = UART_CONFIG_HWFC_Enabled } |
Types of UART flow control modes. More... | |
enum | nrf_uart_stop_t { NRF_UART_STOP_ONE = UART_CONFIG_STOP_One << UART_CONFIG_STOP_Pos , NRF_UART_STOP_TWO = UART_CONFIG_STOP_Two << UART_CONFIG_STOP_Pos } |
Types of UART stop bit modes. More... | |
enum | nrf_uart_paritytype_t { NRF_UART_PARITYTYPE_EVEN = UART_CONFIG_PARITYTYPE_Even << UART_CONFIG_PARITYTYPE_Pos , NRF_UART_PARITYTYPE_ODD = UART_CONFIG_PARITYTYPE_Odd << UART_CONFIG_PARITYTYPE_Pos } |
Types of UART parity types. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_uart_event_clear (NRF_UART_Type *p_reg, nrf_uart_event_t event) |
Function for clearing the specified UART event. | |
NRF_STATIC_INLINE bool | nrf_uart_event_check (NRF_UART_Type const *p_reg, nrf_uart_event_t event) |
Function for retrieving the state of the UART event. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_event_address_get (NRF_UART_Type const *p_reg, nrf_uart_event_t event) |
Function for returning the address of the specified UART event register. | |
NRF_STATIC_INLINE void | nrf_uart_int_enable (NRF_UART_Type *p_reg, uint32_t mask) |
Function for enabling the specified interrupt. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_int_enable_check (NRF_UART_Type const *p_reg, uint32_t mask) |
Function for checking if the specified interrupts are enabled. | |
NRF_STATIC_INLINE void | nrf_uart_int_disable (NRF_UART_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupts. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_errorsrc_get_and_clear (NRF_UART_Type *p_reg) |
Function for getting error source mask. Function is clearing error source flags after reading. | |
NRF_STATIC_INLINE void | nrf_uart_enable (NRF_UART_Type *p_reg) |
Function for enabling UART. | |
NRF_STATIC_INLINE void | nrf_uart_disable (NRF_UART_Type *p_reg) |
Function for disabling UART. | |
NRF_STATIC_INLINE void | nrf_uart_txrx_pins_set (NRF_UART_Type *p_reg, uint32_t pseltxd, uint32_t pselrxd) |
Function for configuring TX/RX pins. | |
NRF_STATIC_INLINE void | nrf_uart_txrx_pins_disconnect (NRF_UART_Type *p_reg) |
Function for disconnecting TX/RX pins. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_tx_pin_get (NRF_UART_Type const *p_reg) |
Function for getting TX pin selection. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_rx_pin_get (NRF_UART_Type const *p_reg) |
Function for getting RX pin selection. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_rts_pin_get (NRF_UART_Type const *p_reg) |
Function for getting RTS pin selection. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_cts_pin_get (NRF_UART_Type const *p_reg) |
Function for getting CTS pin selection. | |
NRF_STATIC_INLINE void | nrf_uart_hwfc_pins_set (NRF_UART_Type *p_reg, uint32_t pselrts, uint32_t pselcts) |
Function for configuring flow control pins. | |
NRF_STATIC_INLINE void | nrf_uart_hwfc_pins_disconnect (NRF_UART_Type *p_reg) |
Function for disconnecting flow control pins. | |
NRF_STATIC_INLINE uint8_t | nrf_uart_rxd_get (NRF_UART_Type const *p_reg) |
Function for reading RX data. | |
NRF_STATIC_INLINE void | nrf_uart_txd_set (NRF_UART_Type *p_reg, uint8_t txd) |
Function for setting Tx data. | |
NRF_STATIC_INLINE void | nrf_uart_task_trigger (NRF_UART_Type *p_reg, nrf_uart_task_t task) |
Function for starting an UART task. | |
NRF_STATIC_INLINE uint32_t | nrf_uart_task_address_get (NRF_UART_Type const *p_reg, nrf_uart_task_t task) |
Function for returning the address of the specified task register. | |
NRF_STATIC_INLINE void | nrf_uart_configure (NRF_UART_Type *p_reg, nrf_uart_config_t const *p_cfg) |
Function for configuring UART. | |
NRF_STATIC_INLINE void | nrf_uart_baudrate_set (NRF_UART_Type *p_reg, nrf_uart_baudrate_t baudrate) |
Function for setting UART baud rate. | |
Hardware access layer for managing the UART peripheral.
enum nrf_uart_baudrate_t |
Baudrates supported by UART.
enum nrf_uart_event_t |
UART events.
enum nrf_uart_hwfc_t |
enum nrf_uart_int_mask_t |
UART interrupts.
enum nrf_uart_parity_t |
enum nrf_uart_stop_t |
enum nrf_uart_task_t |
NRF_STATIC_INLINE void nrf_uart_baudrate_set | ( | NRF_UART_Type * | p_reg, |
nrf_uart_baudrate_t | baudrate | ||
) |
Function for setting UART baud rate.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | baudrate | Baud rate. |
NRF_STATIC_INLINE void nrf_uart_configure | ( | NRF_UART_Type * | p_reg, |
nrf_uart_config_t const * | p_cfg | ||
) |
Function for configuring UART.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_cfg | Pointer to UART settings structure. |
NRF_STATIC_INLINE uint32_t nrf_uart_cts_pin_get | ( | NRF_UART_Type const * | p_reg | ) |
Function for getting CTS pin selection.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_uart_disable | ( | NRF_UART_Type * | p_reg | ) |
Function for disabling UART.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_uart_enable | ( | NRF_UART_Type * | p_reg | ) |
Function for enabling UART.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE uint32_t nrf_uart_errorsrc_get_and_clear | ( | NRF_UART_Type * | p_reg | ) |
Function for getting error source mask. Function is clearing error source flags after reading.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE uint32_t nrf_uart_event_address_get | ( | NRF_UART_Type const * | p_reg, |
nrf_uart_event_t | event | ||
) |
Function for returning the address of the specified UART event register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Desired event. |
NRF_STATIC_INLINE bool nrf_uart_event_check | ( | NRF_UART_Type const * | p_reg, |
nrf_uart_event_t | event | ||
) |
Function for retrieving the state of the UART event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
true | The event has been generated. |
false | The event has not been generated. |
NRF_STATIC_INLINE void nrf_uart_event_clear | ( | NRF_UART_Type * | p_reg, |
nrf_uart_event_t | event | ||
) |
Function for clearing the specified UART event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to clear. |
NRF_STATIC_INLINE void nrf_uart_hwfc_pins_disconnect | ( | NRF_UART_Type * | p_reg | ) |
Function for disconnecting flow control pins.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_uart_hwfc_pins_set | ( | NRF_UART_Type * | p_reg, |
uint32_t | pselrts, | ||
uint32_t | pselcts | ||
) |
Function for configuring flow control pins.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pselrts | RTS pin number. |
[in] | pselcts | CTS pin number. |
NRF_STATIC_INLINE void nrf_uart_int_disable | ( | NRF_UART_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_uart_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_uart_int_enable | ( | NRF_UART_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified interrupt.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_uart_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_uart_int_enable_check | ( | NRF_UART_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_uart_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_uart_rts_pin_get | ( | NRF_UART_Type const * | p_reg | ) |
Function for getting RTS pin selection.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE uint32_t nrf_uart_rx_pin_get | ( | NRF_UART_Type const * | p_reg | ) |
Function for getting RX pin selection.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE uint8_t nrf_uart_rxd_get | ( | NRF_UART_Type const * | p_reg | ) |
Function for reading RX data.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE uint32_t nrf_uart_task_address_get | ( | NRF_UART_Type const * | p_reg, |
nrf_uart_task_t | task | ||
) |
Function for returning the address of the specified task register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task. |
NRF_STATIC_INLINE void nrf_uart_task_trigger | ( | NRF_UART_Type * | p_reg, |
nrf_uart_task_t | task | ||
) |
Function for starting an UART task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task. |
NRF_STATIC_INLINE uint32_t nrf_uart_tx_pin_get | ( | NRF_UART_Type const * | p_reg | ) |
Function for getting TX pin selection.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_uart_txd_set | ( | NRF_UART_Type * | p_reg, |
uint8_t | txd | ||
) |
Function for setting Tx data.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | txd | Byte. |
NRF_STATIC_INLINE void nrf_uart_txrx_pins_disconnect | ( | NRF_UART_Type * | p_reg | ) |
Function for disconnecting TX/RX pins.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_uart_txrx_pins_set | ( | NRF_UART_Type * | p_reg, |
uint32_t | pseltxd, | ||
uint32_t | pselrxd | ||
) |
Function for configuring TX/RX pins.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pseltxd | TXD pin number. |
[in] | pselrxd | RXD pin number. |