Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
uart.h File Reference

arch independent UART (Universal Asynchronous Receiver/Transmitter) API More...

#include "mcu_periph/uart_arch.h"
#include "std.h"
+ Include dependency graph for uart.h:

Go to the source code of this file.

Data Structures

struct  uart_periph
 UART peripheral. More...
 

Macros

#define UART_RX_BUFFER_SIZE   128
 
#define UART_TX_BUFFER_SIZE   128
 
#define UART_DEV_NAME_SIZE   16
 
#define B1200   1200
 
#define B2400   2400
 
#define B4800   4800
 
#define B9600   9600
 
#define B19200   19200
 
#define B38400   38400
 
#define B57600   57600
 
#define B115200   115200
 
#define B230400   230400
 
#define B921600   921600
 

Functions

void uart_periph_init (struct uart_periph *p)
 
void uart_periph_set_baudrate (struct uart_periph *p, uint32_t baud)
 
void uart_periph_set_mode (struct uart_periph *p, bool_t tx_enabled, bool_t rx_enabled, bool_t hw_flow_control)
 
void uart_transmit (struct uart_periph *p, uint8_t data)
 
bool_t uart_check_free_space (struct uart_periph *p, uint8_t len)
 
uint8_t uart_getch (struct uart_periph *p)
 
static bool_t uart_char_available (struct uart_periph *p)
 

Detailed Description

arch independent UART (Universal Asynchronous Receiver/Transmitter) API

Definition in file uart.h.

Macro Definition Documentation

#define B115200   115200

Definition at line 49 of file uart.h.

Referenced by actuators_ardrone_init().

#define B1200   1200

Definition at line 42 of file uart.h.

#define B19200   19200

Definition at line 46 of file uart.h.

#define B230400   230400

Definition at line 50 of file uart.h.

#define B2400   2400

Definition at line 43 of file uart.h.

#define B38400   38400

Definition at line 47 of file uart.h.

Referenced by gps_ubx_ucenter_autobaud(), and gps_ubx_ucenter_configure().

#define B4800   4800

Definition at line 44 of file uart.h.

Referenced by gps_ubx_ucenter_autobaud().

#define B57600   57600

Definition at line 48 of file uart.h.

Referenced by gps_ubx_ucenter_autobaud().

#define B921600   921600

Definition at line 51 of file uart.h.

#define B9600   9600

Definition at line 45 of file uart.h.

Referenced by gps_ubx_ucenter_autobaud().

#define UART_DEV_NAME_SIZE   16

Definition at line 36 of file uart.h.

#define UART_RX_BUFFER_SIZE   128

Definition at line 34 of file uart.h.

Referenced by uart_getch(), uart_handler(), uart_ISR(), and usart_isr().

#define UART_TX_BUFFER_SIZE   128

Definition at line 35 of file uart.h.

Referenced by uart_check_free_space(), uart_handler(), uart_ISR(), uart_transmit(), and usart_isr().

Function Documentation

static bool_t uart_char_available ( struct uart_periph p)
inlinestatic

Definition at line 83 of file uart.h.

References uart_periph::rx_extract_idx, and uart_periph::rx_insert_idx.

Referenced by main(), main_event_task(), main_periodic(), test_uart_event(), and uart_transfer_event().

+ Here is the caller graph for this function:

bool_t uart_check_free_space ( struct uart_periph p,
uint8_t  len 
)

Definition at line 64 of file uart.c.

References uart_periph::tx_extract_idx, uart_periph::tx_insert_idx, and UART_TX_BUFFER_SIZE.

Referenced by main().

+ Here is the caller graph for this function:

uint8_t uart_getch ( struct uart_periph p)

Definition at line 71 of file uart.c.

References uart_periph::rx_buf, uart_periph::rx_extract_idx, and UART_RX_BUFFER_SIZE.

Referenced by main(), main_event_task(), main_periodic(), test_uart_event(), and uart_transfer_event().

+ Here is the caller graph for this function:

void uart_periph_set_baudrate ( struct uart_periph p,
uint32_t  baud 
)

Definition at line 65 of file uart_arch.c.

References uart_periph::dev, uart_periph::reg_addr, uart_disable_interrupts(), uart_enable_interrupts(), and uart_set_baudrate().

+ Here is the call graph for this function:

void uart_periph_set_mode ( struct uart_periph p,
bool_t  tx_enabled,
bool_t  rx_enabled,
bool_t  hw_flow_control 
)

Definition at line 64 of file uart_arch.c.

References uart_periph::reg_addr.

void uart_transmit ( struct uart_periph p,
uint8_t  data 
)

Definition at line 71 of file uart_arch.c.

References disableIRQ(), uart_periph::reg_addr, restoreIRQ(), TRUE, uart_periph::tx_buf, uart_periph::tx_extract_idx, uart_periph::tx_insert_idx, uart_periph::tx_running, UART_TX_BUFFER_SIZE, and UIER_ETBEI.

Referenced by main(), main_event_task(), main_periodic(), and test_uart_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: