ITA-1611 User Manual
52
6.1 Function Call Reference
ICH SMBUS Access code
?The following codes simulate BIOS visiting SMBUS. Borland C++ 3.1 compiles
OK. This has be tested under DOS, nut not other OS?
#define SMBUS_PORT 0x400
//SMB_BASE?0x400
typedefunsigned char BYTE;
////////////////////////////////////////////////////////////////////////////////////////////////////
/
BYTEsmbus_read_byte(BYTE addr, BYTE offset)
//Read value of SMBUS Register byte. One byte value is returned each time,
among which addr is slave address,like 0x40?offset is register offset
{
int i;
BYTE data;
outportb(SMBU 4, (addr | 1));
//Write slave address to SMB_BASE
+ 4 (Before reading, please set slave address bit 0 to 1, so there is addr|1)
newiodelay();
//delay
newiodelay();
//delay
chk_smbus_ready();
//Determine if SMBUS is ready
outportb(SMBU 3, offset);
//Write register offset to SM 3
newiodelay();
//delay
newiodelay();
//delay
outportb(SMBU 2, 0x48);
//Write SBMBUS command toSMB_BASE
+ 2, 0x48 means starting Byte data transmission
newiodelay();
//delay
newiodelay();
//delay
for (i = 0; i <= 0x100; i++)
{
newiodelay();
//long time delay
}
chk_smbus_ready();
//Determine if SMBUS is ready
return(inportb(SMBU 5));
//Read byte value from SM 5
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/
voidsmbus_write_byte(BYTE addr, BYTE offset, BYTE value)
//Write SMBUS Register byte value. One byte value can be written each time,
among which addr indicates slave address, like 0x40; offset is register offset;
value is the value to be written
{
int i;
outportb(SMBU 4, addr);
//Write slave address to SM 4
(Please set slave address bit 0 to 0 before writing)
moredelay();
//long time delay
moredelay();
//long time delay
Summary of Contents for ITA-1611 Series
Page 1: ...User Manual ITA 1611 Series Fanless Embedded Celeron Dual Core Compact Industrial Computer...
Page 11: ...Chapter 1 1 Overview This chapter provides general Information about the ITA 1611...
Page 15: ...Chapter 2 2 H W Installation This chapter provides H W Instal lation about the ITA 1611...
Page 27: ...Chapter 3 3 System Setup This chapter introduces the instal lation process of ITA 1611...
Page 33: ...Chapter 4 4 AMI BIOS This chapter introduces how to configure AMI BIOS...
Page 52: ...ITA 1611 User Manual 42...
Page 53: ...Chapter 5 5 Driver Installation This chapter describes how to Install drivers...
Page 57: ...Chapter 6 6 GPIO Programming Guide This chapter introduces GPIO pro gramming guide...
Page 66: ...ITA 1611 User Manual 56...