4. I/O operating modes
STM32WL3Rxx devices propose up to 32 programmable I/Os (depending on the package).
Each I/O can be programmed in several modes:
- • input mode
- • output mode
- • Alternate function
- • Analog mode (when available)
STM32WL3Rxx devices support seven alternate modes called AFx (x = 0 to 6). The configuration of each I/O for those alternate modes is detailed in Table 8, Table 9 and Table 10. Some additional functions are also available see Table 11.
Note: The I/Os features presented in Table 8 and Table 9 are valid only when the associated I/O is programmed as alternate function.
Refer to Section 7: General-purpose I/Os (GPIO) for more details on all configurations.
The STM32WL3Rxx has 17 available I/Os.
Type acronyms correspond to:
- – I: Input
- – O: Output
- – I/O: Input Output
- – OD: Open Drain
Table 8. GPIO alternate options AF0 - AF3(1)
| Pin name | AF0 mode | AF1 mode | AF2 mode | AF3 mode | ||||
|---|---|---|---|---|---|---|---|---|
| Type | Signal | Type | Signal | Type | Signal | Type | Signal | |
| Port A | ||||||||
| PA0(2) | I/OD | I2C1_SCL | I | USART_CTS | - | - | - | - |
| PA1(2) | I/OD | I2C1_SDA | I/O | USART_TX | I/O | TIM16_BRK | - | - |
| PA2 | I/O | SWDIO | I/O | USART_CK | I/O | TIM16_CH1 | O | I2S3_MCK |
| PA3 | I | SWCLK | O | USART_RTS_DE | O | TIM16_CH1N | I/O | SPI3_SCK/ I2S3_CK |
| PA7 | -- | -- | O | LPUART_RTS_DE | - | - | - | - |
| PA8 | I/O | RTC_OUT /RTC_TAMP1 /RTC_TS | I/O | USART_RX | O | RX_SEQUENCE | I/O | SPI3_MISO |
| PA9 | - | - | I/O | USART_TX | O | RTC_OUT | I/O | SPI3_NSS/ I2S3_WS |
| PA10 | - | - | I | LPUART_CTS | O | TX_SEQUENCE | O | I2S3_MCK |
| PA11 | O | MCO | - | - | O | RX_SEQUENCE | I/O | SPI3_MOSI/ I2S3_SD |
| Port B | ||||||||
| Pin name | AF0 mode | AF1 mode | AF2 mode | AF3 mode | ||||
|---|---|---|---|---|---|---|---|---|
| Type | Signal | Type | Signal | Type | Signal | Type | Signal | |
| PB0(3) | I/O | USART_RX | O | LPUART_RTS_DE | I/O | TIM16_CH1 | I/O | - |
| PB1 | I/O | USART_CK | I/O | SWDIO | O | TIM16_CH1N | I/O | - |
| PB2 | O | USART_RTS_DE | I | SWCLK | I/O | TIM16_BRK | I/O | - |
| PB6(2) | I/OD | I2C1_SCL | I/O | LPUART_TX | O | - | I/O | SPI3_SCK/ I2S3_CK |
| PB7(2) | I/OD | I2C1_SDA | I/O | LPUART_RX | O | RF_ACTIVITY | I/O | SPI3_MOSI/ I2S3_SD |
| PB12(3) | O | USART_RTS_DE | I | LPUART_CTS | O | LCO | - | - |
| PB13(4) | I/O | - | - | - | - | - | - | - |
| PB14 | I/O | I2C1_SMBA | I/O | USART_RX | O | TX_SEQUENCE | O | MCO |
| PB15 | - | - | I/O | USART_TX | O | - | - | - |
- 1. STM32WL3Rxx devices are only available in the VFQFPN32 package.
- 2. This I/O is able to be configured in open-drain.
- 3. This I/O is shared with OSC32_OUT (low speed clock oscillator pin).
- 4. This I/O is shared with OSC32_IN (low speed clock oscillator pin).
| Pin name | AF4 mode | AF5 mode | AF6 mode | |||
|---|---|---|---|---|---|---|
| Type | Signal | Type | Signal | Type | Signal | |
| Port A | ||||||
| PA0(2) | I/O | TIM2_CH3 | - | - | O | - |
| PA1(2) | I/O | TIM2_CH4 | - | - | O | - |
| PA2 | I/O | TIM2_CH1 | I/O | SWDIO | O | - |
| PA3 | I/O | TIM2_CH2 | I | SWCLK | O | - |
| PA7 | I/O | TIM2_CH2 | - | - | - | -- |
| PA8 | I/O | TIM2_CH3 | - | - | O | - |
| PA9 | I/O | TIM2_CH4 | - | - | O | - |
| PA10 | I | SUBG_TX_DATA | - | - | O | - |
| PA11 | O | SUBG_TX_CLOCK | - | - | O | - |
| Port B | ||||||
| PB0 | O | ANTENNA_SWITCH | - | - | O | - |
| PB1 | O | SUBG_RX_DATA | - | - | O | - |
| PB2 | O | SUBG_RX_CLOCK | - | - | O | - |
| PB6(2) | I/O | TIM2_CH3 | - | - | O | - |
| PB7(2) | I | TIM2_ETR | - | - | O | - |
| PB12(3) | I/O | TIM2_CH3 | - | - | - | - |
| PB13(4) | I/O | TIM2_CH4 | - | - | - | - |
| PB14 | I | TIM2_ETR | - | - | O | - |
| PB15 | - | - | - | - | I/O | - |
- 1. STM32WL3Rxx devices are only available in the VFQFPN32 package.
- 2. This I/O is able to be configured in open-drain.
- 3. This I/O is shared with OSC32_OUT (low speed clock oscillator pin).
- 4. This I/O is shared with OSC32_IN (low speed clock oscillator pin).
Concerning the ADC block present in the STM32WL3Rxx.
- The 8 ADC channels are available on PA2, PA3, PB0, PB1, PB2, PB4, PB5.
Note: The ADC features on those pins are available if the associated pin is configured in analog mode (see Section 7: General-purpose I/Os (GPIO) for more details).
Table 10 shows the mapping associated to analog configuration (for pins able to support analog mode).
Table 10. I/O Analog feature mapping(1) (2)
| Pin name | Analog feature | Parallel Analog feature | Pin name | Analog feature | Parallel Analog feature |
|---|---|---|---|---|---|
| Port A | Port B | ||||
| PA0 | N/A | - | PB0 | ADC_VINM1 | -- |
| PA1 | N/A | - | PB1 | ADC_VINP1 | -- |
| PA2 | ADC_VINM2 | - | PB2 | ADC_VINM0 | -- |
| PA3 | ADC_VINP2 | - | PB6 | N/A | N/A |
| PA7 | N/A | - | PB7 | N/A | N/A |
| PA8 | N/A | - | PB12 | - | SXTALO (3) |
| PA9 | N/A | - | PB13 | - | SXTALI (3) |
| PA10 | N/A | - | PB14 | - | PVD VIN(4) |
| PA11 | N/A | - | PB15 | - | N/A |
| - | - | - | - | - | - |
- N/A means Not Applicable as the associated I/O does not support analog option.
- STM32WL3Rxx devices are only available in the VFQFPN32 package.
- The parallel analog feature is obtained by setting the RCC_CR.LSEON bit in the RCC registers. Then the PB12 and PB13 are forced by hardware to manage the LSE through SXTALO/SXTALI whatever the selected mode in the associated GPIO_MODERx register, but if APC is set is necessary to disable PUB12/PUB13/PDB12/PDB13 in PWR registers.
- The selection between ATB1 and PVD is done through a register in the SYSCFG block (see 8.2.11: I/O analog switch control register (GPIO_SWA_CTRL) for details).
| Pin name | Function | Pin name | Function |
|---|---|---|---|
| Port A | Port B | ||
| PA0 | - | PB0 | - |
| PA1 | - | PB1 | - |
| PA2 | - | PB2 | - |
| PA3 | - | PB6 | - |
| PA7 | - | PB7 | - |
| PA8 | - | PB12 | SXTALO(2) |
| PA9 | - | PB13 | SXTALI(2) |
| PA10 | LCO | PB14 | - |
| PA11 | - | PB15 | - |
| - | - | - | - |
- 1. STM32WL3Rxx devices are only available in the VFQFPN32 package.
- 2. The parallel analog feature is obtained by setting the RCC_CR.LSEON bit in the RCC registers. Then the PB12 and PB13 are forced by hardware to manage the LSE through SXTALO/SXTALI whatever the selected mode in the associated GPIO_MODERx register, but if APC is set is necessary to disable PUB12/PUB13/PDB12/PDB13 in PWR registers.