mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
address space config
This commit is contained in:
parent
8f77c60cba
commit
da152c65ee
39
IR_config.h
39
IR_config.h
@ -8,19 +8,32 @@
|
||||
|
||||
*/
|
||||
// Адресация с 1 до 65 499
|
||||
#define IR_Broadcast 65000 // 65 500 ~ 65 535 - широковещательные пакеты (всем), возможно разделить на 35 типов
|
||||
#define IR_Broadcast 65000 // 65 500 ~ 65 535 - широковещательные пакеты (всем)
|
||||
/*
|
||||
Адрес 0 запрещен и зарезервирован под NULL, либо тесты
|
||||
IR_MSG_ACCEPT с адреса 0 воспринимается всеми устройствами
|
||||
*Адресное пространство:
|
||||
Адрес 0 запрещен и зарезервирован под NULL, либо тесты
|
||||
IR_MSG_ACCEPT с адреса 0 воспринимается всеми устройствами
|
||||
*/
|
||||
//**** Контрольные точки ******
|
||||
#define IR_MAX_ADDR_CPU 64999
|
||||
#define IR_MIN_ADDR_CPU 32000
|
||||
|
||||
// //***** Группы машинок ********
|
||||
// #define IR_MAX_CAR_GROUP 31999
|
||||
// #define IR_MIN_CAR_GROUP 30000
|
||||
|
||||
Адресное пространство:
|
||||
|
||||
Излучатели контрольных точек: 1000 ~ 1999
|
||||
Излучатели без обратной связиЖ 2000 ~ 2999
|
||||
Излучатели светофоров: 3000 ~ 3999
|
||||
// //********** FREE *************
|
||||
// #define IR_MAX_FREE 31999
|
||||
// #define IR_MIN_FREE 2000
|
||||
|
||||
//********* Машинки ***********
|
||||
#define IR_MAX_CAR 31999
|
||||
#define IR_MIN_CAR 100
|
||||
|
||||
//***** Пульты управления *****
|
||||
#define IR_MAX_CONTROLLER 99
|
||||
#define IR_MIN_CONTROLLER 0
|
||||
/*
|
||||
|
||||
/```````````````````````````````````````````````` data pack `````````````````````````````````````````````\
|
||||
|
||||
@ -142,10 +155,10 @@ typedef uint16_t crc_t;
|
||||
#define bitTime (bitTakts * carrierPeriod) // Общая длительность бита
|
||||
#define tolerance 300U
|
||||
|
||||
constexpr uint16_t test_all_Time = bitTime;
|
||||
constexpr uint16_t test_all_Takts = bitTakts*2;
|
||||
constexpr uint16_t test_hi = ((bitPauseTakts) * 2 - 0 ) + ((bitActiveTakts) * 2 - 0);
|
||||
constexpr uint16_t test_low = ((bitPauseTakts/2 + bitActiveTakts) * 2 - 0)+((bitPauseTakts) - 0);
|
||||
constexpr uint16_t test_all_Time = bitTime;
|
||||
constexpr uint16_t test_all_Takts = bitTakts * 2;
|
||||
constexpr uint16_t test_hi = ((bitPauseTakts) * 2 - 0) + ((bitActiveTakts) * 2 - 0);
|
||||
constexpr uint16_t test_low = ((bitPauseTakts / 2 + bitActiveTakts) * 2 - 0) + ((bitPauseTakts)-0);
|
||||
|
||||
class IR_FOX
|
||||
{
|
||||
@ -187,7 +200,7 @@ public:
|
||||
inline void setId(uint16_t id) { this->id = id; }
|
||||
static void checkAddressRuleApply(uint16_t address, uint16_t id, bool &flag);
|
||||
void setPin(uint8_t pin);
|
||||
inline uint8_t getPin(){return pin;};
|
||||
inline uint8_t getPin() { return pin; };
|
||||
|
||||
protected:
|
||||
uint16_t id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user