nRF5 SDK v15.0.0
Modules | Data Structures | Typedefs | Enumerations | Functions

Module for reliable communication over UARTE. More...

Modules

 libUARTE library configuration
 

Data Structures

struct  nrf_libuarte_data_t
 
struct  nrf_libuarte_evt_t
 
struct  nrf_libuarte_config_t
 

Typedefs

typedef void(* nrf_libuarte_evt_handler_t )(nrf_libuarte_evt_t *p_evt)
 

Enumerations

enum  nrf_libuarte_evt_type_t {
  NRF_LIBUARTE_EVT_RX_DATA,
  NRF_LIBUARTE_EVT_RX_BUF_REQ,
  NRF_LIBUARTE_EVT_TX_DONE,
  NRF_LIBUARTE_EVT_ERROR
}
 

Functions

ret_code_t nrf_libuarte_init (nrf_libuarte_config_t *p_config, nrf_libuarte_evt_handler_t evt_handler)
 Function for initializing the libUARTE library. More...
 
void nrf_libuarte_uninit (void)
 Function for uninitializing the libUARTE library.
 
ret_code_t nrf_libuarte_tx (uint8_t *p_data, size_t len)
 Function for sending data over UARTE using EasyDMA. More...
 
ret_code_t nrf_libuarte_rx_start (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_rx_buf_rsp (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_rx_stop (void)
 Function for stopping receiving data over UARTE.
 

Detailed Description

Module for reliable communication over UARTE.

Enumeration Type Documentation

Enumerator
NRF_LIBUARTE_EVT_RX_DATA 

Data received.

NRF_LIBUARTE_EVT_RX_BUF_REQ 

Requesting new buffer for receiving data.

NRF_LIBUARTE_EVT_TX_DONE 

Requested TX transfer completed.

NRF_LIBUARTE_EVT_ERROR 

Error reported by the UARTE peripheral.

Function Documentation

ret_code_t nrf_libuarte_init ( nrf_libuarte_config_t p_config,
nrf_libuarte_evt_handler_t  evt_handler 
)

Function for initializing the libUARTE library.

Parameters
[in]p_configPointer to the structure with initial configuration.
[in]evt_handlerEvent handler provided by the user. Must not be NULL.
Returns
NRF_SUCCESS when properly initialized. NRF_ERROR_INTERNAL otherwise.
void nrf_libuarte_rx_buf_rsp ( uint8_t *  p_data,
size_t  len 
)

Function for setting a buffer for data that will be later received in UARTE.

Parameters
p_dataPointer to data.
lenNumber 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_rx_start ( 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.

Parameters
p_dataPointer to data.
lenNumber 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_enTrue to disable immediate start.
Return values
NRF_ERROR_INTERNALError during PPI channel configuration.
NRF_SUCCESSBuffer set for receiving.
ret_code_t nrf_libuarte_tx ( uint8_t *  p_data,
size_t  len 
)

Function for sending data over UARTE using EasyDMA.

Parameters
[in]p_dataPointer to data.
[in]lenNumber of bytes to send.
Return values
NRF_ERROR_BUSYData is transferring.
NRF_ERROR_INTERNALError during PPI channel configuration.
NRF_SUCCESSBuffer set for sending.

Documentation feedback | Developer Zone | Subscribe | Updated