versadac  1
versadac - Scalable Recorder Firmware
eio_fi.h
1 /*******************************************************************************
2 FILE : eio_fi.h
3 VERSION : $Id: eio_fi.h 5305 2006-10-27 12:09:59Z martinto $
4 AUTHOR : Liz MacCormick/David Cozens
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : Types and prototypes for EIO Frequency Input API.
7 low*******************************************************************************/
8 #ifndef __EIO_FI_H
9 #define __EIO_FI_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 /* frequency input status */
15 typedef enum
16 {
17  EIO_FI_STATUS_GOOD,
18  EIO_FI_STATUS_HARDWARE_ERROR,
19  EIO_FI_STATUS_HARDWARE_CAPABILITIES_EXCEEDED,
20  EIO_FI_STATUS_UNDER_RANGE,
21  EIO_FI_STATUS_OVER_RANGE,
22  EIO_FI_STATUS_RANGING,
23  EIO_FI_STATUS_SENSOR_BREAK,
24  EIO_FI_STATUS_SENSOR_SHORT_CIRCUIT,
25  EIO_FI_STATUS_HARDWARE_SETUP_ERROR
26 }EioFIStatus;
27 
28 /* Frequency type */
29 typedef enum
30 {
31  EIO_FI_TYPE_OFF,
32  EIO_FI_TYPE_MAGNETIC,
33  EIO_FI_TYPE_LOGIC_mV,
34  EIO_FI_TYPE_LOGIC_mA,
35  EIO_FI_NUMBER_OF_TYPES
36 }EioFIType;
37 
38 /* runtime data */
39 typedef struct
40 {
41  EioUint32 deltaCount;
42  float frequency;
43  struct
44  {
45  EioUint32 data1;
46  EioUint32 data2;
47  }privateRedundancyData;
48  EioFIStatus status;
49 }EioFIData;
50 
51 /* configuration data */
52 typedef struct
53 {
54  EioFIType type;
55  float threshold;
56  float supplyMillivolts;
57  float burdenOhms;
58  EioUint32 debounce;
59  EioUint32 filterTimeuS;
60  EioBoolean enableSensorBreak;
61  EioBoolean enableShortCircuitDetect;
62  EioUint32 changeCounter;
64 
65 /* runtime data and configuration prototypes */
66 EioFIData* eioFIGetDataPtr( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
67 void eioFIGetData( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioFIData *dataPtr);
68 void eioFISetConfiguration( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioFIType type, float threshold, float supplyMillivolts, EioUint32 debounce, EioUint32 filterTimeuS, float burdenOhms, EioBoolean enableSensorBreak, EioBoolean enableShortCircuitDetect);
69 void eioFISecondarySetData( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioFIData *dataPtr);
70 
71 
72 
73 /* Capability discovery prototypes */
74 EioBoolean eioFIIsTypeSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
75 EioBoolean eioFIIsDebounceSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
76 EioBoolean eioFIIsThresholdSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
77 EioBoolean eioFIIsShortCircuitDetectSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
78 EioBoolean eioFIIsSensorBreakDetectSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
79 EioBoolean eioFIIsPowerSupplySupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
80 float eioFIGetMaximumSupportedFrequency( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
81 float eioFIGetMinimumSupportedFrequency( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType);
82 float eioFIGetActualThreshold( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType inputType, float burdenOhms, float requested);
83 float eioFIGetActualSupplyMillivolts( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, float requestedMillivolts);
84 EioUint32 eioFIGetMaxFilterTimeuS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
85 EioBoolean eioFIIsBurdenConfigurable( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
86 float eioFIGetBurdenResistance( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber);
87 EioUint32 eioFIGetSlowestUpdateuS( EioSystem *ioSystem, EioModuleType moduleType);
88 EioUint32 eioFIGetActualDebounceTimeuS( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioFIType type, EioUint32 debounce);
89 
90 
91 
92 #ifdef __cplusplus
93 } /* extern "C" */
94 #endif
95 #endif /* __EIO_FI_H */
96 
Definition: eio_syst.h:52
Definition: eio_fi.h:52
Definition: eio_fi.h:39