This commit is contained in:
2024-02-22 14:01:27 +03:00
parent 462c69ce96
commit 6f5bbac83c
9 changed files with 470 additions and 568 deletions

View File

@ -3,9 +3,9 @@
//TODO: Отложенная передача после завершения приема
class IR_Decoder;
class IR_DecoderRaw;
class IR_Encoder : IR_FOX {
friend IR_Decoder;
friend IR_DecoderRaw;
public:
uint16_t id; /// @brief Адрес передатчика
@ -18,7 +18,7 @@ public:
/// @param pin Вывод передатчика
/// @param tune Подстройка несущей частоты
/// @param decPair Приёмник, для которого отключается приём в момент передачи передатчиком
IR_Encoder(uint16_t addr, uint8_t pin, IR_Decoder* decPair = nullptr);
IR_Encoder(uint16_t addr, uint8_t pin, IR_DecoderRaw* decPair = nullptr);
static void timerSetup() {
// TIMER2 Ini
@ -42,10 +42,10 @@ public:
SREG = oldSREG; // Return interrupt settings
}
void IR_Encoder::setBlindDecoders(IR_Decoder* decoders [], uint8_t count);
void IR_Encoder::setBlindDecoders(IR_DecoderRaw* decoders [], uint8_t count);
void rawSend(uint8_t* ptr, uint8_t len);
void sendData(uint16_t addrTo, uint8_t* data, uint8_t len, bool needAccept = false);
void sendAccept(uint16_t addrTo, uint8_t addInfo = 0, bool forAll = false);
void sendAccept(uint16_t addrTo, uint8_t addInfo = 0);
void sendRequest(uint16_t addrTo, uint8_t addInfo = 0);
void sendBack(uint8_t* data = nullptr, uint8_t len = 0);
void sendBackTo(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0);
@ -70,8 +70,8 @@ private:
sync = 3
};
IR_Decoder* decPair;
IR_Decoder** blindDecoders;
IR_DecoderRaw* decPair;
IR_DecoderRaw** blindDecoders;
uint8_t decodersCount;
uint8_t sendLen;