WCO-3400 | User’s Manual
59
Sample Code:
#1 :
// Get GPI 1 status
//Get GPI 0 Pin Status Register
printf("Input port value = %x\n",
ReadByte
(
GPI1to4_ADDR
));
// bit4 = GPI 1 status
// Get GPI 5 status
//Get GPI 0 Pin Status Register
printf("Input port value = %x\n",
ReadByte
(
GPI_REG5to8
));
// bit0 = GPI 5 status
#2 :
// Set GPO status to high
; Set GPO 1 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO1_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO1 to High
; Set GPO 2 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO2_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO2 to High
; Set GPO 3 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO3_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO3 to High
; Set GPO 4 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO4_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO4 to High
; Set GPO 5 Pin to High
Data = ReadByte(GPO5_ADDR) | GPO5_DataHigh;
WriteByte(GPO5_ADDR, Data); //Set IO_DO5 to High
; Set GPO 6 Pin to High
Data = ReadByte(GPO6_ADDR) | GPO6_DataHigh;
WriteByte(GPO6_ADDR, Data); //Set IO_DO6 to High
; Set GPO 7 Pin to High
Data = ReadByte(GPO7_ADDR) | GPO7_DataHigh;
WriteByte(GPO7_ADDR, Data); //Set IO_DO7 to High
; Set GPO 8 Pin to High
Data = ReadByte(GPO8_ADDR) | GPO8_DataHigh;
WriteByte(GPO8_ADDR, Data); //Set IO_DO8 to High
Appendix – WDT & GPIO
Summary of Contents for WCO-3400 Series
Page 1: ...USER S MANUAL WCO 3400 Series IP65 IP67 Waterproof Systems ...
Page 8: ...Chapter 1 Product Introductions ...
Page 14: ...Chapter 2 Connectors ...
Page 16: ...WCO 3400 User s Manual 16 2 1 2 Bottom View Chapter 2 Connectors ...
Page 20: ...Chapter 3 System Setup ...
Page 32: ...Chapter 4 BIOS Setup ...
Page 35: ...WCO 3400 User s Manual 4 3 Advanced Setup 35 Chapter 4 BIOS Setup ...
Page 60: ...Copyright Premio Inc All Rights Reserved www premioinc com ...