mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
signal generator
This commit is contained in:
22
IR_Encoder.h
22
IR_Encoder.h
@ -46,23 +46,27 @@ private:
|
||||
enum SignalPart : uint8_t {
|
||||
noSignal = 0,
|
||||
preamb = 1,
|
||||
data = 2, // 2 должен инвертироваться в sync
|
||||
sync = (uint8_t)~(uint8_t)2U // 253 должен инвертироваться в data
|
||||
data = 2,
|
||||
sync = 3
|
||||
};
|
||||
|
||||
uint8_t sendLen;
|
||||
uint8_t* sendBuffer; /// @brief Буффер данных для отправки
|
||||
|
||||
volatile bool isSending = false;
|
||||
// volatile bool genState = HIGH;
|
||||
|
||||
volatile bool state; /// @brief Текущий уровень генерации
|
||||
volatile uint8_t toggleCounter; /// @brief Счётчик переключений
|
||||
volatile uint8_t preambBitCounter;
|
||||
volatile bool state; /// @brief Текущий уровень генерации
|
||||
|
||||
volatile uint8_t dataByteCounter;
|
||||
|
||||
volatile uint8_t toggleCounter; /// @brief Счётчик переключений
|
||||
volatile uint8_t dataBitCounter;
|
||||
volatile uint8_t syncBitCounter;
|
||||
|
||||
volatile uint8_t preambFrontCounter;
|
||||
volatile uint8_t dataFrontCounter;
|
||||
volatile uint8_t syncFrontCounter;
|
||||
volatile uint8_t dataSequenceCounter;
|
||||
volatile uint8_t syncSequenceCounter;
|
||||
volatile bool syncLastBit;
|
||||
|
||||
struct BitSequence {
|
||||
uint8_t low;
|
||||
@ -76,7 +80,7 @@ private:
|
||||
(bitPauseTakts + bitActiveTakts) * 2 - 1,
|
||||
(bitPauseTakts) * 2 - 1
|
||||
};
|
||||
uint8_t* currentBit;
|
||||
uint8_t* currentBitSequence = bitLow;
|
||||
|
||||
// uint8_t bitSequence[2];
|
||||
|
||||
|
Reference in New Issue
Block a user