46
6.4
Port interrupt and wakeup
CW6632B Bluetooth 3.0 Audio Player SOC
Version 1.0.0
Copyright ©2015, www.appotech.com. All Rights Reserved.
6.4
Port interrupt and wakeup
CW6632B supports Port interrupt and wakeup function.
The PWKEN registers (Wakeup Enable Register) allow port to cause wakeup.
The PWKEN registers are set to 0Fh upon reset. Clearing bit0-3 in the PWKEN register enables wakeup on
corresponding pin. The trigger condition on the selected pin can be either rising edge or falling edge. The WKED
register (Wakeup Edge Select) selects the desired transition edge. Setting a bit in WKED register selects the falling
edge of the corresponding pin. Resetting the bit selects the rising edge.
Once a valid transition occurs on the selected pin, the WKPND (PWKEN.7~PWKEN.4) register (Wakeup Pending
Register) latches the transition in the corresponding bit position. Logic „1‟ indicates the occurrence of the selected
trigger edge on the corresponding Port pins. Upon reset, logic „0‟ is set to all bits of WKPND.
Note:
1.
To Wakeup initialization, to avoid any false signaling to port, the followings would be a recommended
procedure for Wakeup initialization:
Configure the edge select of Port 0 pins on WKEDG register,
Clear the corresponding bits on WKPND Wakeup Pending Register
Clear the corresponding bits in the PWKEN registers to enable the wakeup on the corresponding port pins
Figure 2015-
Upon exiting the sleep down mode, the Multi-Input Wakeup logic causes full chip reset.
6.5
GPIO Special Function Registers
Register 6-1 P0DIR-P0 direction Register
Position
7
6
5
4
3
2
1
0
Name
P0DIR
Default
1
1
1
1
1
1
1
1
Access
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
P0xDIR
: P0x direction control
0 = Output
1 = Input
Register 6-2 P1DIR-P1 direction Register
Position
7
6
5
4
3
2
1
0
Name
P1DIR
Default
1
1
1
1
1
1
1
1
Access
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
P1xDIR
: P1x direction control
0 = Output
1 = Input
Register 6-3 P2DIR-P2 direction Register