Fixed typo in comments.
[tangerine.git] / arch / common / hidd.i2c / stubs / i2c_stubs.c
blob09bd4f575ef06675e505b72e860a70a20f691acb
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>
21 #include <hidd/hidd.h>
22 #include <hidd/i2c.h>
24 #include <proto/oop.h>
26 #undef OOPBase
27 #define OOPBase (OOP_OOPBASE(obj))
29 #ifdef AROS_CREATE_ROM
30 #error Do not use stubs in ROM code!!!
31 #else
32 #define STATIC_MID static OOP_MethodID mid
33 #endif
35 /***************************************************************************/
37 BOOL HIDD_I2C_ProbeAddress(OOP_Object *obj, UWORD address)
39 STATIC_MID;
40 struct pHidd_I2C_ProbeAddress p, *msg=&p;
42 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2C, moHidd_I2C_ProbeAddress);
44 p.mID = mid;
45 p.address = address;
47 return OOP_DoMethod(obj, (OOP_Msg) msg);
50 BOOL HIDD_I2CDevice_ReadStatus(OOP_Object *obj, UBYTE *status)
52 STATIC_MID;
53 struct pHidd_I2CDevice_ReadStatus p, *msg=&p;
55 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadStatus);
57 p.mID = mid;
58 p.status = status;
60 return OOP_DoMethod(obj, (OOP_Msg) msg);
63 BOOL HIDD_I2CDevice_Read(OOP_Object *obj, APTR buffer, ULONG length)
65 STATIC_MID;
66 struct pHidd_I2CDevice_Read p, *msg=&p;
68 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_Read);
70 p.mID = mid;
71 p.readBuffer = buffer;
72 p.readLength = length;
74 return OOP_DoMethod(obj, (OOP_Msg) msg);
77 BOOL HIDD_I2CDevice_ReadByte(OOP_Object *obj, UBYTE subaddr, UBYTE *data)
79 STATIC_MID;
80 struct pHidd_I2CDevice_ReadByte p, *msg=&p;
82 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadByte);
84 p.mID = mid;
85 p.subaddr = subaddr;
86 p.data = data;
88 return OOP_DoMethod(obj, (OOP_Msg) msg);
91 BOOL HIDD_I2CDevice_ReadBytes(OOP_Object *obj, UBYTE subaddr, UBYTE *data, ULONG length)
93 STATIC_MID;
94 struct pHidd_I2CDevice_ReadBytes p, *msg=&p;
96 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadBytes);
98 p.mID = mid;
99 p.subaddr = subaddr;
100 p.data = data;
101 p.length = length;
103 return OOP_DoMethod(obj, (OOP_Msg) msg);
106 BOOL HIDD_I2CDevice_ReadWord(OOP_Object *obj, UBYTE subaddr, UWORD *data)
108 STATIC_MID;
109 struct pHidd_I2CDevice_ReadWord p, *msg=&p;
111 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_ReadWord);
113 p.mID = mid;
114 p.subaddr = subaddr;
115 p.data = data;
117 return OOP_DoMethod(obj, (OOP_Msg) msg);
120 BOOL HIDD_I2CDevice_Write(OOP_Object *obj, APTR buffer, ULONG length)
122 STATIC_MID;
123 struct pHidd_I2CDevice_Write p, *msg=&p;
125 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_Write);
127 p.mID = mid;
128 p.writeBuffer = buffer;
129 p.writeLength = length;
131 return OOP_DoMethod(obj, (OOP_Msg) msg);
134 BOOL HIDD_I2CDevice_WriteByte(OOP_Object *obj, UBYTE subaddr, UBYTE data)
136 STATIC_MID;
137 struct pHidd_I2CDevice_WriteByte p, *msg=&p;
139 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteByte);
141 p.mID = mid;
142 p.subaddr = subaddr;
143 p.data = data;
145 return OOP_DoMethod(obj, (OOP_Msg) msg);
148 BOOL HIDD_I2CDevice_WriteBytes(OOP_Object *obj, UBYTE subaddr, UBYTE *data, ULONG length)
150 STATIC_MID;
151 struct pHidd_I2CDevice_WriteBytes p, *msg=&p;
153 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteBytes);
155 p.mID = mid;
156 p.subaddr = subaddr;
157 p.data = data;
158 p.length = length;
160 return OOP_DoMethod(obj, (OOP_Msg) msg);
163 BOOL HIDD_I2CDevice_WriteWord(OOP_Object *obj, UBYTE subaddr, UWORD data)
165 STATIC_MID;
166 struct pHidd_I2CDevice_WriteWord p, *msg=&p;
168 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteWord);
170 p.mID = mid;
171 p.subaddr = subaddr;
172 p.data = data;
174 return OOP_DoMethod(obj, (OOP_Msg) msg);
177 BOOL HIDD_I2CDevice_WriteVec(OOP_Object *obj, UBYTE *data, ULONG length)
179 STATIC_MID;
180 struct pHidd_I2CDevice_WriteVec p, *msg=&p;
182 if (!mid) mid = OOP_GetMethodID((STRPTR)IID_Hidd_I2CDevice, moHidd_I2CDevice_WriteVec);
184 p.mID = mid;
185 p.data = data;
186 p.length = length;
188 return OOP_DoMethod(obj, (OOP_Msg) msg);