12 #ifndef __EIOT2SRFI2_H
13 #define __EIOT2SRFI2_H
21 FI2_NUMBER_OF_CHANNELS
25 #define EIO_T2500_FI2_MAX_FREQUENCY 40000.0F
27 #define EIO_T2500_FI2_MAX_FREQUENCY_MEASURABLE 80000.0F
28 #define EIO_T2500_FI2_MIN_FREQUENCY_LOGIC 0.01F
29 #define EIO_T2500_FI2_MIN_FREQUENCY_MAGNETIC 10.0F
30 #define EIO_T2500_FI2_BURDEN_RESISTANCE 1000.0F
31 #define EIO_T2500_FI2_MIN_THRESHOLD_MILLIVOLTS 0.0F
32 #define EIO_T2500_FI2_MAX_THRESHOLD_MILLIVOLTS 20000.0F
33 #define EIO_T2500_FI2_MIN_THRESHOLD_MILLIAMPS 0.0F
34 #define EIO_T2500_FI2_MAX_THRESHOLD_MILLIAMPS 20.0F
36 #define EIO_T2500_FI2_MAX_FILTER_TIME_US (999999999)
39 #define EIO_FI2_HOLDOFF_COUNT 2
43 EIO_T2500_FI2_DEBOUNCE_CODE_OFF,
44 EIO_T2500_FI2_DEBOUNCE_CODE_5mS,
45 EIO_T2500_FI2_DEBOUNCE_CODE_10mS,
46 EIO_T2500_FI2_DEBOUNCE_CODE_20mS,
47 EIO_T2500_FI2_DEBOUNCE_CODE_50mS,
48 EIO_T2500_FI2_NUMBER_OF_DEBOUNCE_CODES
53 EIO_T2500_FI2_PSU_8V_CODE,
54 EIO_T2500_FI2_PSU_12V_CODE,
55 EIO_T2500_FI2_PSU_24V_CODE,
56 EIO_T2500_FI2_NUMBER_OF_PSU_CODES
59 extern unsigned char eioT2500FI2DebounceCodes[EIO_T2500_FI2_NUMBER_OF_DEBOUNCE_CODES];
60 extern unsigned char eioT2500FI2PSUCodes[EIO_T2500_FI2_NUMBER_OF_PSU_CODES];
62 unsigned char eioT2500FI2GetDebounceEnum(EioUint32 debounce);
63 unsigned char eioT2500FI2GetPSUEnum(
float requestedMillivolts);
70 #include "eio_t25srm.h"
80 EIO_T2500FI2_STATE_MODULE_NEEDS_RESET,
81 EIO_T2500FI2_STATE_INITIALISING,
82 EIO_T2500FI2_STATE_RUNTIME,
83 EIO_T2500FI2_STATE_DELETE,
84 EIO_T2500FI2_STATE_SECONDARY,
85 EIO_T2500FI2_STATE_BECOMING_PRIMARY,
91 EioT2500FI2Module(
unsigned char moduleNumber, EioT2500CycleEnum z_expectedCycleNumber);
92 virtual ~EioT2500FI2Module();
95 virtual void update62_5mS();
96 virtual void update125mS();
97 virtual void updateBuffers125ms();
98 virtual void cycleComplete125mS();
101 void handleModuleError();
103 void configureUpdateMessages(
int channel);
104 void driveModuleLEDs();
119 float filter(
float sample,
float polep,
float divisor)
121 return polep + ( (sample - polep) / divisor );
124 Fi2RunStates m_state;
125 bool m_messagesScheduled;
126 EioUint8 m_initialisingCount;
128 EioFIData m_inputData[FI2_NUMBER_OF_CHANNELS];
130 bool m_badConfig[FI2_NUMBER_OF_CHANNELS];
131 bool m_resetFilter[FI2_NUMBER_OF_CHANNELS];
132 EioUint32 m_updatesSinceLastPulse[FI2_NUMBER_OF_CHANNELS];
133 float m_divisor[FI2_NUMBER_OF_CHANNELS];
134 float m_rawFrequency[FI2_NUMBER_OF_CHANNELS];
135 unsigned char m_holdoffCount[FI2_NUMBER_OF_CHANNELS];
136 EioFIStatus m_holdoffStatus[FI2_NUMBER_OF_CHANNELS];
137 EioUint8 m_moduleVersion;
Definition: eio_t25srm.h:58