Sixnet\Red Lion Controls SN-Series IOCTRL library Version 1.0
|
00001 /* -*- mode:c; c-basic-offset: 4; tab-width: 8; -*- vi: set sw=4 ts=8:*/ 00009 #ifndef SNHW_H 00010 #define SNHW_H 00011 00012 #define BT_GPIO_MINOR 3 00013 00014 /* Same as TIOCMxxx define */ 00015 #define BT_IOCGET 0x5415 00016 #define BT_IOCBIS 0x5416 00017 #define BT_IOCBIC 0x5417 00018 #define BT_IOCSET 0x5418 00019 #define BT_REGGET 0x4201 00020 00021 /* Other I/O (GPIO) Bit Field (User Space Interface) */ 00022 #define BT_IN1 (1<<0) 00023 #define BT_OUT1 (1<<16) 00024 00025 /* Defines MAX path and IO */ 00026 #define HWCONFIG_MAX_PATH (512) 00027 #define HWCONFIG_MAX_IO (1) 00028 00029 /* Number of IO interfaces */ 00030 unsigned char ioNum; 00031 00032 /* Paths and other control information */ 00033 char name[32]; 00034 char ioPath[HWCONFIG_MAX_PATH]; 00035 char driverPath[HWCONFIG_MAX_PATH]; 00036 char controlDevicePath[HWCONFIG_MAX_PATH]; 00037 char adcControlDevicePath[HWCONFIG_MAX_PATH]; 00038 00039 /* Structure used to control IO */ 00040 unsigned char hw_analogInputs; /* Number of analog inputs (AI1) */ 00041 unsigned char hw_digitalInputs; /* Number of digital inputs (DI1) */ 00042 unsigned char hw_digitalOutputs; /* Number of digital outputs (DO1) */ 00043 00044 /* Set the modem I/O driverPath, controlDevicePath, adcControlDevicePath 00045 * and defines number of available modules (DI, DO, AI). 00046 */ 00047 void hwConfig_SetModemModel(); 00048 00049 /* Perform an IOCTL action on an open file descriptor function */ 00050 int hwControl_ioctl(int controlFd, int controlAction, int * controlBits, char * controlPath, int debug); 00051 00052 /* SET a Discrete Output function */ 00053 int hwControl_Io_setDO(int value, int debug); 00054 00055 /* GET a Discrete Input function */ 00056 int hwControl_Io_getDI(int * p_value, int debug); 00057 00058 /* GET a Discrete Output function */ 00059 int hwControl_Io_getDO(int * p_value, int debug); 00060 00061 /* GET a Analog Input function */ 00062 int hwControl_Io_getAI(double * p_value, int debug); 00063 00064 /* Open control path function */ 00065 int hwControl_Io_openControl(int debug, int * p_controlFd, char ** p_controlPath); 00066 #endif 00067