2020-02-19 21:07:58 +01:00
|
|
|
/** library for UART communication
|
2020-02-11 12:23:10 +01:00
|
|
|
* @file
|
2018-02-18 15:18:42 +01:00
|
|
|
* @author King Kévin <kingkevin@cuvoodoo.info>
|
2020-06-06 14:35:55 +02:00
|
|
|
* @copyright SPDX-License-Identifier: GPL-3.0-or-later
|
2020-02-11 12:23:10 +01:00
|
|
|
* @date 2016-2020
|
2018-02-18 15:18:42 +01:00
|
|
|
* @note peripherals used: USART @ref uart
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2018-02-18 15:20:01 +01:00
|
|
|
/** setup UART peripheral */
|
2018-02-18 15:18:42 +01:00
|
|
|
void uart_setup(void);
|
2018-02-18 15:20:01 +01:00
|
|
|
/** send character over UART (blocking)
|
2018-02-18 15:18:42 +01:00
|
|
|
* @param[in] c character to send
|
|
|
|
* @note blocks until character transmission started */
|
|
|
|
void uart_putchar_blocking(char c);
|
|
|
|
/** ensure all data has been transmitted (blocking)
|
|
|
|
* @note block until all data has been transmitted
|
|
|
|
*/
|
|
|
|
void uart_flush(void);
|
2018-02-18 15:20:01 +01:00
|
|
|
/** send character over UART (non-blocking)
|
2018-02-18 15:18:42 +01:00
|
|
|
* @param[in] c character to send
|
|
|
|
* @note blocks if transmit buffer is full, else puts in buffer and returns
|
|
|
|
*/
|
|
|
|
void uart_putchar_nonblocking(char c);
|