This commit is contained in:
2025-05-13 02:03:18 +03:00
parent 72860c7968
commit 90ef6120fd
463 changed files with 380758 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <stm32h7xx_hal.h>
#include <functional>
class UartReader {
public:
using LineCallback = std::function<void(const char*, std::size_t)>;
UartReader();
void start(LineCallback lineCallback);
void onDataRx();
private:
static const int BufferSize = 128;
LineCallback _lineCallback;
std::uint8_t buffer0[BufferSize];
std::uint8_t buffer1[BufferSize];
std::uint8_t* _writeBuffer = buffer0;
std::uint8_t* _readBuffer = buffer1;
std::size_t _rxSize = 0;
//LF_TERMINAL_STREAM_USART
};