Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
zpal_uart.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include "zpal_status.h"
+ Include dependency graph for zpal_uart.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  zpal_uart_config_t
 UART configuration. More...
 

Macros

#define ZPAL_UART_CONFIG_FLAG_BLOCKING   (1 << 1)
 

Typedefs

typedef void * zpal_uart_handle_t
 UART handle type.
 
typedef void(* zpal_uart_receive_callback_t) (zpal_uart_handle_t handle, size_t length)
 Defines a type for the UART receive callback that is invoked whenever data is ready.
 
typedef void(* zpal_uart_transmit_done_t) (zpal_uart_handle_t handle)
 Defines a type for the UART transmit done callback that is invoked when data has been transmitted.
 

Enumerations

enum  zpal_uart_id_t {
  ZPAL_UART0 = 0 ,
  ZPAL_UART1 ,
  ZPAL_UART2
}
 IDs for each of the UARTs. More...
 
enum  zpal_uart_parity_bit_t {
  ZPAL_UART_NO_PARITY ,
  ZPAL_UART_EVEN_PARITY ,
  ZPAL_UART_ODD_PARITY
}
 IDs for each of the parity mode. More...
 
enum  zpal_uart_stop_bits_t {
  ZPAL_UART_STOP_BITS_0P5 ,
  ZPAL_UART_STOP_BITS_1 ,
  ZPAL_UART_STOP_BITS_1P5 ,
  ZPAL_UART_STOP_BITS_2
}
 IDs for each of the stop bits configuration. More...
 

Functions

zpal_status_t zpal_uart_init (const zpal_uart_config_t *config, zpal_uart_handle_t *handle)
 Initializes a UART based on the given configuration.
 
zpal_status_t zpal_uart_enable (zpal_uart_handle_t handle)
 Enables a given UART.
 
zpal_status_t zpal_uart_disable (zpal_uart_handle_t handle)
 Disables a given UART.
 
zpal_status_t zpal_uart_transmit (zpal_uart_handle_t handle, const uint8_t *data, size_t length, zpal_uart_transmit_done_t tx_cb)
 Transmits data using a given UART.
 
bool zpal_uart_transmit_in_progress (zpal_uart_handle_t handle)
 Returns whether transmission is in progress.
 
size_t zpal_uart_get_available (zpal_uart_handle_t handle)
 Get the number of bytes ready for reading.
 
size_t zpal_uart_receive (zpal_uart_handle_t handle, uint8_t *data, size_t length)
 Receive available data into buffer using a given UART.
 

Detailed Description

Defines a platform abstraction layer for the Z-Wave UART.