1 /******************************************************************************
5 / Description: ATI Radeon I2C Serial Bus interface.
7 / Copyright 2001, Carlos Hasan
9 *******************************************************************************/
11 #ifndef __I2C_PORT_H__
12 #define __I2C_PORT_H__
16 enum i2c_port_clock_rate
{
17 C_RADEON_I2C_MIN_CLOCK_RATE
= 7500,
18 C_RADEON_I2C_MAX_CLOCK_RATE
= 100000,
19 C_RADEON_I2C_DEFAULT_CLOCK_RATE
= 80000
24 CI2CPort(CRadeon
& radeon
, int rate
= C_RADEON_I2C_DEFAULT_CLOCK_RATE
);
28 status_t
InitCheck() const;
30 CRadeon
& Radeon() const;
32 bool Probe(int address
);
35 bool Write(int address
, const char * buffer
, int length
);
37 bool Read(int address
, char * buffer
, int length
);
39 bool Write(int address
, const char * buffer
, int length
, char * output
, int outlen
);
42 int Register(int address
, int index
);
44 void SetRegister(int address
, int index
, int value
);
47 int Send(int address
, const char * buffer
, int length
, bool start
, bool stop
);
49 int Receive(int address
, char * buffer
, int length
, bool start
, bool stop
);