00001 /* src_experimental/drivers/i2c/analog.h 00002 CubeOS Version 0.4.90 experimental 00003 Copyright (C) 1999,2000 Holger Kenn 00004 00005 CubeOS is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or any later version. 00009 00010 CubeOS is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 */ 00016 #ifndef _ANALOG_H 00017 #define _ANALOG_H 00018 00023 #define MAXI2CMESSLENGTH 8 00024 00025 #define ANALOG_4SE 0x00; 00026 #define ANALOG_3DI 0x10; 00027 #define ANALOG_2S2D 0x20; 00028 #define ANALOG_2DI 0x30; 00029 #define ANALOG_DACOE 0x40; 00030 00035 struct _I2C_ad_datas 00036 { 00037 char bus; 00038 char address; 00039 char ad[3]; 00040 char da; 00041 char status; 00042 char active; 00043 }; 00044 00045 extern struct _I2C_ad_datas _I2C_ad_data[16]; 00046 extern char _I2C_analog_mbuf[MAXI2CMESSLENGTH]; 00047 extern struct i2cmess _I2C_analog_m; 00048 extern int _I2C_adnum; 00049 00050 int I2C_ReadAnalogIn(int chip,int port); 00051 int I2C_WriteAnalogOut(int chip,int value); 00052 int I2C_ConfigureAnalog(int chip,char how); 00053 int I2C_init_analog(); 00054 00055 #endif