versadac  1
versadac - Scalable Recorder Firmware
eiot2srdof.h
1 /*******************************************************************************
2 FILE : eiot2srdof.h
3 VERSION : $Id$
4 AUTHOR : Richard Hine
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : This file contains The t2500 module class for representing 4 channel
7  digital output modules run in the fast mode.
8 
9  Modification for 8Hz execution (for Scalable Recorder)
10 
11 *******************************************************************************/
12 #ifndef __EIOT2SRDOF_H
13 #define __EIOT2SRDOF_H
14 
15 #include "prjParams.h"
16 #include "eio.h"
17 #include "eio_t25srm.h"
18 #include "eio_vp.h"
19 #include "eio_tp.h"
20 #include "do_s_ssm.h"
21 #include "do_f_ssm.h"
22 #include "msg_try.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 enum EioT2500DoFastRunStates
29 {
30  EIO_T2500DOFAST_STATE_JUST_CREATED,
31  EIO_T2500DOFAST_STATE_JUST_CREATED_2,
32  EIO_T2500DOFAST_STATE_MODULE_HAS_CHANGED,
33  EIO_T2500DOFAST_STATE_START_RUNTIME,
34  EIO_T2500DOFAST_STATE_START_RUNTIME_2,
35  EIO_T2500DOFAST_STATE_RUNTIME,
36  EIO_T2500DOFAST_STATE_DELETE_1,
37  EIO_T2500DOFAST_STATE_DELETE_2,
38  EIO_T2500DOFAST_STATE_ERROR,
39  EIO_T2500DOFAST_STATE_ERROR_2,
40  EIO_T2500DOFAST_STATE_SECONDARY_ENABLING,
41  EIO_T2500DOFAST_STATE_SECONDARY_ENABLED,
42  EIO_T2500DOFAST_STATE_SECONDARY_DISABLING,
43  EIO_T2500DOFAST_STATE_SECONDARY_DISABLED,
44 };
45 
47 {
48  public:
49  EioT2500DoFastModule(unsigned char z_moduleNumber, EioModuleType z_type,
50  unsigned char z_tpoMultiple, EioT2500CycleEnum z_expectedCycleNumber);
51  virtual ~EioT2500DoFastModule();
52 
53  protected:
54  virtual void updateFast(unsigned short slot);
55  virtual void update62_5mS();
56  virtual void update125mS();
57  virtual void updateFastBuffers(unsigned int z_thisSlot);
58  virtual void cycleComplete125mS();
59  virtual void cycleCompleteFast(unsigned int z_thisSlot);
60 
61  private:
62  MsgRetryCounter m_retry;
63  void configureUpdateMessage(unsigned int slot);
64  void setUpdateMessagesSafe();
65  EioT2500DoFastRunStates m_state;
66  DigitalOutputSlowSpiScheduledMessage *m_setFastModeMessage;
67  DigitalOutputFastSpiScheduledMessage *m_fastUpdateMessage[EUROTHERM_SPI_MESSAGE_SCHEDULER_NUMBER_OF_SLOTS];
68  unsigned char m_evenSlotData[2];
69  unsigned char m_oddSlotData[2];
70  unsigned char * m_slotData;
71  static const int MAX_NUMBER_OF_OUTPUTS_PER_MODULE = 4;
72  static const int MAX_NUMBER_OF_VP_OUTPUTS_PER_MODULE = MAX_NUMBER_OF_OUTPUTS_PER_MODULE/2;
73  EioDoPointConfig m_pointConfig[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
74  EioDoPointRuntime m_pointRuntime[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
75  EioValvePositioningOutput m_vpo[MAX_NUMBER_OF_VP_OUTPUTS_PER_MODULE];
76  EioTimeProportioningOutput m_tpo[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
77  bool m_badConfig[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
78  EioDOStatus m_status[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
79  bool m_hadHardwareError[MAX_NUMBER_OF_OUTPUTS_PER_MODULE];
80  unsigned char m_expectedReply;
81  bool m_messagesScheduled;
82  unsigned char m_tpoMultiple;
83  bool * m_valveLower;
84 };
85 
86 #ifdef __cplusplus
87 } /* extern "C" */
88 #endif
89 #endif /*__EIOT2SRDOF_H */
90 
Definition: eio_t25srm.h:58
Definition: eio_tp.h:21
Definition: do_s_ssm.h:36
Definition: do_f_ssm.h:46
Definition: eio_do.h:89
Definition: eiot2srdof.h:46
Definition: msg_try.h:21
Definition: eio_do.h:102
Definition: eio_vp.h:25