library for UART communication (code)
More...
Go to the source code of this file.
|
#define | UART_ID 1 |
| USART peripheral.
|
|
#define | UART_BAUDRATE 921600 |
| serial baudrate, in bits per second (with 8N1 8 bits, no parity bit, 1 stop bit settings)
|
|
|
static volatile uint8_t | tx_buffer [64] = {0} |
| ring buffer for data to transmit
|
|
static volatile uint8_t | tx_i = 0 |
| current position of transmitted data
|
|
static volatile uint8_t | tx_used = 0 |
| how much data needs to be transmitted
|
|
library for UART communication (code)
- Author
- King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info
- Date
- 2016-2017
- Note
- peripherals used: USART USART peripheral used for UART communication
Definition in file uart.c.
◆ uart_flush()
ensure all data has been transmitted (blocking)
- Note
- block until all data has been transmitted
Definition at line 83 of file uart.c.
◆ uart_putchar_blocking()
void uart_putchar_blocking |
( |
char |
c | ) |
|
send character over UART (blocking)
- Parameters
-
- Note
- blocks until character transmission started
Definition at line 77 of file uart.c.
◆ uart_putchar_nonblocking()
void uart_putchar_nonblocking |
( |
char |
c | ) |
|
send character over UART (non-blocking)
- Parameters
-
- Note
- blocks if transmit buffer is full, else puts in buffer and returns
Definition at line 91 of file uart.c.