nRF5 SDK for Thread and Zigbee v3.2.0
Functions
Low level API for UART

Functions

void zb_osif_serial_init (void)
 
void zb_osif_set_uart_byte_received_cb (void(*hnd)(zb_uint8_t))
 
void zb_osif_set_user_io_buffer (zb_byte_array_t *buf_ptr, zb_ushort_t capacity)
 
void zb_osif_set_uart_user_irq_handler (void(*irq_hnd)())
 
void zb_osif_serial_put_bytes (zb_uint8_t *buf, zb_short_t len)
 

Detailed Description

Function Documentation

void zb_osif_serial_init ( void  )

Initialize UART low level.

If ZBOSS uses UART for trace or traffic dump, it calls zb_osif_serial_init() itself. If UART is used by application, application must call zb_osif_serial_init().

void zb_osif_serial_put_bytes ( zb_uint8_t buf,
zb_short_t  len 
)

TX data over UART

Put data to internal buffer to be transmitted over UART. It is guaranteed that all data will be sent. Block is no space in the buffer waiting for previous TX complete.

Note: this is low level routine. Its direct usage may conflict with ZBOSS debug trace and traffic dump (if enabled).

Parameters
bufdata buffer
lendata length.
void zb_osif_set_uart_byte_received_cb ( void(*)(zb_uint8_t hnd)

Setup callback to be called when single byte reecived over UART

Parameters
hnduser's rx callback
void zb_osif_set_uart_user_irq_handler ( void(*)()  irq_hnd)

Set user callback that will be called from uart IRQ handler. Replaces zboss uart irq handler.

Note: that call is to be used when application initializes and uses UART itself. Do not use this call if use ZBOSS serial port API. Call to that functions disables ZBOSS debug trace and traffic dump.

void zb_osif_set_user_io_buffer ( zb_byte_array_t *  buf_ptr,
zb_ushort_t  capacity 
)

Set user's buffer to be used by UART TX logic.

ZBOSS normally uses its internal UART buffer. The buffer is not too big - about 200 bytes which is enough for its usage by ZBOSS (trace). Some applications needs large io buffers. So declare there type placeholder for use ringbuffer zb_byte_array_t; by default application will set user tx buffer to stack tx buffer and access it through pointer; User can override this pointer to use it's own serial buffer.

Parameters
buf_ptruser's buffer
capacitybuffer capacity

Documentation feedback | Developer Zone | Subscribe | Updated