PC400 / PC410 l User’s Manual
70
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 PC400 Series
Page 1: ...PC400 Series PC Module...
Page 8: ...Chapter 1 Product Introductions...
Page 17: ...PC400 PC410 l User s Manual 17 1 4 2 PC410 Unit mm Chapter 1 Product Introductions...
Page 18: ...Chapter 2 Switches and Connectors...
Page 20: ...PC400 PC410 l User s Manual 20 2 1 2 Bottom View Chapter 2 Switches and Connectors...
Page 33: ...Chapter 3 System Setup...
Page 43: ...Chapter 4 BIOS Setup...
Page 46: ...PC400 PC410 l User s Manual 4 3 Advanced Setup 46 Chapter 4 BIOS Setup...
Page 71: ...Copyright 2016 C T Solution Inc All Rights Reserved www candtsolution com...