Module for reliable communication over UARTE. More...
Modules | |
libUARTE library configuration | |
Data Structures | |
struct | nrf_libuarte_drv_data_t |
struct | nrf_libuarte_drv_overrun_err_evt_t |
struct | nrf_libuarte_drv_evt_t |
struct | nrf_libuarte_drv_config_t |
struct | nrf_libuarte_drv_ctrl_blk_t |
struct | nrf_libuarte_drv_t |
Macros | |
#define | NRF_LIBUARTE_DRV_HWFC_BYTE_LIMIT 4 |
#define | NRF_LIBUARTE_DRV_DEFINE(_name, _uarte_idx, _timer_idx) |
Typedefs | |
typedef void(* | nrf_libuarte_drv_evt_handler_t )(void *context, nrf_libuarte_drv_evt_t *p_evt) |
Enumerations | |
enum | nrf_libuarte_drv_evt_type_t { NRF_LIBUARTE_DRV_EVT_RX_DATA, NRF_LIBUARTE_DRV_EVT_RX_BUF_REQ, NRF_LIBUARTE_DRV_EVT_TX_DONE, NRF_LIBUARTE_DRV_EVT_ERROR, NRF_LIBUARTE_DRV_EVT_OVERRUN_ERROR } |
enum | nrf_libuarte_drv_ppi_channel_t { NRF_LIBUARTE_DRV_PPI_CH_EXT_TRIGGER_STARTRX_EN_ENDRX_STARTX, NRF_LIBUARTE_DRV_PPI_CH_RXSTARTED_EXT_TSK, NRF_LIBUARTE_DRV_PPI_CH_EXT_STOP_STOPRX, NRF_LIBUARTE_DRV_PPI_CH_EXT_STOP_GROUPS_EN, NRF_LIBUARTE_DRV_PPI_CH_RXRDY_TIMER_COUNT, NRF_LIBUARTE_DRV_PPI_CH_ENDRX_STARTRX, NRF_LIBUARTE_DRV_PPI_CH_ENDRX_EXT_TSK, NRF_LIBUARTE_DRV_PPI_CH_RTS_PIN, NRF_LIBUARTE_DRV_PPI_CH_RX_MAX, NRF_LIBUARTE_DRV_PPI_CH_RX_GROUP_MAX = NRF_LIBUARTE_DRV_PPI_CH_RX_MAX, NRF_LIBUARTE_DRV_PPI_CH_ENDTX_STARTTX = NRF_LIBUARTE_DRV_PPI_CH_RX_GROUP_MAX, NRF_LIBUARTE_DRV_PPI_CH_MAX } |
PPI channels used by libuarte. | |
enum | nrf_libuarte_drv_ppi_group_t { NRF_LIBUARTE_DRV_PPI_GROUP_ENDRX_STARTRX, NRF_LIBUARTE_DRV_PPI_GROUP_ENDRX_EXT_RXDONE_TSK, NRF_LIBUARTE_DRV_PPI_GROUP_MAX } |
PPI groups used by libuarte. More... | |
Functions | |
ret_code_t | nrf_libuarte_drv_init (const nrf_libuarte_drv_t *const p_libuarte, nrf_libuarte_drv_config_t *p_config, nrf_libuarte_drv_evt_handler_t evt_handler, void *context) |
Function for initializing the libUARTE library. More... | |
void | nrf_libuarte_drv_uninit (const nrf_libuarte_drv_t *const p_libuarte) |
Function for uninitializing the libUARTE library. More... | |
ret_code_t | nrf_libuarte_drv_tx (const nrf_libuarte_drv_t *const p_libuarte, uint8_t *p_data, size_t len) |
Function for sending data over UARTE using EasyDMA. More... | |
ret_code_t | nrf_libuarte_drv_rx_start (const nrf_libuarte_drv_t *const p_libuarte, uint8_t *p_data, size_t len, bool ext_trigger_en) |
Function for starting receiving data with additional configuration of external trigger to start receiving. More... | |
void | nrf_libuarte_drv_rx_buf_rsp (const nrf_libuarte_drv_t *const p_libuarte, uint8_t *p_data, size_t len) |
Function for setting a buffer for data that will be later received in UARTE. More... | |
void | nrf_libuarte_drv_rx_stop (const nrf_libuarte_drv_t *const p_libuarte) |
Function for stopping receiving data over UARTE. More... | |
void | nrf_libuarte_drv_rts_clear (const nrf_libuarte_drv_t *const p_libuarte) |
Function for deasserting RTS to pause the transmission. More... | |
void | nrf_libuarte_drv_rts_set (const nrf_libuarte_drv_t *const p_libuarte) |
Function for asserting RTS to restart the transmission. More... | |
Variables | |
const IRQn_Type | libuarte_irqn [] |
Module for reliable communication over UARTE.
#define NRF_LIBUARTE_DRV_DEFINE | ( | _name, | |
_uarte_idx, | |||
_timer_idx | |||
) |
ret_code_t nrf_libuarte_drv_init | ( | const nrf_libuarte_drv_t *const | p_libuarte, |
nrf_libuarte_drv_config_t * | p_config, | ||
nrf_libuarte_drv_evt_handler_t | evt_handler, | ||
void * | context | ||
) |
Function for initializing the libUARTE library.
[in] | p_libuarte | Pointer to libuarte instance. |
[in] | p_config | Pointer to the structure with initial configuration. |
[in] | evt_handler | Event handler provided by the user. Must not be NULL. |
[in] | context | User context passed in the callback. |
void nrf_libuarte_drv_rts_clear | ( | const nrf_libuarte_drv_t *const | p_libuarte | ) |
Function for deasserting RTS to pause the transmission.
Flow control must be enabled.
p_libuarte | Pointer to libuarte instance. |
void nrf_libuarte_drv_rts_set | ( | const nrf_libuarte_drv_t *const | p_libuarte | ) |
Function for asserting RTS to restart the transmission.
Flow control must be enabled.
p_libuarte | Pointer to libuarte instance. |
void nrf_libuarte_drv_rx_buf_rsp | ( | const nrf_libuarte_drv_t *const | p_libuarte, |
uint8_t * | p_data, | ||
size_t | len | ||
) |
Function for setting a buffer for data that will be later received in UARTE.
p_libuarte | Pointer to libuarte instance. |
p_data | Pointer to data. |
len | Number of bytes to receive. Maximum possible length is dependent on the used SoC (see the MAXCNT register description in the Product Specification). The library checks it with an assertion. |
ret_code_t nrf_libuarte_drv_rx_start | ( | const nrf_libuarte_drv_t *const | p_libuarte, |
uint8_t * | p_data, | ||
size_t | len, | ||
bool | ext_trigger_en | ||
) |
Function for starting receiving data with additional configuration of external trigger to start receiving.
p_libuarte | Pointer to libuarte instance. |
p_data | Pointer to data. |
len | Number of bytes to receive. Maximum possible length is dependent on the used SoC (see the MAXCNT register description in the Product Specification). The library checks it with an assertion. |
ext_trigger_en | True to disable immediate start. |
NRF_ERROR_INTERNAL | Error during PPI channel configuration. |
NRF_SUCCESS | Buffer set for receiving. |
void nrf_libuarte_drv_rx_stop | ( | const nrf_libuarte_drv_t *const | p_libuarte | ) |
Function for stopping receiving data over UARTE.
p_libuarte | Pointer to libuarte instance. |
ret_code_t nrf_libuarte_drv_tx | ( | const nrf_libuarte_drv_t *const | p_libuarte, |
uint8_t * | p_data, | ||
size_t | len | ||
) |
Function for sending data over UARTE using EasyDMA.
[in] | p_libuarte | Pointer to libuarte instance. |
[in] | p_data | Pointer to data. |
[in] | len | Number of bytes to send. |
NRF_ERROR_BUSY | Data is transferring. |
NRF_ERROR_INTERNAL | Error during PPI channel configuration. |
NRF_SUCCESS | Buffer set for sending. |
void nrf_libuarte_drv_uninit | ( | const nrf_libuarte_drv_t *const | p_libuarte | ) |
Function for uninitializing the libUARTE library.
[in] | p_libuarte | Pointer to libuarte instance. |