Appendix A
71
BEM-100F series User’s Manual
{
int
GPIOBASE
=
0xA04;
int
RetVal;
int
i;
int
Temp;
//Set DIO_0~7 as Input
//0:input 1:output
Set_SIO_LD(0x07);
RetVal = Get_SIO_Reg(0xCC);
RetVal
&=
0x00;
Set_SIO_Reg(0xCC,
RetVal);
//Read DIO_0~7 value
RetVal = inportb(GPIOBASE);
printf("Read DIO_0~7 value\n");
for (i=0; i<8; i++)
{
Temp = (RetVal>>i) & 0x01;
printf("DIO_%d = %d\n",i ,Temp);
}
system("pause");
//Set DIO_0~7 as Output
//0:input 1:output
Set_SIO_LD(0x07);
RetVal = Get_SIO_Reg(0xCC);
RetVal
|=
0xFF;
Set_SIO_Reg(0xCC,
RetVal);
//set DIO_0~7 to High
printf("Set DIO_0~7 to High\n");
outportb(GPIOBASE,
0xFF);
system("pause");
//set DIO_0~7 to Low
printf("Set DIO_0~7 to Low\n");
Содержание BEM-100F
Страница 21: ...Chapter 1 21 BEM 100F series User s Manual Figure 2 Mechanical Dimensions ...
Страница 72: ...Appendix A 72 BEM 100F series User s Manual outportb GPIOBASE 0x00 system pause return 0 ...
Страница 74: ...Appendix B 74 BEM 100F series User s Manual Exit the MB PnP Mode outp 0x2E 0x02 outp 0x2F 0x02 return 0 ...