mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
36 lines
908 B
C++
36 lines
908 B
C++
#ifndef STA_CORE_PRINTABLE_SERIAL_HPP
|
|
#define STA_CORE_PRINTABLE_SERIAL_HPP
|
|
|
|
#include <sta/debug/printing/printable.hpp>
|
|
#ifdef STA_PLATFORM_ARDUINO
|
|
|
|
#include <sta/mutex.hpp>
|
|
|
|
namespace sta
|
|
{
|
|
class PrintableSerial: public Printable
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Printable implementation for Arduino Serial printing.
|
|
*
|
|
* @param baud The baud rate for serial printing.
|
|
* @param mutex An optional mutex to protect the serial bus.
|
|
*/
|
|
PrintableSerial(unsigned long baud, Mutex * mutex = nullptr);
|
|
|
|
/**
|
|
* @brief Print string.
|
|
*
|
|
* @param str String buffer
|
|
* @param length String length
|
|
*/
|
|
void print(const char * str, size_t length) override;
|
|
private:
|
|
Mutex * mutex_;
|
|
};
|
|
} // namespace sta
|
|
|
|
#endif // STA_PLATFORM_ARDUINO
|
|
|
|
#endif // STA_CORE_PRINTABLE_SERIAL_HPP
|