revert between 56095 -> 55830 in arch
[AROS.git] / arch / arm-native / soc / broadcom / 2708 / hidd / i2c / i2c-bcm2708.h
blob60a4127620b6a99dee133875c0b913a8e7734e33
1 /*
2 Copyright © 2010-2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef I2C_BCM2708_H
7 #define I2C_BCM2708_H
9 #include <aros/macros.h>
10 #include <exec/types.h>
11 #include <exec/libraries.h>
12 #include <exec/execbase.h>
13 #include <exec/nodes.h>
14 #include <exec/lists.h>
16 #include <dos/bptr.h>
18 #include <oop/oop.h>
20 #include <aros/arossupportbase.h>
21 #include <exec/execbase.h>
23 #include <hardware/bcm2708.h>
25 static inline ULONG rd32le(IPTR iobase) {
26 ULONG val;
27 val = AROS_LE2LONG(*(volatile ULONG *)(iobase));
28 return val;
31 static inline UWORD rd16le(IPTR iobase) {
32 UWORD val;
33 val = AROS_LE2WORD(*(volatile UWORD *)(iobase));
34 return val;
37 static inline UBYTE rd8(IPTR iobase) {
38 UBYTE val;
39 val = *(volatile UBYTE *)(iobase);
40 return val;
43 static inline void wr32le(IPTR iobase, ULONG value) {
44 *(volatile ULONG *)(iobase) = AROS_LONG2LE(value);
47 static inline void wr16le(IPTR iobase, UWORD value) {
48 *(volatile UWORD *)(iobase) = AROS_WORD2LE(value);
51 static inline void wr8be(IPTR iobase, UBYTE value) {
52 *(volatile UBYTE *)(iobase) = value;
55 struct i2cbcm2708base {
56 struct Library i2c_LibNode;
57 OOP_Class * i2c_DrvClass;
60 #define METHOD(base, id, name) \
61 base ## __ ## id ## __ ## name (OOP_Class *cl, OOP_Object *o, struct p ## id ## _ ## name *msg)
63 #define METHOD_NAME(base, id, name) \
64 base ## __ ## id ## __ ## name
66 #define METHOD_NAME_S(base, id, name) \
67 # base "__" # id "__" # name
69 #define BASE(lib) ((struct pcibase*)(lib))
71 #endif /* I2C_BCM2708_H */