Loading...
Searching...
No Matches
uart_half_duplex.h File Reference

Interface definition for half-duplex UART driver. More...

Detailed Description

Interface definition for half-duplex UART driver.

Author
Loïc Dauphin loic..nosp@m.daup.nosp@m.hin@i.nosp@m.nria.nosp@m..fr

Definition in file uart_half_duplex.h.

#include <stdlib.h>
#include "periph/uart.h"
+ Include dependency graph for uart_half_duplex.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uart_half_duplex_dir_t
 half-duplex UART direction management method type More...
 
struct  uart_half_duplex_params_t
 Configuration for half-duplex UART. More...
 
struct  uart_half_duplex_t
 Descriptor struct for half-duplex UART. More...
 

Macros

#define UART_HALF_DUPLEX_DEFAULT_TIMEOUT_US   (20000LU)
 Default recv timeout (in microseconds)
 
#define UART_HALF_DUPLEX_DIR_NONE   { NULL, NULL, NULL }
 Don't manage direction.
 

Enumerations

enum  {
  UART_HALF_DUPLEX_OK = UART_OK , UART_HALF_DUPLEX_NODEV = UART_NODEV , UART_HALF_DUPLEX_NOBAUD = UART_NOBAUD , UART_HALF_DUPLEX_INTERR = UART_INTERR ,
  UART_HALF_DUPLEX_NOMODE = UART_NOMODE , UART_HALF_DUPLEX_NOBUFF = -5
}
 Possible UART_HALF_DUPLEX return values. More...
 

Functions

int uart_half_duplex_init (uart_half_duplex_t *dev, uint8_t *buffer, size_t buffer_max_size, const uart_half_duplex_params_t *params)
 Initialize the half-duplex UART bus to communicate with devices.
 
static void uart_half_duplex_set_tx (uart_half_duplex_t *dev)
 Set the half-duplex UART bus in TX mode.
 
static void uart_half_duplex_set_rx (uart_half_duplex_t *dev)
 Set the half-duplex UART bus in RX mode.
 
size_t uart_half_duplex_send (const uart_half_duplex_t *dev, size_t size)
 Send the data contained in the driver's buffer.
 
size_t uart_half_duplex_recv (const uart_half_duplex_t *dev, size_t size)
 Recv data an fill the driver's buffer.