Icegd_escape_i2c_access, 18 icegd_escape_i2c_access – Intel 82854 GMCH User Manual
Page 48
 
48
Intel® Digital Set Top Box Display Driver
User’s Guide for Microsoft* Windows* CE 5.0
7.1.1.18 ICEGD_ESCAPE_I2C_ACCESS
Input Data Structure
Output Data Structure
Notes
esc_i2c_access_t unsigned
char
In case of read operation, data is returned in output buffer. 
Write operation data is retrieved from the esc_i2c_access_t 
input buffer. 
Description
This escape code is used to access I2C. It can implement a read or write operation by setting the mode.
Input Data Structure Definition
Please refer icegd_public_escape.h for details about esc_i2c_access_t;
Example
esc_i2c_config_t i2c_config; 
esc_i2c_access_t i2c_access; 
unsigned char data; 
unsigned char data2; 
 
memset(&i2c_config, 0, sizeof(esc_i2c_config_t)); 
memset(&i2c_access, 0, sizeof(esc_i2c_access_t)); 
 
//the data is only for cx892. 
// please refer to special documents for different cards 
i2c_config.bus = 4; 
i2c_config.dab = 0x88; 
i2c_config.speed = 200; 
 
/* Configure I2C Bus access */ 
ExtEscape( 
 Hdc, 
 ICEGD_ESCAPE_I2C_CONFIG, 
 sizeof(esc_i2c_config_t), 
 (LPCSTR)&i2c_config, 
 0, 
 NULL); 
 
i2c_access.addr = 0x54; 
i2c_access.mode = INTEL_I2C_MODE_READ; 
 
/* Read a character from address 0x54 */ 
ExtEscape( 
 Hdc, 
 ICEGD_ESCAPE_I2C_ACCESS, 
 sizeof(esc_i2c_access_t), 
 (LPCSTR)&i2c_access, 
 sizeof(unsigned 
char),
 (LPSTR)&data); 
 
/* Write data 140 back */ 
i2c_access.mode = INTEL_I2C_MODE_WRITE; 
i2c_access.data = 140; 
ExtEscape( 
 Hdc, 
 ICEGD_ESCAPE_I2C_ACCESS, 
 sizeof(esc_i2c_access_t), 
 (LPCSTR)&i2c_access, 
 sizeof(unsigned 
char),
 (LPSTR)&data); 
printf("%d\n",data);