Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Drivers / Envy24HT / I2C.h
blob758b8e8112aa88f6e7fed500dc4c5be324bf173e
1 /*
2 Copyright © 2005-2013, 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 (*GetData)(struct CardData *card, int ack);
21 struct I2C {
22 unsigned short flags; // some private data
23 unsigned short addr;
25 struct I2C_bit_ops *bit; // with a pointer, the specific card information can be put in a struct and assigned to this attribute
29 struct I2C *AllocI2C(unsigned char addr);
30 void FreeI2C(struct I2C *device);
32 int WriteBytesI2C(struct CardData *card, struct I2C *device, unsigned char *bytes, int count);
33 int ReadBytesI2C(struct CardData *card, struct I2C *device, unsigned char *bytes, int count);
34 int ProbeAddressI2C(struct CardData *card, unsigned short addr);
36 #endif /* I2C_H */