5 Copyright © 2003, The AROS Development Team. All rights reserved.
10 #include <exec/types.h>
14 #include <hidd/hidd.h>
23 #define CLID_Hidd_I2C "hidd.i2c"
24 #define IID_Hidd_I2C "hidd.i2c"
26 #define HiddI2CAttrBase __IHidd_I2C
28 #ifndef __OOP_NOATTRBASES__
29 extern OOP_AttrBase HiddI2CAttrBase
;
32 /* I2C Class methods */
35 moHidd_I2C_PutBits
= 0,
43 moHidd_I2C_ProbeAddress
,
51 aoHidd_I2C_BitTimeout
,
52 aoHidd_I2C_ByteTimeout
,
53 aoHidd_I2C_AcknTimeout
,
54 aoHidd_I2C_StartTimeout
,
55 aoHidd_I2C_RiseFallTime
,
61 #define aHidd_I2C_HoldTime (HiddI2CAttrBase + aoHidd_I2C_HoldTime)
62 #define aHidd_I2C_BitTimeout (HiddI2CAttrBase + aoHidd_I2C_BitTimeout)
63 #define aHidd_I2C_ByteTimeout (HiddI2CAttrBase + aoHidd_I2C_ByteTimeout)
64 #define aHidd_I2C_AcknTimeout (HiddI2CAttrBase + aoHidd_I2C_AcknTimeout)
65 #define aHidd_I2C_StartTimeout (HiddI2CAttrBase + aoHidd_I2C_StartTimeout)
66 #define aHidd_I2C_RiseFallTime (HiddI2CAttrBase + aoHidd_I2C_RiseFallTime)
67 #define aHidd_I2C_Name (HiddI2CAttrBase + aoHidd_I2C_Name)
69 #define IS_I2C_ATTR(attr, idx) \
70 (((idx) = (attr) - HiddI2CAttrBase) < num_Hidd_I2C_Attrs)
72 struct pHidd_I2C_PutBits
79 struct pHidd_I2C_GetBits
86 struct pHidd_I2C_Start
92 struct pHidd_I2C_Address
105 struct pHidd_I2C_PutByte
112 struct pHidd_I2C_GetByte
120 struct pHidd_I2C_WriteRead
130 struct pHidd_I2C_ProbeAddress
136 /* I2C device class */
138 #define CLID_Hidd_I2CDevice "hidd.i2c.device"
139 #define IID_Hidd_I2CDevice "hidd.i2c.device"
141 #define HiddI2CDeviceAttrBase __IHidd_I2CDevice
143 #ifndef __OOP_NOATTRBASES__
144 extern OOP_AttrBase HiddI2CDeviceAttrBase
;
147 /* I2C Device Class methods */
150 moHidd_I2CDevice_Read
,
151 moHidd_I2CDevice_ReadStatus
,
152 moHidd_I2CDevice_ReadByte
,
153 moHidd_I2CDevice_ReadBytes
,
154 moHidd_I2CDevice_ReadWord
,
155 moHidd_I2CDevice_Write
,
156 moHidd_I2CDevice_WriteByte
,
157 moHidd_I2CDevice_WriteBytes
,
158 moHidd_I2CDevice_WriteWord
,
159 moHidd_I2CDevice_WriteVec
,
160 moHidd_I2CDevice_WriteRead
,
167 aoHidd_I2CDevice_Driver
,
168 aoHidd_I2CDevice_Address
,
169 aoHidd_I2CDevice_HoldTime
,
170 aoHidd_I2CDevice_BitTimeout
,
171 aoHidd_I2CDevice_ByteTimeout
,
172 aoHidd_I2CDevice_AcknTimeout
,
173 aoHidd_I2CDevice_StartTimeout
,
174 aoHidd_I2CDevice_RiseFallTime
,
175 aoHidd_I2CDevice_Name
,
177 num_Hidd_I2CDevice_Attrs
180 #define aHidd_I2CDevice_Driver (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_Driver)
181 #define aHidd_I2CDevice_Address (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_Address)
182 #define aHidd_I2CDevice_HoldTime (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_HoldTime)
183 #define aHidd_I2CDevice_BitTimeout (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_BitTimeout)
184 #define aHidd_I2CDevice_ByteTimeout (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_ByteTimeout)
185 #define aHidd_I2CDevice_AcknTimeout (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_AcknTimeout)
186 #define aHidd_I2CDevice_StartTimeout (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_StartTimeout)
187 #define aHidd_I2CDevice_RiseFallTime (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_RiseFallTime)
188 #define aHidd_I2CDevice_Name (HiddI2CDeviceAttrBase + aoHidd_I2CDevice_Name)
190 #define IS_I2CDEV_ATTR(attr, idx) \
191 (((idx) = (attr) - HiddI2CDeviceAttrBase) < num_Hidd_I2CDevice_Attrs)
193 struct pHidd_I2CDevice_Read
200 struct pHidd_I2CDevice_ReadStatus
206 struct pHidd_I2CDevice_ReadByte
213 struct pHidd_I2CDevice_ReadBytes
221 struct pHidd_I2CDevice_ReadWord
228 struct pHidd_I2CDevice_Write
235 struct pHidd_I2CDevice_WriteByte
242 struct pHidd_I2CDevice_WriteBytes
250 struct pHidd_I2CDevice_WriteWord
257 struct pHidd_I2CDevice_WriteVec
264 struct pHidd_I2CDevice_WriteRead