®
CAPA830 Intel
Atom
/* ------------------ MAIN PROGRAM ------------------*/
main()
{
UCHAR
xch,xch2;
UINT
chipid=0, vendorid=0;
/*Check the Chip ID information*/
xch=_read_smbus(Device_Addr,0x5a);
xch2=_read_smbus(Device_Addr,0x5b);
chipid=((UINT)xch2 << 8) + (UINT)xch;
xch=_read_smbus(Device_Addr,0x5d);
xch2=_read_smbus(Device_Addr,0x5E);
vendorid=((UINT)xch2 << 8) + (UINT)xch;
if (F75111_CHIPID != chipid || F75111_VENDORID != vendorid )
{ printf("!!! Not found F75111 chip !!!\n");
exit(-1);
}
printf("=== Found F75111 chip ===\n");
printf("=== GPIO Output Test ===\n");
/*set GPIO2x direction*/
printf("Set F75111 GPIO2x pin is output direction\n");
_write_smbus(Device_Addr,0x20,0x1f);
/*set GPIO2x output level or plus*/
printf("Set F75111 GPIO2x pin is output Level\n");
_write_smbus(Device_Addr,0x23,0);
/*write GPIO2x data*/
printf("Write GPIO2x data is 0x0A\n");
printf("GPO0=0, GPO1=1, GPO2=0, GPO3=1, GPIO4=0\n");
_write_smbus(Device_Addr,0x21,0x0a);
printf("Please check the GPO level and hit any key to continue\n");
getch();
/*write GPIO2x data*/
printf("Write GPIO2x data is 0x15\n");
printf("GPO0=1, GPO1=0, GPO2=1, GPO3=0, GPIO4=1\n");
_write_smbus(Device_Addr,0x21,0x15);
printf("Please check the GPO level and hit any key to continue\n");
getch();
/*set GPIO10,11,12 used*/
printf("=== GPIO Input Test ===\n");
printf("Set F75111 GPIO1x is used GPIO function\n");
xch=_read_smbus(Device_Addr,0x03);
xch &= 0xE0 ;
_write_smbus(Device_Addr,0x03,xch);
_write_smbus(Device_Addr,0x04,0);
printf("Set F75111 GPIO10,11,12 is input function\n");
_write_smbus(Device_Addr,0x10,0x00);
printf("Set F75111 GPIO10,11,12 is Level mode\n");
_write_smbus(Device_Addr,0x13,0x00);
xch=_read_smbus(Device_Addr,0x12);
printf("Read the GPI0,1,2 input data is %02X\n",xch);
printf("Please Change the GPIx input and hit any key to continue\n");
getch();
xch=_read_smbus(Device_Addr,0x12);
printf("Read the GPI0,1,2 input data is %02X\n",xch);
printf("Please Change the GPIx input and hit any key to continue\n");
getch();
xch=_read_smbus(Device_Addr,0x12);
printf("Read the GPI0,1,2 input data is %02X\n",xch);
}
void _write_smbus(UCHAR xAddr,UCHAR xReg, UCHAR xData)
{
while (1)
{ if (_check_smbus_busy()==0) break;
}
76
TM
D2550/N2800/N2600 Processor 3.5" SBC
/*Chip ID 1*/
/*Chip ID 2*/
/*Vendor ID 1*/
/*Vendor ID 2*/
/*GPIO2x Output direction*/
/*GPIO2x Level control*/
/*set Pin GPIO10/11/12 used*/
/*set Pin GPIO1x used*/
/*set GPIO1x input direction*/
/*set GPIO1x Level Control*/
/*read GPIO1x Status*/
/*read GPIO1x Status*/
/*read GPIO1x Status*/
Digital I/O
Need help?
Do you have a question about the CAPA830 and is the answer not in the manual?
Questions and answers