English
Language : 

AK4184 Datasheet, PDF (26/36 Pages) Asahi Kasei Microsystems – TSC with Keypad Scanner and GPIO Expander
[AK4184]
■ GPIO controller
The AK4184 has eight ports [GP0:GP7] which can be configured as inputs or outputs for general purpose. Figure 14
shows a block diagram of a single GPIO pin. The GPIO Pin Direction register (GPDR) is used to program the GPIO
pins as input or output. For a pin configured as output, use the GPIO pin pull-up register (GPPU) to set the pin type to
either Open-Drain or CMOS, and use the GPIO Set/Clear register (GPSCR) to set a pin level high or low.
To validate the state of GP0 ~GP7 pins, write to the GPIO pin state register (GPSR) to program the pin state as pull-
down or Hi-Z and read the GPIO Pin Level register (GPLR) at any time even if the pin is configured as an output. The
GPIO pin state is determined by these registers before writing and reading the pin level.
The pin state set by default input, pull-down.
Pin Direction
(GPDR)
Pin Pull-up
(GPPU)
Pin State
(GPSR)
Pin Set
(GPSCR)
Pin Level
(GPLR)
GPIO Pin
Figure 14. General-Purpose I/O Block Diagram
■ GPIO Pin Set/Clear Register (PAGE 1)
The GPIO pin set/clear register sets the pin level when the pin is configured as an output (Table 28: IO bit = “1”).
GPSCR is a write-only register. The actual pin level is read from the GPLR register.
Addr
10H
Name D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
GPSCR 0 0 0 0 0 0 0 0 SC7 SC6 SC5 SC4 SC3 SC2 SC1 SC0
Table 25. GPIO Pin Set/Clear Register Format
Bits Name
Description
15:8
Reserved
7:0
SC Set GPIO Pin level for GPIO pins
0 = Set pin level low (default)
1 = Set pin level high
Table 26. GPIO Pin Set/Clear Register
■ GPIO Pin Direction Register (PAGE 1 )
Whether a pin is input or an output is determined by the GPDR register. The GPDR contains one direction-control bit
for each of the eight GPIO pins.
Addr
11H
Name
GPDR
D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3
IO7 IO6 IO5 IO4 IO3 IO2 IO1 IO0 0 0 0 0 0
Table 27. GPIO Pin Direction Register Format
D2 D1 D0
000
Bits Name
Description
15:8 IO GPIO Direction select
0 = GPIO pin configured as input. (default)
1 = GPIO pin configured as output.
7:0
Reserved
Table 28. GPIO Direction Register
MS0603-E-00
26
2007/04