sta-core/include/sta/uart.hpp

62 lines
1.2 KiB
C++

/**
* @file
* @brief UART interface definition.
*/
#ifndef STA_CORE_UART_HPP
#define STA_CORE_UART_HPP
#include <cstddef>
#include <cstdint>
/**
* @defgroup sta_core_uart UART
* @ingroup sta_core
* @brief UART interface.
*/
namespace sta
{
/**
* @brief Interface for %UART.
*
* @ingroup sta_core_uart
*/
class UART
{
public:
/**
* @brief Write buffer to %UART.
*
* @param buffer Source buffer
* @param size Number of bytes in buffer
*/
virtual void write(const uint8_t * buffer, size_t size) = 0;
/**
* @brief Write unsigned integer to %UART.
*
* @param value Unsigned integer value
*/
void write(uint8_t value);
/**
* @brief Write unsigned integer to %UART.
*
* @param value Unsigned integer value
*/
void write(uint16_t value);
/**
* @brief Write unsigned integer to %UART.
*
* @param value Unsigned integer value
*/
void write(uint32_t value);
};
} // namespace sta
#endif // STA_CORE_UART_HPP