Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00033 #ifndef BCS_IO_H_
00034 #define BCS_IO_H_
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040 #include "bcs_general.h"
00041
00042 #ifdef USE_DEVICE_ARRAY
00043
00049 static const char* bcs_io_devices[3] = { "/dev/fsio0", "/dev/fsio1", "/dev/fsio2" };
00050 #endif
00051
00055 typedef enum {
00056 BCS_IO_LOW,
00057 BCS_IO_HIGH,
00058 BCS_IO_ERROR
00059 } BCS_IO_state;
00060
00065 typedef enum {
00066 BCS_IO_P0=0x01,
00067 BCS_IO_P1=0x02,
00068 BCS_IO_P2=0x04,
00069 BCS_IO_P3=0x08,
00070 BCS_IO_P4=0x10,
00071 BCS_IO_P5=0x20,
00072 BCS_IO_P6=0x40,
00073 BCS_IO_P7=0x80,
00074 BCS_IO_ALL8=0xFF
00075 } BCS_IO_pinconfig;
00076
00081 typedef struct {
00082 UInt16 ch0;
00083 UInt16 ch1;
00084 } BCS_IO_ad;
00085
00093 BCS_ERROR BCS_IO_openAsInput(BCS_ioport* fd, const void * device);
00094
00107 BCS_ERROR BCS_IO_openConfigured(BCS_ioport* fd, const void * device, UInt8 outputs);
00108
00115 UInt8 BCS_IO_getStatus(BCS_ioport* filedescriptor);
00116
00123 BCS_ERROR BCS_IO_setStatus(BCS_ioport* fd, UInt8 mask);
00124
00132 BCS_ERROR BCS_IO_setPinstatus(BCS_ioport* fd, UInt8 pin, BCS_IO_state s);
00133
00141 BCS_IO_state BCS_IO_getPinstatus(BCS_ioport* filedescriptor, UInt8 pin);
00142
00152 BCS_IO_state BCS_IO_pinTriggered(BCS_ioport* filedescriptor, UInt8 pin);
00153
00159 BCS_ERROR BCS_IO_openAnalog(BCS_ioport* fd);
00160
00167 BCS_ERROR BCS_IO_getAnalogvalues(BCS_ioport* fd, BCS_IO_ad* ad);
00168
00174 void BCS_IO_closePort(BCS_ioport* filedescriptor);
00175
00176
00177 #ifdef __cplusplus
00178 }
00179 #endif
00180
00181 #endif