Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
uart_arch.c File Reference

UART/Serial driver implementation for ChibiOS arch. More...

#include "mcu_periph/uart_arch.h"
#include <ch.h>
#include <hal.h>
#include "mcu_periph/gpio.h"
+ Include dependency graph for uart_arch.c:

Go to the source code of this file.

Data Structures

struct  SerialInit
 

Functions

static void handle_uart_rx (struct uart_periph *p)
 RX handler. More...
 
static void handle_uart_tx (struct uart_periph *p)
 TX handler. More...
 
uint8_t uart_getch (struct uart_periph *p)
 
void uart_periph_set_baudrate (struct uart_periph *p, uint32_t baud)
 Set baudrate. More...
 
void uart_periph_set_mode (struct uart_periph *p, bool tx_enabled, bool rx_enabled, bool hw_flow_control)
 Set mode (not necessary, or can be set by SerialConfig) More...
 
void uart_periph_set_bits_stop_parity (struct uart_periph *p, uint8_t bits, uint8_t stop, uint8_t parity)
 Set parity and stop bits. More...
 
bool uart_check_free_space (struct uart_periph *p, long *fd, uint16_t len)
 
void uart_put_byte (struct uart_periph *p, long fd, uint8_t data)
 Uart transmit implementation. More...
 
void uart_put_buffer (struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
 Uart transmit buffer implementation. More...
 
void uart_send_message (struct uart_periph *p, long fd)
 

Detailed Description

UART/Serial driver implementation for ChibiOS arch.

ChibiOS has a high level Serial Driver, for Paparazzi it is more convenient than pure UART driver (which needs callbacks etc.). This implementation is asynchronous and the RX thread has to use event flags. See ChibiOS documen- tation.

Definition in file uart_arch.c.


Data Structure Documentation

struct SerialInit

Definition at line 42 of file uart_arch.c.

Data Fields
SerialConfig * conf
mutex_t * rx_mtx
semaphore_t * rx_sem
mutex_t * tx_mtx
semaphore_t * tx_sem

Function Documentation

bool uart_check_free_space ( struct uart_periph p,
long *  fd,
uint16_t  len 
)

Definition at line 899 of file uart_arch.c.

Referenced by sdlogger_spi_direct_periodic(), send_buffer_to_uart(), and tunnel_event().

+ Here is the caller graph for this function:

void uart_periph_set_baudrate ( struct uart_periph p,
uint32_t  baud 
)

Set baudrate.

Definition at line 838 of file uart_arch.c.

Referenced by gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_configure(), px4flash_event(), sbus_common_init(), and uart_periph_init().

+ Here is the caller graph for this function:

void uart_periph_set_bits_stop_parity ( struct uart_periph p,
uint8_t  bits,
uint8_t  stop,
uint8_t  parity 
)

Set parity and stop bits.

Definition at line 858 of file uart_arch.c.

Referenced by high_speed_logger_direct_memory_init(), and sbus_common_init().

+ Here is the caller graph for this function:

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

Set mode (not necessary, or can be set by SerialConfig)

Definition at line 852 of file uart_arch.c.

Referenced by hott_enable_receiver(), and hott_enable_transmitter().

+ Here is the caller graph for this function:

void uart_put_buffer ( struct uart_periph p,
long  fd,
const uint8_t data,
uint16_t  len 
)

Uart transmit buffer implementation.

Definition at line 945 of file uart_arch.c.

void uart_put_byte ( struct uart_periph p,
long  fd,
uint8_t  data 
)
void uart_send_message ( struct uart_periph p,
long  fd 
)

Definition at line 975 of file uart_arch.c.