Access functions for the UART controller
More...
|
void | uart_enable (uint32_t uart) |
| Enable the peripheral. More...
|
|
void | uart_disable (uint32_t uart) |
| Disable the peripheral. More...
|
|
void | uart_configure (uint32_t uart, uint32_t tx_pin, uint32_t rx_pin, uint32_t rts_pin, uint32_t cts_pin, enum uart_baud br, bool enable_parity) |
| Configure UART parameters in single call. More...
|
|
void | uart_set_pins (uint32_t uart, uint32_t rx, uint32_t tx, uint32_t cts, uint32_t rts) |
| Select GPIO pins to be used by this peripheral. More...
|
|
void | uart_set_baudrate (uint32_t uart, enum uart_baud br) |
|
void | uart_set_parity (uint32_t uart, int parity) |
|
void | uart_set_flow_control (uint32_t uart, int flow) |
|
void | uart_start_tx (uint32_t uart) |
|
void | uart_send (uint32_t uart, uint16_t byte) |
|
void | uart_stop_tx (uint32_t uart) |
|
void | uart_start_rx (uint32_t uart) |
|
uint16_t | uart_recv (uint32_t uart) |
|
void | uart_stop_rx (uint32_t uart) |
|
Access functions for the UART controller
LGPL License Terms libopencm3 License
- Author
- © 2016 Maxim Sloyko maxim.nosp@m.s@go.nosp@m.ogle..nosp@m.com
◆ uart_configure()
void uart_configure |
( |
uint32_t |
uart, |
|
|
uint32_t |
tx_pin, |
|
|
uint32_t |
rx_pin, |
|
|
uint32_t |
rts_pin, |
|
|
uint32_t |
cts_pin, |
|
|
enum uart_baud |
br, |
|
|
bool |
enable_parity |
|
) |
| |
Configure UART parameters in single call.
Any pin number can be set to 0xff (or any number larger than UART_MAX_PIN) to disconnect that pin.
- Parameters
-
[in] | uart | uint32_t uart base |
[in] | tx_pin | uint8_t TX pin number |
[in] | rx_pin | uint8_t RX pin number |
[in] | rts_pin | uint8_t RTS pin number |
[in] | cts_pin | uint8_t CTS pin number |
[in] | br | enum uart_baud baud rate |
[in] | enable_parity | bool If true, enable parity bit |
Definition at line 67 of file uart.c.
References UART_CONFIG, UART_CONFIG_HWFC, UART_CONFIG_PARITY, UART_MAX_PIN, uart_set_baudrate(), and uart_set_pins().
◆ uart_disable()
void uart_disable |
( |
uint32_t |
uart | ) |
|
◆ uart_enable()
void uart_enable |
( |
uint32_t |
uart | ) |
|
◆ uart_recv()
uint16_t uart_recv |
( |
uint32_t |
uart | ) |
|
◆ uart_send()
void uart_send |
( |
uint32_t |
uart, |
|
|
uint16_t |
byte |
|
) |
| |
◆ uart_set_baudrate()
void uart_set_baudrate |
( |
uint32_t |
uart, |
|
|
enum uart_baud |
br |
|
) |
| |
◆ uart_set_flow_control()
void uart_set_flow_control |
( |
uint32_t |
uart, |
|
|
int |
flow |
|
) |
| |
◆ uart_set_parity()
void uart_set_parity |
( |
uint32_t |
uart, |
|
|
int |
parity |
|
) |
| |
◆ uart_set_pins()
void uart_set_pins |
( |
uint32_t |
uart, |
|
|
uint32_t |
rx, |
|
|
uint32_t |
tx, |
|
|
uint32_t |
cts, |
|
|
uint32_t |
rts |
|
) |
| |
◆ uart_start_rx()
void uart_start_rx |
( |
uint32_t |
uart | ) |
|
◆ uart_start_tx()
void uart_start_tx |
( |
uint32_t |
uart | ) |
|
◆ uart_stop_rx()
void uart_stop_rx |
( |
uint32_t |
uart | ) |
|
◆ uart_stop_tx()
void uart_stop_tx |
( |
uint32_t |
uart | ) |
|