EasyManua.ls Logo

Quanmax KEEX-1760 Series - Page 57

Quanmax KEEX-1760 Series
60 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix A
57
KEEX
-
17
6
0 Series Use rs Manual
__emit__(
0x66,0x50, // push EAX
0x66,0xED, // in EAX,DX
0x66,0x89,0x07, // mov [BX],EAX
0x66,0x58
); // pop EAX
return dwRet;
}
void outpd(int portid, DWORD dwVal)
{
asm mov dx, portid;
asm lea bx, dwVal;
__emit__(
0x66,0x50, // push EAX
0x66,0x8B,0x07, // mov EAX,[BX]
0x66,0xEF, // out DX,EAX
0x66,0x58
); // pop EAX
}
int main()
{
int gDioGpio[] = {4, 5, 6, 7, 22, 23, 24, 25};
DWORD gGpioLvValue = 0;
int i = 0;
//Set DIO_0~7 as Input
//1:input 0:output
for (i=0; i<8; ++i)
SET_IO32(GPIO_B ASE+GPIO1_SEL, 0x01 << gDioGpio[i]);
//Read DIO_0~7 value
printf("Read DIO_0~7 value\n");
for (i=0; i< 8; i++)
{

Table of Contents