versadac  1
versadac - Scalable Recorder Firmware
eio_do.h
1 /*******************************************************************************
2 FILE : eio_do.h
3 VERSION : $Id: eio_do.h 30319 2010-03-10 18:43:56Z davec $
4 AUTHOR : David Cozens
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : Types and prototypes for EIO DO API
7 *******************************************************************************/
8 #ifndef __EIO_DO_H
9 #define __EIO_DO_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 /* Digital output modes */
15 typedef enum
16 {
17  EIO_DO_MODE_ON_OFF,
18  EIO_DO_MODE_ONE_SHOT,
19  EIO_DO_MODE_PULSE_TRAIN,
20  EIO_DO_MODE_TIME_PROPORTIONED_OUTPUT,
21  EIO_DO_MODE_VALVE_RAISE,
22  EIO_DO_MODE_VALVE_LOWER,
23  EIO_DO_NUMBER_OF_MODES
24 }EioDOMode;
25 
26 /* Digital output states */
27 typedef enum
28 {
29  EIO_DO_STATE_LOW,
30  EIO_DO_STATE_HIGH
31 }EioDOState;
32 
33 typedef enum
34 {
35  EIO_DO_STATUS_GOOD,
36  EIO_DO_STATUS_HARDWARE_ERROR,
37  EIO_DO_STATUS_HARDWARE_CAPABILITIES_EXCEEDED,
38  EIO_DO_STATUS_RANGING,
39  EIO_DO_STATUS_OVERTEMP
40 }EioDOStatus;
41 
42 /* General Digital output API */
43 void eioDOSetMode( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioDOMode mode);
44 EioBoolean eioDOIsModeSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioDOMode outputMode);
45 EioDOStatus eioDOGetStatus( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
46 void eioDOSecondarySetStatus( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioDOStatus status);
47 
48 
49 /* On/Off API */
50 void eioDOOOSetState( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioDOState state);
51 
52 /* One Shot API */
53 void eioDOOSOutputPulse( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 pulseTimeuS);
54 void eioDOOSReset( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
55 void eioDOOSSetInvert( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioBoolean invert);
56 
57 /* Pulse Train API */
58 void eioDOPTSendPulses( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 numberOfPulses);
59 void eioDOPTSetPerioduS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 perioduS);
60 void eioDOPTReset( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
61 void eioDOPTSetInvert( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioBoolean invert);
62 EioUint32 eioDOPTGetActualPerioduS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioUint8 cycleNumber, EioUint32 perioduS);
63 
64 /* Time proportioned Output API */
65 void eioDOTPOSetDemand( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, float demand);
66 void eioDOTPOSetMinimumPulseTimeuS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 pulseTimeuS);
67 EioUint32 eioDOTPOGetActualMinimumPulseTimeuS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioUint8 cycleNumber, EioUint32 requestedMinimumPulseTimeuS);
68 void eioDOTPOSetCycleTimeuS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 cycleTimeuS);
69 EioUint32 eioDOTPOGetActualCycleTimeuS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioUint8 cycleNumber, EioUint32 requestedCycleTimeuS);
70 EioBoolean eioDOTPOIsCycleTimeConfigurable( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
71 
72 /* Valve Positioning API */
73 typedef enum
74 {
75  EIO_DO_VP_PROPERTY_BACKLASH,
76  EIO_DO_VP_PROPERTY_INERTIA_COMPENSATION,
77  EIO_DO_VP_PROPERTY_DIRECTION_CHANGE_TIME,
78  EIO_DO_VP_NUMBER_OF_PROPERTIES
79 }EioDOVPProperty;
80 
81 void eioDOVPSetDemand( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, float demand);
82 EioUint32 eioDOVPGetActualMinimumPulseTimeuS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioUint8 cycleNumber, EioUint32 requestedMinimumPulseTimeuS);
83 void eioDOVPSetBacklashuS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 backlashuS);
84 void eioDOVPSetInertiauS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 inertiauS);
85 void eioDOVPSetStaticTimeuS( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioUint32 staticTimeuS);
86 EioBoolean eioDOVPIsPropertySupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioDOVPProperty property);
87 EioUint8 eioDOVPGetAssociatedPointOnModule( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
88 
89 typedef struct
90 {
91  EioDOMode m_mode;
92  EioBoolean m_oneShotInvert;
93  EioBoolean m_pulseTrainInvert;
94  EioUint32 m_pulseTrainPerioduS;
95  EioUint32 m_tpoMinimumPulseTimeuS;
96  EioUint32 m_vpBacklashuS;
97  EioUint32 m_vpInertiauS;
98  EioUint32 m_vpStaticTimeuS;
99  EioUint32 m_changeCounter;
101 
102 typedef struct
103 {
104  EioDOState m_on;
105  EioBoolean m_oneShotReset;
106  EioUint32 m_oneShotPulseTimeuS;
107  EioBoolean m_pulseTrainReset;
108  EioUint32 m_pulseTrainNumberOfPulses;
109  float m_tpoDemand;
110  float m_vpDemand;
111  EioDOStatus m_status;
113 #ifdef __cplusplus
114 } /* extern "C" */
115 #endif
116 #endif /* __EIO_DO_H */
Definition: eio_syst.h:52
Definition: eio_do.h:89
Definition: eio_do.h:102