![EVOC EC5-1812CLDNA(B) Manual Download Page 27](http://html1.mh-extra.com/html/evoc/ec5-1812cldna-b/ec5-1812cldna-b_manual_2446415027.webp)
Appendix
EC5-1812CLDNA(B)
- 23 -
GPIO Programming Guide
The motherboard provides a 4-bit digital I/O port. The following describes digital I/O
ports programming in C language. Note: before operating the digital I/O port, please
enter digital I/O ports programming mode first; after completing this operation, please
exit digital I/O ports programming mode.
The programming steps are as follows:
Enter digital I/O ports programming mode
Implement input/output operation for digital I/O port
Exit digital I/O ports programming mode
Please refer to the following code for digital I/O port programming:
unsigned long _pascal in_32(unsigned int io_port)
{
unsigned long ReturnValue;
_asm{
mov dx,io_port
in eax,dx
mov ReturnValue,eax
}
return ReturnValue;
}
void _pascal out_32(unsigned int io_port, unsigned long io_data)
{
_asm{
mov dx, io_port
mov eax, io_data
out dx, eax