Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
uart_arch.c File Reference
#include "mcu_periph/uart.h"
#include "mcu_periph/gpio.h"
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/usart.h>
#include <libopencm3/cm3/nvic.h>
#include "std.h"
#include <BOARD_CONFIG>
+ Include dependency graph for uart_arch.c:

Go to the source code of this file.

Functions

void uart_periph_set_baudrate (struct uart_periph *p, uint32_t baud)
 Set baudrate. 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...
 
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_put_byte (struct uart_periph *p, long fd, uint8_t data)
 Uart transmit implementation. More...
 
static void usart_isr (struct uart_periph *p)
 
static void usart_enable_irq (uint8_t IRQn)
 

Detailed Description

Handling of UART hardware for STM32.

Definition in file uart_arch.c.

Function Documentation

◆ uart_periph_set_baudrate()

void uart_periph_set_baudrate ( struct uart_periph p,
uint32_t  baud 
)

Set baudrate.

Definition at line 42 of file uart_arch.c.

References SerialInit::conf, and p.

◆ uart_periph_set_bits_stop_parity()

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 63 of file uart_arch.c.

References SerialInit::conf, p, UBITS_7, UPARITY_EVEN, UPARITY_ODD, and USTOP_2.

◆ uart_periph_set_mode()

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 92 of file uart_arch.c.

References mode, and p.

◆ uart_put_byte()

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

Uart transmit implementation.

Definition at line 112 of file uart_arch.c.

References fd, p, SerialInit::tx_mtx, SerialInit::tx_sem, and UART_TX_BUFFER_SIZE.

◆ usart_enable_irq()

static void usart_enable_irq ( uint8_t  IRQn)
inlinestatic

Definition at line 183 of file uart_arch.c.

◆ usart_isr()

static void usart_isr ( struct uart_periph p)
inlinestatic

Definition at line 136 of file uart_arch.c.

References p, UART_RX_BUFFER_SIZE, and UART_TX_BUFFER_SIZE.