2 #ifndef __dccCommander_H__ 3 #define __dccCommander_H__ 8 #ifndef NO_DCCCOMMANDER 10 #include <DCC_Decoder.hpp> 13 #define DccCommander DccCommanderClass::GetCurrent() 17 typedef void(*DccAccDecoderPacket)(
int address,
boolean activate, uint8_t data);
20 #define DCCID(id) ((id) % 10000) 21 #define DCCACTIVATION(id) ((uint8_t)((id) / 10000)) 22 #define DCCINT(id, acc) ((acc) * 10000UL + (id)) 84 unsigned long LastDccId;
85 unsigned long LastEventDate;
86 boolean UseRawDccAddresses;
87 boolean RaiseEventOnActivation;
88 int RaiseEventDebounceDelay;
89 static DccAccDecoderPacket func_AccPacket;
104 void begin(
int i,
int j,
int k,
boolean inInterruptMonitor =
false,
boolean inUseRawDccAddresses =
false);
111 void RaiseEventWhen(
boolean inRaiseEventOnActivation,
int inRaiseEventDebounceDelay = 200);
118 unsigned long loop();
136 if (pDccCommander == NULL)
139 return *(DccCommanderClass::pDccCommander);
142 #ifdef COMMANDERS_DEBUG_MODE 148 #define PRINT_EVENT_DCC(id, type, data) DccCommander::printEvent(id, type, data); 150 #define PRINT_EVENT_DCC(id, type, data) 152 #ifdef COMMANDERS_PRINT_COMMANDERS
static void printEvent(unsigned long inId, COMMANDERS_EVENT_TYPE inEventType, int inEventData)
static DccCommanderClass & GetCurrent()
unsigned long GetLastDccId()
static void DccAccessoryDecoderPacket(int address, boolean activate, uint8_t data)
void RaiseEventWhen(boolean inRaiseEventOnActivation, int inRaiseEventDebounceDelay = 200)
void begin(int i, int j, int k, boolean inInterruptMonitor = false, boolean inUseRawDccAddresses = false)
static void SetAccessoryDecoderPacketHandler(DccAccDecoderPacket func)