revert between 56095 -> 55830 in arch
[AROS.git] / workbench / hidds / i2c / stubs / i2c_stubs.c
blobccd80e83efb621f6e7018dab5e1252f93e1f82e4
1 /*
2 Copyright © 2004, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Stub functions for PCI subsystem
6 Lang: English
7 */
9 #ifndef AROS_USE_OOP
10 # define AROS_USE_OOP
11 #endif
13 #include <exec/types.h>
14 #include <exec/libraries.h>
16 #include <utility/tagitem.h>
17 #include <utility/hooks.h>
19 #include <oop/oop.h>
20 #include <oop/static_mid.h>
22 #include <hidd/hidd.h>
23 #include <hidd/i2c.h>
25 #include <proto/oop.h>
27 #undef OOPBase
28 #define OOPBase (OOP_OOPBASE(obj))
30 /***************************************************************************/
32 BOOL HIDD_I2C_ProbeAddress(OOP_Object *obj, UWORD address)
34 STATIC_MID;
35 struct pHidd_I2C_ProbeAddress p, *msg=&p;
37 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2C, moHidd_I2C_ProbeAddress);
39 p.mID = static_mid;
40 p.address = address;
42 return OOP_DoMethod(obj, (OOP_Msg) msg);
45 BOOL HIDD_I2CDevice_ReadStatus(OOP_Object *obj, UBYTE *status)
47 STATIC_MID;
48 struct pHidd_I2CDevice_ReadStatus p, *msg=&p;
50 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadStatus);
52 p.mID = static_mid;
53 p.status = status;
55 return OOP_DoMethod(obj, (OOP_Msg) msg);
58 BOOL HIDD_I2CDevice_Read(OOP_Object *obj, APTR buffer, ULONG length)
60 STATIC_MID;
61 struct pHidd_I2CDevice_Read p, *msg=&p;
63 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_Read);
65 p.mID = static_mid;
66 p.readBuffer = buffer;
67 p.readLength = length;
69 return OOP_DoMethod(obj, (OOP_Msg) msg);
72 BOOL HIDD_I2CDevice_ReadByte(OOP_Object *obj, UBYTE subaddr, UBYTE *data)
74 STATIC_MID;
75 struct pHidd_I2CDevice_ReadByte p, *msg=&p;
77 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadByte);
79 p.mID = static_mid;
80 p.subaddr = subaddr;
81 p.data = data;
83 return OOP_DoMethod(obj, (OOP_Msg) msg);
86 BOOL HIDD_I2CDevice_ReadBytes(OOP_Object *obj, UBYTE subaddr, UBYTE *data, ULONG length)
88 STATIC_MID;
89 struct pHidd_I2CDevice_ReadBytes p, *msg=&p;
91 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadBytes);
93 p.mID = static_mid;
94 p.subaddr = subaddr;
95 p.data = data;
96 p.length = length;
98 return OOP_DoMethod(obj, (OOP_Msg) msg);
101 BOOL HIDD_I2CDevice_ReadWord(OOP_Object *obj, UBYTE subaddr, UWORD *data)
103 STATIC_MID;
104 struct pHidd_I2CDevice_ReadWord p, *msg=&p;
106 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadWord);
108 p.mID = static_mid;
109 p.subaddr = subaddr;
110 p.data = data;
112 return OOP_DoMethod(obj, (OOP_Msg) msg);
115 BOOL HIDD_I2CDevice_Write(OOP_Object *obj, APTR buffer, ULONG length)
117 STATIC_MID;
118 struct pHidd_I2CDevice_Write p, *msg=&p;
120 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_Write);
122 p.mID = static_mid;
123 p.writeBuffer = buffer;
124 p.writeLength = length;
126 return OOP_DoMethod(obj, (OOP_Msg) msg);
129 BOOL HIDD_I2CDevice_WriteByte(OOP_Object *obj, UBYTE subaddr, UBYTE data)
131 STATIC_MID;
132 struct pHidd_I2CDevice_WriteByte p, *msg=&p;
134 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteByte);
136 p.mID = static_mid;
137 p.subaddr = subaddr;
138 p.data = data;
140 return OOP_DoMethod(obj, (OOP_Msg) msg);
143 BOOL HIDD_I2CDevice_WriteBytes(OOP_Object *obj, UBYTE subaddr, UBYTE *data, ULONG length)
145 STATIC_MID;
146 struct pHidd_I2CDevice_WriteBytes p, *msg=&p;
148 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteBytes);
150 p.mID = static_mid;
151 p.subaddr = subaddr;
152 p.data = data;
153 p.length = length;
155 return OOP_DoMethod(obj, (OOP_Msg) msg);
158 BOOL HIDD_I2CDevice_WriteWord(OOP_Object *obj, UBYTE subaddr, UWORD data)
160 STATIC_MID;
161 struct pHidd_I2CDevice_WriteWord p, *msg=&p;
163 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteWord);
165 p.mID = static_mid;
166 p.subaddr = subaddr;
167 p.data = data;
169 return OOP_DoMethod(obj, (OOP_Msg) msg);
172 BOOL HIDD_I2CDevice_WriteVec(OOP_Object *obj, UBYTE *data, ULONG length)
174 STATIC_MID;
175 struct pHidd_I2CDevice_WriteVec p, *msg=&p;
177 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteVec);
179 p.mID = static_mid;
180 p.data = data;
181 p.length = length;
183 return OOP_DoMethod(obj, (OOP_Msg) msg);