versadac  1
versadac - Scalable Recorder Firmware
di_f_ssm.h
1 /*******************************************************************************
2 FILE : di_f_ssm.h
3 VERSION : $Id: di_f_ssm.h 5305 2006-10-27 12:09:59Z martinto $
4 AUTHOR : Richard Hine
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : Scheduled message class for driving the new DI8
7 *******************************************************************************/
8 #ifndef __DI_F_SSM_H
9 #define __DI_F_SSM_H
10 #include "spismsg.h"
11 #include "msg_try.h"
12 
13 /*
14  When enabled this feature outputs 'C' whenever a corrupt reply to a fast update message is received
15 */
16 //#define CORRUPTION_TEST_FEATURE_ENABLED
17 
18 
19 #define EIO_DI_FAST_MODULE_NUMBER_OF_CHANNELS 8
20 
21 class DigitalInputFastSpiScheduledMessage:public SpiScheduledMessage
22 {
23  public:
24  DigitalInputFastSpiScheduledMessage(unsigned char device, unsigned char * data, MsgRetryCounter * z_retry_p);
26  unsigned char getOnOffStates() {return(*getRxPtr());};
27  /*------------------------------------------------------------------------------
28  FUNCTION : getTransacted
29 
30  DESCRIPTION : Can be called to see if the message has been transacted since it
31  was created or last checked.
32  ARGUMENTS :
33  RETURN :
34  NOTES :
35  ------------------------------------------------------------------------------*/
36  bool getTransacted(){bool temp = m_transacted; m_transacted = false; return temp;};
37 
38  bool wasCommandOk() {return(*getRxPtr() == (*(getRxPtr()+1)^0xff));};
39  virtual void sent();
40 
41  private:
42  static unsigned short moduleToDevice(unsigned char module);
43  MsgRetryCounter * retry_p; // pointer to the retries count
44  bool m_transacted;
45 };
46 
47 
48 #endif /*__DI_F_SSM_H */
49 
Definition: di_f_ssm.h:21
Definition: msg_try.h:21