mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
51 lines
993 B
C++
51 lines
993 B
C++
/**
|
|
* @file
|
|
* @brief Printable UART interface definition.
|
|
*/
|
|
#ifndef STA_CORE_PRINTABLE_UART_HPP
|
|
#define STA_CORE_PRINTABLE_UART_HPP
|
|
|
|
#include <sta/bus/uart/uart.hpp>
|
|
#include <sta/debug/printing/printable.hpp>
|
|
|
|
#include <sta/config.hpp>
|
|
#ifdef STA_PLATFORM_ARDUINO
|
|
# include <stddef.h>
|
|
# include <stdint.h>
|
|
#else
|
|
# include <cstddef>
|
|
# include <cstdint>
|
|
#endif // STA_PLATFORM_ARDUINO
|
|
|
|
|
|
namespace sta
|
|
{
|
|
/**
|
|
* @brief Printable interface for UART.
|
|
*
|
|
* @ingroup sta_core
|
|
*/
|
|
class PrintableUART : public BasePrintable
|
|
{
|
|
public:
|
|
/**
|
|
* @param intf UART instance
|
|
*/
|
|
PrintableUART(UART * intf);
|
|
|
|
/**
|
|
* @brief Print string.
|
|
*
|
|
* @param str String buffer
|
|
* @param length String length
|
|
*/
|
|
void print(const char * str, size_t length) override;
|
|
|
|
private:
|
|
UART * intf_;
|
|
};
|
|
} // namespace sta
|
|
|
|
|
|
#endif // STA_CORE_PRINTABLE_UART_HPP
|