2 Copyright © 2010-2019, The AROS Development Team. All rights reserved.
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>
20 #include <aros/arossupportbase.h>
21 #include <exec/execbase.h>
23 #include <hardware/bcm2708.h>
25 static inline ULONG
rd32le(IPTR iobase
) {
27 val
= AROS_LE2LONG(*(volatile ULONG
*)(iobase
));
31 static inline UWORD
rd16le(IPTR iobase
) {
33 val
= AROS_LE2WORD(*(volatile UWORD
*)(iobase
));
37 static inline UBYTE
rd8(IPTR iobase
) {
39 val
= *(volatile UBYTE
*)(iobase
);
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 */