versadac  1
versadac - Scalable Recorder Firmware
eio_ao.h
1 /*******************************************************************************
2 FILE : eio_ao.h
3 VERSION : $Id: eio_ao.h 5305 2006-10-27 12:09:59Z martinto $
4 AUTHOR : David Cozens
5 SYSTEM : Diab C for PowerPC under vxWorks
6 DESCRIPTION : Types and prototypes for EIO AO API.
7 low*******************************************************************************/
8 #ifndef __EIO_AO_H
9 #define __EIO_AO_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 /* analogue output status */
15 typedef enum
16 {
17  EIO_AO_STATUS_GOOD,
18  EIO_AO_STATUS_HARDWARE_ERROR,
19  EIO_AO_STATUS_CLIPPED_HIGH,
20  EIO_AO_STATUS_CLIPPED_LOW,
21  EIO_AO_STATUS_HARDWARE_CAPABILITIES_EXCEEDED,
22  EIO_AO_STATUS_CALIBRATING,
23  EIO_AO_STATUS_CALIBRATION_BAD,
24  EIO_AO_STATUS_OPEN_CIRCUIT_OUTPUT,
25  EIO_AO_STATUS_RANGING
26 }EioAOStatus;
27 
28 /* Output type */
29 typedef enum
30 {
31  EIO_AO_TYPE_OFF,
32  EIO_AO_TYPE_mV,
33  EIO_AO_TYPE_mA,
34  EIO_AO_NUMBER_OF_TYPES
35 }EioAOType;
36 
37 /* runtime data */
38 typedef struct
39 {
40  float m_demand;
41  EioAOStatus m_status;
42  EioBoolean m_userCalibrated;
43 }EioAOData;
44 
45 /* configuration Data */
46 typedef struct
47 {
48  EioAOType m_outputType;
49  float m_rangeLow;
50  float m_rangeHigh;
52 
53 /* runtime data and configuration prototypes */
54 EioAOData* eioAOGetDataPtr( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
55 EioAOStatus eioAOGetStatus( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
56 void eioAOSetDemand( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, float demand);
57 void eioAOSetConfiguration( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOType outputType, float rangeLow, float rangeHigh);
58 void eioAOSecondarySetStatus( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOStatus status);
59 
60 
61 /* calibration type */
62 typedef enum
63 {
64  EIO_AO_CAL_TYPE_FACTORY,
65  EIO_AO_CAL_TYPE_USER_REFERENCE
66 }EioAOCalType;
67 
68 /* calibration range type */
69 typedef enum
70 {
71  EIO_AO_CAL_RANGE_TYPE_mV,
72  EIO_AO_CAL_RANGE_TYPE_mA
73 }EioAOCalRangeType;
74 
75 /* Calibration prototypes */
76 EioBoolean eioAOCalIsCalibrationTypeSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 cycleNumber);
77 void eioAOCalDefaultCalibration( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOCalType calType);
78 void eioAOCalPointCalibrationStart( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOCalType calType);
79 void eioAOCalPointCalibrationComplete( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOCalType calType);
80 void eioAOCalPointCalibrationAbort( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber);
81 void eioAOCalSetCalibrationRange( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
82 EioUint8 eioAOCalGetNumberOfCalibrationRanges( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType);
83 EioAOCalRangeType eioAOCalGetRangeType( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
84 float eioAOCalGetRangeLowLimit( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
85 float eioAOCalGetRangeHighLimit( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
86 EioUint8 eioAOCalGetNumberOfCalibrationPoints( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
87 float eioAOCalGetNominalCalibrationPoint( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber, EioUint8 calibrationPointIndex);
88 void eioAOCalSetActualCalibrationPoint( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber, EioUint8 calibrationPointIndex, float value);
89 EioBoolean eioAOCalIsCustomCalibrationPointSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOCalType calType, EioUint8 rangeNumber);
90 void eioAOCalSetCurrentOutputMeasurement( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, float value);
91 void eioAOCalSetOutput( EioSystem *ioSystem, EioUint8 moduleNumber, EioUint8 pointNumber, float value);
92 
93 /* Capability discovery prototypes */
94 EioBoolean eioAOIsTypeSupported( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOType outputType);
95 float eioAOGetMinimumOutput( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOType outputType);
96 float eioAOGetMaximumOutput( EioSystem *ioSystem, EioModuleType moduleType, EioUint8 pointNumber, EioAOType outputType);
97 
98 #ifdef __cplusplus
99 } /* extern "C" */
100 #endif
101 #endif /* __EIO_AO_H */
Definition: eio_syst.h:52
Definition: eio_ao.h:46
Definition: eio_ao.h:38