Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Drivers / Envy24 / I2C.h
blob5ba42e73f43c3c578a43c8ab75de4dcdca08edf0
1 /*
2 Copyright � 2004-2014, Davy Wentzler. All rights reserved.
3 $Id$
4 */
6 #ifndef I2C_H
7 #define I2C_H
10 struct I2C;
11 struct CardData;
13 struct I2C_bit_ops {
14 void (*Start)(struct CardData *card);
15 void (*Stop)(struct CardData *card);
16 void (*SetDir_CLK_SDA)(struct CardData *card, int clock, int data); /* set line direction (0 = write, 1 = read) */
17 void (*Write_CLK_SDA)(struct CardData *card, int clock, int data);
18 int (*GetClock)(struct CardData *card);
19 int (*GetData)(struct CardData *card, int ack);
22 struct I2C {
23 unsigned short flags; // some private data
24 unsigned short addr;
26 struct I2C_bit_ops *bit; // with a pointer, the specific card information can be put in a struct and assigned to this attribute
30 struct I2C *AllocI2C(unsigned char addr);
31 void FreeI2C(struct I2C *device);
33 int WriteBytesI2C(struct CardData *card, struct I2C *device, unsigned char *bytes, int count);
34 int ReadBytesI2C(struct CardData *card, struct I2C *device, unsigned char *bytes, int count);
35 int ProbeAddressI2C(struct CardData *card, unsigned short addr);
37 #endif /* I2C_H */