mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
v1.0.1 fix define conflict
This commit is contained in:
42
IR_config.h
42
IR_config.h
@ -60,40 +60,40 @@ msg type:
|
||||
/*
|
||||
/////////////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#define bytePerPack 3 // колличество байтов в пакете
|
||||
#define freeFrec true
|
||||
#define IR_bytePerPack 3 // колличество байтов в пакете
|
||||
#define IR_freeFrec true
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define bitPerByte 8U // Колличество бит в байте
|
||||
#define addrBytes 2
|
||||
#define msgBytes 1
|
||||
#define crcBytes 2
|
||||
#define IR_bitPerByte 8U // Колличество бит в байте
|
||||
#define IR_addrBytes 2
|
||||
#define IR_msgBytes 1
|
||||
#define IR_crcBytes 2
|
||||
typedef uint16_t crc_t;
|
||||
#define poly1 0x31
|
||||
#define poly2 0x8C
|
||||
#define syncBits 3U // количество битов синхронизации
|
||||
#define IR_poly1 0x31
|
||||
#define IR_poly2 0x8C
|
||||
#define IR_syncBits 3U // количество битов синхронизации
|
||||
|
||||
#define dataByteSizeMax (msgBytes + addrBytes + addrBytes + bytePerPack + crcBytes)
|
||||
#define IR_dataByteSizeMax (msgBytes + addrBytes + addrBytes + bytePerPack + crcBytes)
|
||||
// размер msg в битах // размер короткой посылки в битах
|
||||
#define dataBitSize ((8 + syncBits) * dataByteSizeMax) // размер посылки с данными в битах
|
||||
#define bufferBitSizeMax (dataBitSize) // Размер буффера в битах
|
||||
#define IR_dataBitSize ((8 + syncBits) * dataByteSizeMax) // размер посылки с данными в битах
|
||||
#define IR_bufferBitSizeMax (dataBitSize) // Размер буффера в битах
|
||||
|
||||
//const auto x = bufferBitSizeMax;
|
||||
#define preambPulse 3U
|
||||
#define preambFronts (preambPulse*2) // количество фронтов преамбулы
|
||||
#define IR_preambPulse 3U
|
||||
#define IR_preambFronts (preambPulse*2) // количество фронтов преамбулы
|
||||
|
||||
#define carrierFrec 38000U // частота несущей
|
||||
#define carrierPeriod (1000000U/carrierFrec) // период несущей в us
|
||||
#define IR_carrierFrec 38000U // частота несущей
|
||||
#define IR_carrierPeriod (1000000U/carrierFrec) // период несущей в us
|
||||
|
||||
// В процессе работы значения будут отклонятся в соответствии с предыдущим битом
|
||||
#define bitActiveTakts 25U // длительность активной части бита в тактах
|
||||
#define bitPauseTakts 5U // длительность промежутков в тактах
|
||||
#define IR_bitActiveTakts 25U // длительность активной части бита в тактах
|
||||
#define IR_bitPauseTakts 5U // длительность промежутков в тактах
|
||||
|
||||
#define bitTakts (bitActiveTakts+bitPauseTakts*2U) // Общая длительность бита в тактах
|
||||
#define bitTime (bitTakts*carrierPeriod) // Общая длительность бита
|
||||
#define IR_bitTakts (bitActiveTakts+bitPauseTakts*2U) // Общая длительность бита в тактах
|
||||
#define IR_bitTime (bitTakts*carrierPeriod) // Общая длительность бита
|
||||
//const auto viewValue = bitTime;
|
||||
#define tolerance 300U
|
||||
#define IR_tolerance 300U
|
||||
|
||||
class IR_FOX {
|
||||
private:
|
||||
|
Reference in New Issue
Block a user