Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
linux uart handling More...
#include <BOARD_CONFIG>
#include "mcu_periph/uart.h"
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "serial_port.h"
#include "rt_priority.h"
#include <pthread.h>
#include <sys/select.h>
Go to the source code of this file.
Macros | |
#define | UART_THREAD_PRIO 11 |
#define | TRACE(fmt, args...) |
Functions | |
static void | uart_receive_handler (struct uart_periph *periph) |
static void * | uart_thread (void *data) |
void | uart_arch_init (void) |
static void | uart_periph_open (struct uart_periph *periph, uint32_t baud) |
void | uart_periph_set_baudrate (struct uart_periph *periph, uint32_t baud) |
void | uart_periph_set_bits_stop_parity (struct uart_periph *periph, uint8_t bits, uint8_t stop, uint8_t parity) |
void | uart_put_byte (struct uart_periph *periph, long fd, uint8_t data) |
uint8_t | uart_getch (struct uart_periph *p) |
int | uart_char_available (struct uart_periph *p) |
Check UART for available chars in receive buffer. More... | |
Variables | |
static pthread_mutex_t | uart_mutex = PTHREAD_MUTEX_INITIALIZER |
linux uart handling
Definition in file uart_arch.c.
#define TRACE | ( | fmt, | |
args... | |||
) |
Definition at line 52 of file uart_arch.c.
#define UART_THREAD_PRIO 11 |
Definition at line 44 of file uart_arch.c.
void uart_arch_init | ( | void | ) |
Definition at line 54 of file uart_arch.c.
References uart_mutex, and uart_thread().
Referenced by mcu_init().
int uart_char_available | ( | struct uart_periph * | p | ) |
Check UART for available chars in receive buffer.
Definition at line 357 of file uart_arch.c.
References p, uart_mutex, and UART_RX_BUFFER_SIZE.
Referenced by actuators_faulhaber_event(), airspeed_uADC_event(), dw1000_arduino_event(), esc32_event(), gps_piksi_event(), gps_piksi_read(), high_speed_logger_direct_memory_periodic(), hott_check_serial_data(), hott_common_decode_event(), hott_send_telemetry_data(), jevois_event(), periodic_switch_uart(), sbus_common_decode_event(), spektrum_uart_check(), sts3032_event(), syslink_dl_event(), and tunnel_event().
uint8_t uart_getch | ( | struct uart_periph * | p | ) |
Definition at line 348 of file uart_arch.c.
References p, uart_mutex, and UART_RX_BUFFER_SIZE.
Referenced by actuators_faulhaber_event(), airspeed_uADC_event(), dw1000_arduino_event(), esc32_event(), gps_piksi_read(), high_speed_logger_direct_memory_periodic(), hott_check_serial_data(), hott_common_decode_event(), hott_send_telemetry_data(), jevois_event(), periodic_switch_uart(), sbus_common_decode_event(), spektrum_uart_check(), sts3032_event(), syslink_dl_event(), and tunnel_event().
|
static |
Definition at line 253 of file uart_arch.c.
References uart_periph::baudrate, uart_periph::dev, uart_periph::reg_addr, serial_port_close(), serial_port_free(), serial_port_new(), serial_port_open_raw(), and TRACE.
Referenced by uart_periph_set_baudrate().
void uart_periph_set_baudrate | ( | struct uart_periph * | periph, |
uint32_t | baud | ||
) |
Definition at line 280 of file uart_arch.c.
References uart_periph::baudrate, uart_periph::reg_addr, serial_port_set_baudrate(), and uart_periph_open().
Referenced by actuators_sbus_init(), gps_ubx_ucenter_autobaud(), gps_ubx_ucenter_configure(), hott_common_init(), px4flash_event(), sbus_common_init(), and uart_periph_init().
void uart_periph_set_bits_stop_parity | ( | struct uart_periph * | periph, |
uint8_t | bits, | ||
uint8_t | stop, | ||
uint8_t | parity | ||
) |
Definition at line 296 of file uart_arch.c.
References uart_periph::reg_addr, and serial_port_set_bits_stop_parity().
Referenced by actuators_sbus_init(), high_speed_logger_direct_memory_init(), hott_common_init(), and sbus_common_init().
void uart_put_byte | ( | struct uart_periph * | periph, |
long | fd, | ||
uint8_t | data | ||
) |
Definition at line 306 of file uart_arch.c.
References SerialPort::fd, uart_periph::reg_addr, and TRACE.
Referenced by direct_memory_logger_periodic(), drop_ball(), esc32_periodic(), esc32_send(), faulhaber_send_command(), gps_piksi_write(), hott_send_telemetry_data(), jevois_send_string(), send_buffer_to_uart(), tunnel_event(), uart_periph_init(), and uart_put_buffer().
|
static |
Definition at line 324 of file uart_arch.c.
References SerialPort::fd, fd, uart_periph::reg_addr, uart_periph::rx_buf, uart_periph::rx_extract_idx, uart_periph::rx_insert_idx, TRACE, uart_mutex, and UART_RX_BUFFER_SIZE.
Referenced by uart_thread().
|
static |
Definition at line 68 of file uart_arch.c.
References fd, get_rt_prio(), uart_receive_handler(), and UART_THREAD_PRIO.
Referenced by uart_arch_init().
|
static |
Definition at line 49 of file uart_arch.c.
Referenced by uart_arch_init(), uart_char_available(), uart_getch(), and uart_receive_handler().