2 Copyright © 2010-2014, The AROS Development Team. All rights reserved.
6 #include <aros/symbolsets.h>
7 #include <aros/debug.h>
8 #include <proto/exec.h>
12 #include <asm/amcc440.h>
15 #include "i2c-amcc440.h"
17 void METHOD(I2C440
, Hidd_I2C
, PutBits
)
19 /* Put i2c bus into reset state. Mandatory in order to control it manually */
20 outb(IIC_XTCNTLSS_SRST
, (UBYTE
*)IIC0_XTCNTLSS
);
24 val
|= (msg
->scl
? IIC_DIRECTCNTL_SCLC
: 0);
25 val
|= (msg
->sda
? IIC_DIRECTCNTL_SDAC
: 0);
27 outb(val
, (UBYTE
*)IIC0_DIRECTCNTL
);
30 void METHOD(I2C440
, Hidd_I2C
, GetBits
)
32 UBYTE val
= inb((UBYTE
*)IIC0_DIRECTCNTL
);
34 *msg
->sda
= (val
& IIC_DIRECTCNTL_MSDA
) != 0;
35 *msg
->scl
= (val
& IIC_DIRECTCNTL_MSCL
) != 0;
38 ADD2LIBS((STRPTR
)"i2c.hidd", 0, static struct Library
*, I2CBase
);