System Installation
ROBO-8112VG2AR User’s Manual
3-11
outp(S1,
value);
//printf("Write offset:%x = %x\n", offset, value);
}
//Or register
void Or_Register(unsigned char offset, unsigned char value) {
outp(SIO_Port,
offset);
outp(S1, inp(S1) | value);
//printf("Write offset:%x = %x\n", offset, value);
}
//And register
void And_Register(unsigned char offset, unsigned char value) {
outp(SIO_Port,
offset);
outp(S1, inp(S1) & value);
//printf("Write offset:%x = %x\n", offset, value);
}
int main(void) {
int
result;
printf("ROBO-8112 GPIO Test:\n");
//pin1 =11
//pin3 =12
//pin5 =47
//pin7 =50
//pin2 =14
//pin4 =35
//pin6 =36
//pin8 =37
Enter_IT872x_SIO();
Set_LDN(GPIO_LDN);
//Enable
GPIO
//Or_Register(0xC0,0x46)
//11,12,14
//Or_Register(0xC2,0xE0)
//35,36,37
//Or_Register(0xC3,0x80)
//47
//Or_Register(0xC4,0x01)
//50
//Set
Output
Or_Register(0xC8,0x06);
//11,12
Or_Register(0xCB,0x80);
//47