versadac  1
versadac - Scalable Recorder Firmware
eiot2srdis.h
1 /*******************************************************************************
2 FILE : eiot2srdis.h
3 VERSION : $Id$
4 AUTHOR : David Cozens
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : This file contains The t2500 module class for representing slow
7  digital input modules.
8 
9  Modification for 8Hz execution (for Scalable Recorder)
10 
11 *******************************************************************************/
12 #ifndef __EIOT2SRDIS_H
13 #define __EIOT2SRDIS_H
14 
15 #include "prjParams.h"
16 #include "eio.h"
17 #include "eio_t25srm.h"
18 #include "di_s_ssm.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 enum DiSlowRunStates
25 {
26  EIO_T2500DISLOW_STATE_JUST_CREATED,
27  EIO_T2500DISLOW_STATE_MODULE_HAS_CHANGED,
28  EIO_T2500DISLOW_STATE_WAIT_FOR_STABLE_COP,
29  EIO_T2500DISLOW_STATE_RUNTIME,
30  EIO_T2500DISLOW_STATE_DELETE,
31  EIO_T2500DISLOW_STATE_SECONDARY,
32  EIO_T2500DISLOW_STATE_BECOMING_PRIMARY,
33  EIO_T2500DISLOW_STATE_CHANGEOVER_FAILED,
34 };
35 
37 {
38  public:
39  EioT2500DiSlowModule(unsigned char z_moduleNumber, EioModuleType z_type, EioT2500CycleEnum z_expectedCycleNumber);
40  virtual ~EioT2500DiSlowModule();
41 
42  protected:
43  virtual void update62_5mS();
44  virtual void update125mS();
45  virtual void updateBuffers125ms();
46 
47  private:
48  void processUpdateMessage();
49  EioUint8 m_numberOfChannels;
50  bool m_sendDebounceFor1to4;
51  DissmCommandByte m_commandByte;
52  DiSlowRunStates m_state;
53  DigitalInputSlowSpiScheduledMessage *m_updateMessage;
54  static const int MAX_NUMBER_OF_INPUTS_PER_MODULE = 8;
55  EioUint8 m_debounceTimes[MAX_NUMBER_OF_INPUTS_PER_MODULE];
56  EioUint8 m_countDownToRuntime;
57  EioUint8 m_rawData;
58  EioUint8 m_debounceData;
59  EioUint8 m_pulseData;
60  EioUint8 m_lastDebounceData;
61  EioUint8 m_changedData;
62  EioUint16 m_currentCount[MAX_NUMBER_OF_INPUTS_PER_MODULE];
63  EioDIStatus m_status[MAX_NUMBER_OF_INPUTS_PER_MODULE];
64  bool m_messagesScheduled;
65  short m_hideUpdates;
66  bool m_justCreated;
67  bool m_BInitOK;
68 
69 };
70 
71 #ifdef __cplusplus
72 } /* extern "C" */
73 #endif
74 #endif /*__EIOT2SRDIS_H */
75 
Definition: eio_t25srm.h:58
Definition: eiot2srdis.h:36
Definition: di_s_ssm.h:23