Hardware access layer for managing the UARTE peripheral. More...
Enumerations | |
enum | nrf_uarte_task_t { NRF_UARTE_TASK_STARTRX = offsetof(NRF_UARTE_Type, TASKS_STARTRX), NRF_UARTE_TASK_STOPRX = offsetof(NRF_UARTE_Type, TASKS_STOPRX), NRF_UARTE_TASK_STARTTX = offsetof(NRF_UARTE_Type, TASKS_STARTTX), NRF_UARTE_TASK_STOPTX = offsetof(NRF_UARTE_Type, TASKS_STOPTX), NRF_UARTE_TASK_FLUSHRX = offsetof(NRF_UARTE_Type, TASKS_FLUSHRX) } |
UARTE tasks. More... | |
enum | nrf_uarte_event_t { NRF_UARTE_EVENT_CTS = offsetof(NRF_UARTE_Type, EVENTS_CTS), NRF_UARTE_EVENT_NCTS = offsetof(NRF_UARTE_Type, EVENTS_NCTS), NRF_UARTE_EVENT_RXDRDY = offsetof(NRF_UARTE_Type, EVENTS_RXDRDY), NRF_UARTE_EVENT_ENDRX = offsetof(NRF_UARTE_Type, EVENTS_ENDRX), NRF_UARTE_EVENT_TXDRDY = offsetof(NRF_UARTE_Type, EVENTS_TXDRDY), NRF_UARTE_EVENT_ENDTX = offsetof(NRF_UARTE_Type, EVENTS_ENDTX), NRF_UARTE_EVENT_ERROR = offsetof(NRF_UARTE_Type, EVENTS_ERROR), NRF_UARTE_EVENT_RXTO = offsetof(NRF_UARTE_Type, EVENTS_RXTO), NRF_UARTE_EVENT_RXSTARTED = offsetof(NRF_UARTE_Type, EVENTS_RXSTARTED), NRF_UARTE_EVENT_TXSTARTED = offsetof(NRF_UARTE_Type, EVENTS_TXSTARTED), NRF_UARTE_EVENT_TXSTOPPED = offsetof(NRF_UARTE_Type, EVENTS_TXSTOPPED) } |
UARTE events. More... | |
enum | nrf_uarte_short_t { NRF_UARTE_SHORT_ENDRX_STARTRX = UARTE_SHORTS_ENDRX_STARTRX_Msk, NRF_UARTE_SHORT_ENDRX_STOPRX = UARTE_SHORTS_ENDRX_STOPRX_Msk } |
Types of UARTE shortcuts. More... | |
enum | nrf_uarte_int_mask_t { NRF_UARTE_INT_CTS_MASK = UARTE_INTENSET_CTS_Msk, NRF_UARTE_INT_NCTS_MASK = UARTE_INTENSET_NCTS_Msk, NRF_UARTE_INT_RXDRDY_MASK = UARTE_INTENSET_RXDRDY_Msk, NRF_UARTE_INT_ENDRX_MASK = UARTE_INTENSET_ENDRX_Msk, NRF_UARTE_INT_TXDRDY_MASK = UARTE_INTENSET_TXDRDY_Msk, NRF_UARTE_INT_ENDTX_MASK = UARTE_INTENSET_ENDTX_Msk, NRF_UARTE_INT_ERROR_MASK = UARTE_INTENSET_ERROR_Msk, NRF_UARTE_INT_RXTO_MASK = UARTE_INTENSET_RXTO_Msk, NRF_UARTE_INT_RXSTARTED_MASK = UARTE_INTENSET_RXSTARTED_Msk, NRF_UARTE_INT_TXSTARTED_MASK = UARTE_INTENSET_TXSTARTED_Msk, NRF_UARTE_INT_TXSTOPPED_MASK = UARTE_INTENSET_TXSTOPPED_Msk } |
UARTE interrupts. More... | |
enum | nrf_uarte_baudrate_t { NRF_UARTE_BAUDRATE_1200 = UARTE_BAUDRATE_BAUDRATE_Baud1200, NRF_UARTE_BAUDRATE_2400 = UARTE_BAUDRATE_BAUDRATE_Baud2400, NRF_UARTE_BAUDRATE_4800 = UARTE_BAUDRATE_BAUDRATE_Baud4800, NRF_UARTE_BAUDRATE_9600 = UARTE_BAUDRATE_BAUDRATE_Baud9600, NRF_UARTE_BAUDRATE_14400 = UARTE_BAUDRATE_BAUDRATE_Baud14400, NRF_UARTE_BAUDRATE_19200 = UARTE_BAUDRATE_BAUDRATE_Baud19200, NRF_UARTE_BAUDRATE_28800 = UARTE_BAUDRATE_BAUDRATE_Baud28800, NRF_UARTE_BAUDRATE_31250 = UARTE_BAUDRATE_BAUDRATE_Baud31250, NRF_UARTE_BAUDRATE_38400 = UARTE_BAUDRATE_BAUDRATE_Baud38400, NRF_UARTE_BAUDRATE_56000 = UARTE_BAUDRATE_BAUDRATE_Baud56000, NRF_UARTE_BAUDRATE_57600 = UARTE_BAUDRATE_BAUDRATE_Baud57600, NRF_UARTE_BAUDRATE_76800 = UARTE_BAUDRATE_BAUDRATE_Baud76800, NRF_UARTE_BAUDRATE_115200 = UARTE_BAUDRATE_BAUDRATE_Baud115200, NRF_UARTE_BAUDRATE_230400 = UARTE_BAUDRATE_BAUDRATE_Baud230400, NRF_UARTE_BAUDRATE_250000 = UARTE_BAUDRATE_BAUDRATE_Baud250000, NRF_UARTE_BAUDRATE_460800 = UARTE_BAUDRATE_BAUDRATE_Baud460800, NRF_UARTE_BAUDRATE_921600 = UARTE_BAUDRATE_BAUDRATE_Baud921600, NRF_UARTE_BAUDRATE_1000000 = UARTE_BAUDRATE_BAUDRATE_Baud1M } |
Baudrates supported by UARTE. More... | |
enum | nrf_uarte_error_mask_t { NRF_UARTE_ERROR_OVERRUN_MASK = UARTE_ERRORSRC_OVERRUN_Msk, NRF_UARTE_ERROR_PARITY_MASK = UARTE_ERRORSRC_PARITY_Msk, NRF_UARTE_ERROR_FRAMING_MASK = UARTE_ERRORSRC_FRAMING_Msk, NRF_UARTE_ERROR_BREAK_MASK = UARTE_ERRORSRC_BREAK_Msk } |
Types of UARTE error masks. More... | |
enum | nrf_uarte_parity_t { NRF_UARTE_PARITY_EXCLUDED = UARTE_CONFIG_PARITY_Excluded << UARTE_CONFIG_PARITY_Pos, NRF_UARTE_PARITY_INCLUDED = UARTE_CONFIG_PARITY_Included << UARTE_CONFIG_PARITY_Pos } |
Types of UARTE parity modes. More... | |
enum | nrf_uarte_hwfc_t { NRF_UARTE_HWFC_DISABLED = UARTE_CONFIG_HWFC_Disabled << UARTE_CONFIG_HWFC_Pos, NRF_UARTE_HWFC_ENABLED = UARTE_CONFIG_HWFC_Enabled << UARTE_CONFIG_HWFC_Pos } |
Types of UARTE flow control modes. More... | |
Functions | |
__STATIC_INLINE void | nrf_uarte_event_clear (NRF_UARTE_Type *p_reg, nrf_uarte_event_t event) |
Function for clearing the specified UARTE event. More... | |
__STATIC_INLINE bool | nrf_uarte_event_check (NRF_UARTE_Type *p_reg, nrf_uarte_event_t event) |
Function for retrieving the state of the UARTE event. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_event_address_get (NRF_UARTE_Type *p_reg, nrf_uarte_event_t event) |
Function for returning the address of the specified UARTE event register. More... | |
__STATIC_INLINE void | nrf_uarte_shorts_enable (NRF_UARTE_Type *p_reg, uint32_t mask) |
Function for enabling UARTE shortcuts. More... | |
__STATIC_INLINE void | nrf_uarte_shorts_disable (NRF_UARTE_Type *p_reg, uint32_t mask) |
Function for disabling UARTE shortcuts. More... | |
__STATIC_INLINE void | nrf_uarte_int_enable (NRF_UARTE_Type *p_reg, uint32_t mask) |
Function for enabling UARTE interrupts. More... | |
__STATIC_INLINE bool | nrf_uarte_int_enable_check (NRF_UARTE_Type *p_reg, nrf_uarte_int_mask_t mask) |
Function for retrieving the state of the specified interrupt. More... | |
__STATIC_INLINE void | nrf_uarte_int_disable (NRF_UARTE_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupts. More... | |
__STATIC_INLINE void | nrf_uarte_subscribe_set (NRF_UARTE_Type *p_reg, nrf_uarte_task_t task, uint8_t channel) |
Function for setting the subscribe configuration for a given UARTE task. More... | |
__STATIC_INLINE void | nrf_uarte_subscribe_clear (NRF_UARTE_Type *p_reg, nrf_uarte_task_t task) |
Function for clearing the subscribe configuration for a given UARTE task. More... | |
__STATIC_INLINE void | nrf_uarte_publish_set (NRF_UARTE_Type *p_reg, nrf_uarte_event_t event, uint8_t channel) |
Function for setting the publish configuration for a given UARTE event. More... | |
__STATIC_INLINE void | nrf_uarte_publish_clear (NRF_UARTE_Type *p_reg, nrf_uarte_event_t event) |
Function for clearing the publish configuration for a given UARTE event. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_errorsrc_get_and_clear (NRF_UARTE_Type *p_reg) |
Function for getting error source mask. Function is clearing error source flags after reading. More... | |
__STATIC_INLINE void | nrf_uarte_enable (NRF_UARTE_Type *p_reg) |
Function for enabling UARTE. More... | |
__STATIC_INLINE void | nrf_uarte_disable (NRF_UARTE_Type *p_reg) |
Function for disabling UARTE. More... | |
__STATIC_INLINE void | nrf_uarte_txrx_pins_set (NRF_UARTE_Type *p_reg, uint32_t pseltxd, uint32_t pselrxd) |
Function for configuring TX/RX pins. More... | |
__STATIC_INLINE void | nrf_uarte_txrx_pins_disconnect (NRF_UARTE_Type *p_reg) |
Function for disconnecting TX/RX pins. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_tx_pin_get (NRF_UARTE_Type *p_reg) |
Function for getting TX pin. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_rx_pin_get (NRF_UARTE_Type *p_reg) |
Function for getting RX pin. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_rts_pin_get (NRF_UARTE_Type *p_reg) |
Function for getting RTS pin. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_cts_pin_get (NRF_UARTE_Type *p_reg) |
Function for getting CTS pin. More... | |
__STATIC_INLINE void | nrf_uarte_hwfc_pins_set (NRF_UARTE_Type *p_reg, uint32_t pselrts, uint32_t pselcts) |
Function for configuring flow control pins. More... | |
__STATIC_INLINE void | nrf_uarte_hwfc_pins_disconnect (NRF_UARTE_Type *p_reg) |
Function for disconnecting flow control pins. More... | |
__STATIC_INLINE void | nrf_uarte_task_trigger (NRF_UARTE_Type *p_reg, nrf_uarte_task_t task) |
Function for starting an UARTE task. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_task_address_get (NRF_UARTE_Type *p_reg, nrf_uarte_task_t task) |
Function for returning the address of the specified task register. More... | |
__STATIC_INLINE void | nrf_uarte_configure (NRF_UARTE_Type *p_reg, nrf_uarte_parity_t parity, nrf_uarte_hwfc_t hwfc) |
Function for configuring UARTE. More... | |
__STATIC_INLINE void | nrf_uarte_baudrate_set (NRF_UARTE_Type *p_reg, nrf_uarte_baudrate_t baudrate) |
Function for setting UARTE baud rate. More... | |
__STATIC_INLINE void | nrf_uarte_tx_buffer_set (NRF_UARTE_Type *p_reg, uint8_t const *p_buffer, size_t length) |
Function for setting the transmit buffer. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_tx_amount_get (NRF_UARTE_Type *p_reg) |
Function for getting number of bytes transmitted in the last transaction. More... | |
__STATIC_INLINE void | nrf_uarte_rx_buffer_set (NRF_UARTE_Type *p_reg, uint8_t *p_buffer, size_t length) |
Function for setting the receive buffer. More... | |
__STATIC_INLINE uint32_t | nrf_uarte_rx_amount_get (NRF_UARTE_Type *p_reg) |
Function for getting number of bytes received in the last transaction. More... | |
Hardware access layer for managing the UARTE peripheral.
enum nrf_uarte_baudrate_t |
Baudrates supported by UARTE.
enum nrf_uarte_event_t |
UARTE events.
enum nrf_uarte_hwfc_t |
enum nrf_uarte_int_mask_t |
UARTE interrupts.
enum nrf_uarte_parity_t |
enum nrf_uarte_short_t |
enum nrf_uarte_task_t |
__STATIC_INLINE void nrf_uarte_baudrate_set | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_baudrate_t | baudrate | ||
) |
Function for setting UARTE baud rate.
p_reg | Pointer to the structure of registers of the peripheral. |
baudrate | Baud rate. |
__STATIC_INLINE void nrf_uarte_configure | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_parity_t | parity, | ||
nrf_uarte_hwfc_t | hwfc | ||
) |
Function for configuring UARTE.
p_reg | Pointer to the structure of registers of the peripheral. |
hwfc | Hardware flow control. Enabled if true. |
parity | Parity. Included if true. |
__STATIC_INLINE uint32_t nrf_uarte_cts_pin_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting CTS pin.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_disable | ( | NRF_UARTE_Type * | p_reg | ) |
Function for disabling UARTE.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_enable | ( | NRF_UARTE_Type * | p_reg | ) |
Function for enabling UARTE.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE uint32_t nrf_uarte_errorsrc_get_and_clear | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting error source mask. Function is clearing error source flags after reading.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE uint32_t nrf_uarte_event_address_get | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_event_t | event | ||
) |
Function for returning the address of the specified UARTE event register.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | The specified event. |
__STATIC_INLINE bool nrf_uarte_event_check | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_event_t | event | ||
) |
Function for retrieving the state of the UARTE 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. |
__STATIC_INLINE void nrf_uarte_event_clear | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_event_t | event | ||
) |
Function for clearing the specified UARTE event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to clear. |
__STATIC_INLINE void nrf_uarte_hwfc_pins_disconnect | ( | NRF_UARTE_Type * | p_reg | ) |
Function for disconnecting flow control pins.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_hwfc_pins_set | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | pselrts, | ||
uint32_t | pselcts | ||
) |
Function for configuring flow control pins.
p_reg | Pointer to the structure of registers of the peripheral. |
pselrts | RTS pin number. |
pselcts | CTS pin number. |
__STATIC_INLINE void nrf_uarte_int_disable | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupts.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Mask of interrupts to be disabled. |
__STATIC_INLINE void nrf_uarte_int_enable | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling UARTE interrupts.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Mask of interrupts to be enabled. |
__STATIC_INLINE bool nrf_uarte_int_enable_check | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_int_mask_t | mask | ||
) |
Function for retrieving the state of the specified interrupt.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Mask of interrupts to be checked. |
true | The interrupt is enabled. |
false | The interrupt is not enabled. |
__STATIC_INLINE void nrf_uarte_publish_clear | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_event_t | event | ||
) |
Function for clearing the publish configuration for a given UARTE event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to clear the configuration. |
__STATIC_INLINE void nrf_uarte_publish_set | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_event_t | event, | ||
uint8_t | channel | ||
) |
Function for setting the publish configuration for a given UARTE event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event for which to set the configuration. |
[in] | channel | Channel through which to publish the event. |
__STATIC_INLINE uint32_t nrf_uarte_rts_pin_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting RTS pin.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE uint32_t nrf_uarte_rx_amount_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting number of bytes received in the last transaction.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Amount | of bytes received. |
__STATIC_INLINE void nrf_uarte_rx_buffer_set | ( | NRF_UARTE_Type * | p_reg, |
uint8_t * | p_buffer, | ||
size_t | length | ||
) |
Function for setting the receive buffer.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_buffer | Pointer to the buffer for received data. |
[in] | length | Maximum number of data bytes to receive. |
__STATIC_INLINE uint32_t nrf_uarte_rx_pin_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting RX pin.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_shorts_disable | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling UARTE shortcuts.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Shortcuts to be disabled. |
__STATIC_INLINE void nrf_uarte_shorts_enable | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling UARTE shortcuts.
p_reg | Pointer to the structure of registers of the peripheral. |
mask | Shortcuts to be enabled. |
__STATIC_INLINE void nrf_uarte_subscribe_clear | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_task_t | task | ||
) |
Function for clearing the subscribe configuration for a given UARTE task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to clear the configuration. |
__STATIC_INLINE void nrf_uarte_subscribe_set | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_task_t | task, | ||
uint8_t | channel | ||
) |
Function for setting the subscribe configuration for a given UARTE task.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task for which to set the configuration. |
[in] | channel | Channel through which to subscribe events. |
__STATIC_INLINE uint32_t nrf_uarte_task_address_get | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_task_t | task | ||
) |
Function for returning the address of the specified task register.
p_reg | Pointer to the structure of registers of the peripheral. |
task | Task. |
__STATIC_INLINE void nrf_uarte_task_trigger | ( | NRF_UARTE_Type * | p_reg, |
nrf_uarte_task_t | task | ||
) |
Function for starting an UARTE task.
p_reg | Pointer to the structure of registers of the peripheral. |
task | Task. |
__STATIC_INLINE uint32_t nrf_uarte_tx_amount_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting number of bytes transmitted in the last transaction.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
Amount | of bytes transmitted. |
__STATIC_INLINE void nrf_uarte_tx_buffer_set | ( | NRF_UARTE_Type * | p_reg, |
uint8_t const * | p_buffer, | ||
size_t | length | ||
) |
Function for setting the transmit buffer.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_buffer | Pointer to the buffer with data to send. |
[in] | length | Maximum number of data bytes to transmit. |
__STATIC_INLINE uint32_t nrf_uarte_tx_pin_get | ( | NRF_UARTE_Type * | p_reg | ) |
Function for getting TX pin.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_txrx_pins_disconnect | ( | NRF_UARTE_Type * | p_reg | ) |
Function for disconnecting TX/RX pins.
p_reg | Pointer to the structure of registers of the peripheral. |
__STATIC_INLINE void nrf_uarte_txrx_pins_set | ( | NRF_UARTE_Type * | p_reg, |
uint32_t | pseltxd, | ||
uint32_t | pselrxd | ||
) |
Function for configuring TX/RX pins.
p_reg | Pointer to the structure of registers of the peripheral. |
pseltxd | TXD pin number. |
pselrxd | RXD pin number. |