CuVoodoo STM32F1 firmware template
Macros | Functions | Variables
usart.h File Reference

library for USART communication (API) More...

Go to the source code of this file.

Macros

#define USART_BUFFER   128
 transmit and receive buffer sizes
 

Functions

void usart_setup (void)
 setup USART peripheral
 
void usart_putchar_blocking (char c)
 send character over USART (blocking) More...
 
void usart_flush (void)
 ensure all data has been transmitted (blocking) More...
 
char usart_getchar (void)
 get character received over USART (blocking) More...
 
void usart_putchar_nonblocking (char c)
 send character over USART (non-blocking) More...
 

Variables

volatile bool usart_received
 how many bytes available in the received buffer since last read
 

Detailed Description

library for USART communication (API)

Author
King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info
Date
2016
Note
peripherals used: USART USART peripheral used for UART communication

Definition in file usart.h.

Function Documentation

◆ usart_flush()

void usart_flush ( void  )

ensure all data has been transmitted (blocking)

Note
block until all data has been transmitted

Definition at line 91 of file usart.c.

◆ usart_getchar()

char usart_getchar ( void  )

get character received over USART (blocking)

Returns
character received over USART
Note
blocks until character is received over USART when received buffer is empty

Definition at line 99 of file usart.c.

◆ usart_putchar_blocking()

void usart_putchar_blocking ( char  c)

send character over USART (blocking)

Parameters
[in]ccharacter to send
Note
blocks until character transmission started

Definition at line 85 of file usart.c.

◆ usart_putchar_nonblocking()

void usart_putchar_nonblocking ( char  c)

send character over USART (non-blocking)

Parameters
[in]ccharacter to send
Note
blocks if transmit buffer is full, else puts in buffer and returns

Definition at line 113 of file usart.c.