
General-purpose input/outputs
STM32W108CB, STM32W108HB
Doc ID 16252 Rev 3
When configured in output mode:
●
The output drivers are enabled and are controlled by the value written to
GPIO_PxOUT:
●
In open-drain mode: 0 activates the N-MOS current sink; 1 tri-states the pin.
●
In push-pull mode: 0 activates the N-MOS current sink; 1 activates the P-MOS current
source.
●
The internal pull-up and pull-down resistors are disabled.
●
The Schmitt trigger input is connected to the pin.
●
Reading GPIO_PxIN returns the input at the pin.
●
Reading GPIO_PxOUT returns the last value written to the register.
Note:
Depending on configuration and usage, GPIO_PxOUT and GPIO_PxIN may not have the
same value.
Alternate output mode
In this mode, the output is controlled by an on-chip peripheral instead of GPIO_PxOUT and
may be configured as either push-pull or open-drain. Most peripherals require a particular
output type - TWI requires an open-drain driver, for example - but since using a peripheral
does not by itself configure a pin, the GPIO_PxCFGH/L registers must be configured
page 50, when more than one peripheral can be the source of output data, registers in
addition to GPIO_PxCFGH/L determine which to use.
When configured in alternate output mode:
●
The output drivers are enabled and are controlled by the output of an on-chip
peripheral:
●
In open-drain mode: 0 activates the N-MOS current sink; 1 tri-states the pin.
●
In push-pull mode: 0 activates the N-MOS current sink; 1 activates the P-MOS current
source.
●
The internal pull-up and pull-down resistors are disabled.
●
The Schmitt trigger input is connected to the pin.
●
Reading GPIO_PxIN returns the input to the pin.
Note:
Depending on configuration and usage, GPIO_PxOUT and GPIO_PxIN may not have the
same value.
Alternate output SPI SCLK mode
SPI master mode SCLK outputs, PB3 (SC1SCLK) or PA2 (SC2SCLK), use a special output
push-pull mode reserved for those signals. Otherwise this mode is identical to alternate
output mode.
8.1.7
Wake monitoring
The GPIO_PxWAKE registers specify which GPIOs are monitored to wake the processor. If
a GPIO's wake enable bit is set in GPIO_PxWAKE, then a change in the logic value of that
GPIO causes the STM32W108 to wake from deep sleep. The logic values of all GPIOs are
captured by hardware upon entering sleep. If any GPIO's logic value changes while in sleep
and that GPIO's GPIO_PxWAKE bit is set, then the STM32W108 will wake from deep sleep.
(There is no mechanism for selecting a specific rising-edge, falling-edge, or level on a GPIO:
any change in logic value triggers a wake event.) Hardware records the fact that GPIO