PKP
VS1000 P
ROGRAMMER
’
S
G
UIDE
VSMPG
14
Interruptable General Purpose IO (VS1000)
v1.0 2002-04-23
14.1
General
This chapter describes the interrupt-capable 16-bit general-purpose I/O block for VS_DSP.
Note that in VS1000, pin function is partly handled also by the System Controller:
GPIOn_MODE register bits control whether output data for a GPIO pin is taken from
a peripheral function (mode=“1”) or the GPIO controller (mode=“0”).
14.2
Registers
Interruptable General I/O registers, prefix GPIOx_
Reg
Type
Reset
Abbrev
Description
0
r/w
0
DDR
Data direction
1
r/w
0
ODATA
Data output
2
r
0
IDATA
Data input (I/O pin state)
3
r/w
0
INT_FALL
Falling edge interrupt enable
4
r/w
0
INT_RISE
Rising edge interrupt enable
5
r/w
0
INT_PEND
Interrupt pending source
6
w
0
SET_MASK
Data set (
→
1) mask
7
w
0
CLEAR_MASK
Data clear (
→
0) mask
8
r/w
0
BIT_CONF
Bit engine config 0 and 1
9
r/w
0
BIT_ENG0
Bit engine 0 read/write
10
r/w
0
BIT_ENG1
Bit engine 1 read/write
14.2.1
Data Direction GPIOx_DDR
The data direction register (DDR) configures the directions of each of the 16 I/O pins. A
bit set to 1 in the DDR turns the corresponding I/O pin to output mode, while a bit set
to 0 sets the pin to input mode. The register is set to all zeros in reset, i.e. all pins are
inputs by default. The current state of the DDR can also be read.
14.2.2
Output Data GPIOx_ODATA
A write sets the data register value. Change in bits that are configured as outputs are
reflected in the outputs. A read returns the state of data register value.
Note: configuring a pin as input should not reset the state of the corresponding data
register bit. If the data register is first written 0xffff and then all pins are configured as
outputs by writing 0xffff to DDR, all outputs should go to the high state.
Rev. 0.20
2011-10-04
Page