System Installation
RUBY-D716VG2AR User’s Manual
3-26
{
tmp
=
EC_GetRamByte(EC_PIN8_VALUE_ADDR);
tmp &= ~EC_Bit7;
EC_SetRamByte(EC_PIN8_VALUE_ADDR,
tmp);
}
else
{
tmp
=
EC_GetRamByte(EC_PIN8_VALUE_ADDR);
tmp
|=
EC_Bit7;
EC_SetRamByte(EC_PIN8_VALUE_ADDR,
tmp);
}
break;
default:
printf("invalid pin number when writing to
gpio\n");
return
1;
}
return 0;
}
int gpio_write (unsigned char value)
{
unsigned char data;
int i;
for (i = 0; i < 8; i++)
gpio_writepin (2, i+1, value & (0x01 << i));
return
0;
}
int main(void)
{
unsigned char gpio_dir;
unsigned char gpio_value;
int i;
unsigned char gpio_pin, gpio_direction;
unsigned char d2;
printf("RUBY-D716VG2AR GPIO (EC line) TEST Program v1.0\n");
printf("Please short the following pins with jumper on GPIO\n");