uart.h File Reference

Low-level UART peripheral driver interface definition. More...

Detailed Description

#include <stddef.h>
#include <stdint.h>
#include <limits.h>
#include "periph_cpu.h"
#include "periph_conf.h"
#include "periph/dev_enums.h"
+ Include dependency graph for uart.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uart_isr_ctx_t
 Interrupt context for a UART device. More...
 

Macros

#define UART_UNDEF   (UINT_MAX)
 Default UART undefined value.
 
#define UART_DEV(x)   (x)
 Default UART device access macro.
 

Typedefs

typedef void(* uart_rx_cb_t) (void *arg, uint8_t data)
 Signature for receive interrupt callback. More...
 
typedef unsigned int uart_t
 Define default UART type identifier.
 

Enumerations

enum  {
  UART_OK = 0, UART_NODEV = -1, UART_NOBAUD = -2, UART_INTERR = -3,
  UART_NOMODE = -4
}
 Possible UART return values. More...
 

Functions

int uart_init (uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
 Initialize a given UART device. More...
 
void uart_write (uart_t uart, const uint8_t *data, size_t len)
 Write data from the given buffer to the specified UART device. More...
 
void uart_poweron (uart_t uart)
 Power on the given UART device. More...
 
void uart_poweroff (uart_t uart)
 Power off the given UART device. More...