Copyright © 2017 NEXCOM International Co., Ltd. All Rights Reserved.
47
NIFE 103 User Manual
Appendix C: GPI/O Programming Guide
GPIO programming sample code
#define MEMORY_BASE_ADDRESS
0xFED0E000
#define NCT7904D_SLAVEADDRESS
0x5A
#define SMBUS_BASE_ADDRESS
0xE000
#define GPO7_HI
MmioWrite(MEMORY_BASE_0x168, 0x00000001)
#define GPO7_LO
MmioWrite(MEMORY_BASE_0x168, 0x00000000)
#define GPO8_HI
MmioWrite(MEMORY_BASE_0x158, 0x00000001)
#define GPO8_LO
MmioWrite(MEMORY_BASE_0x158, 0x00000000)
#define GPO9_HI
MmioWrite(MEMORY_BASE_0x188, 0x00000001)
#define GPO9_LO
MmioWrite(MEMORY_BASE_0x188, 0x00000000)
#define GPO10_HI
MmioWrite(MEMORY_BASE_0x198, 0x00000001)
#define GPO10_LO
MmioWrite(MEMORY_BASE_0x198, 0x00000000)
//SmbusWriteByte, Please refer to Smbus Write Byte Protocol
#define GPOC2_HI
SmbusWriteByte (0xEA, XXXX1XXXb)
#define GPOC2_LO
SmbusWriteByte (0xEA, XXXX0XXXb)
#define GPOC1_HI
SmbusWriteByte (0xEA, XXX1XXXXb)
#define GPOC1_LO
SmbusWriteByte (0xEA, XXX0XXXXb)
void main(void)
{
GPO7_HI;
GPO8_LO;
GPO9_HI;
GPO10_LO;
GPOC2_HI;
GPOC1_LO;
}