Gpio Sample Code - C&T Solution BCO-2000 Series User Manual

Compact fanless embedded system
Table of Contents

Advertisement

Appendix – WDT & GPIO

GPIO Sample Code

GPIO Setting
PIN#
GPIO#
10
SIO_GPO4
9
SIO_GPI
8
SIO_GPO 3
7
SIO_GPI 3
6
SIO_GPO 2
5
SIO_GPI 2
4
SIO_GPO 1
3
SIO_GPI1
2
GND
1
+5V
The GPIO function is provided by Nuvoton NCT6106D, and it can be accessed through its GPIO index/data port. To access the
GPIO register, write index to the index port, and then read/write from/to data port. The configuration on the RCO-6000 is
described as below.
Psuedo Code
#define AddrPort 0x2e
#define DataPort 0x2f
#define SIO_UnLock_Value
#define SIO_Lock_Value
#define SIO_LDN_GPIO
#define GPIO_Port
//Enter_Config
WriteByte (AddrPort, SIO_UnLock_Value);
WriteByte (AddrPort, SIO_UnLock_Value);
WriteByte (AddrPort, 0x07);
WriteByte (DataPort, SIO_LDN_GPIO);
//Set OUT1~OUT4Value
WriteByte (AddrPort, GPIO_Port);
WriteByte (DataPort, 0x00);
Default Configuration
DIO Output4
DIO Input4
DIO Output3
DIO Input3
DIO Output2
DIO Input2
DIO Output1
DIO Input1
GND
+5V
0x87
0xaa
0x07
0xF1
//set OUT1~OUT8 value, OUT1=Bit0, OUT2=Bit1
BCO-2000 l User's Manual
89

Advertisement

Table of Contents
loading

This manual is also suitable for:

Bco-2000-8365ueBco-2000-4305ue

Table of Contents