4. I/O operating modes
The STM32WB05xZ device proposes up to 20 programmable I/Os (on all packages).
Each I/O can be programmed in several modes:
- • Input mode
- • General purpose output mode
- • Alternate function
- • Analog mode (when available Table 9. I/O analog feature mapping )
The STM32WB05xZ device supports six alternate modes called AFx (x = 0 to 4 and 6). The configuration of each I/O for those alternate modes is detailed in Table 7. GPIO alternate options AF0, AF1 and AF2 modes and Table 8. GPIOs AF3, AF4 and AF6 modes .
Note: I/Os features presented in Table 7. GPIO alternate options AF0, AF1 and AF2 modes and Table 8. GPIOs AF3, AF4 and AF6 modes are valid only when the associated I/O is programmed as alternate function.
Refer to Section 7: General-purpose I/O (GPIO) for more details on all configurations.
The number of I/Os available in the STM32WB05xZ device depends on the package:
- • 20 I/Os in VFQFPN32
- • 20 I/Os in WLCSP36
Type acronyms correspond to:
- • I: input
- • O: output
- • I/O: input output
- • OD: open drain
Table 7. GPIO alternate options AF0, AF1 and AF2 modes
| Pin name | AF0 mode | AF1 mode | AF2 mode | |||
|---|---|---|---|---|---|---|
| Type | Signal | Type | Signal | Type | Signal | |
| Port A | ||||||
| PA0 (1) | I/OD | I2C1_SCL | I | USART_CTS | O | IR_OUT |
| PA1 (1) | I/OD | I2C1_SDA | O | IR_OUT | I/OD | USART_TX |
| PA2 | I/O | DEBUG_SWDIO | I/O | USART_CK | - | - |
| PA3 | I | DEBUG_SWCLK | O | USART_RTS_DE | - | - |
| PA8 | I/O | USART_RX | O | RTC_OUT | O | RADIO_RX_SEQUENCE |
| PA9 | I/O | USART_TX | - | - | O | RTC_OUT |
| PA10 | - | - | I | LPUART_CTS | O | RADIO_TX_SEQUENCE |
| PA11 | O | MCO | - | - | O | RADIO_RX_SEQUENCE |
| Port B | ||||||
| PB0 | I/O | USART_RX | O | LPUART_RTS_DE | I/O | TIM16_CH1 |
| PB1 | I/O | USART_CK | - | - | O | TIM16_CH1N |
| PB2 | O | USART_RTS_DE | - | - | I/O | TIM16_BRK |
| PB3 | I | USART_CTS | I/O | LPUART_TX | I/O | TIM17_CH1 |
| PB4 | I/O | LPUART_TX | - | - | O | TIM17_CH1N |
| PB5 | I/O | LPUART_RX | - | - | I/O | TIM17_BRK |
| PB6 (1) | I/OD | I2C1_SCL | - | - | I/O | TIM17_CH1 |
| PB7 (1) | I/OD | I2C1_SDA | - | - | I | USART_CTS |
| PB12 (2) | - | - | O | RCC_LCO | I | LPUART_CTS |
| PB13 (3) | - | - | - | - | - | - |
| PB14 | I/O | I2C1_SMBA | O | RADIO_TX_SEQUENCE | I | TIM2_ETR |
| PB15 | - | - | - | - | - | - |
1. This I/O is able to be configured in open-drain.
2. This I/O is shared with RCC_OSC32_OUT (low speed clock oscillator pin).
3. This I/O is shared with RCC_OSC32_IN (low speed clock oscillator pin).
Table 8. GPIOs AF3, AF4 and AF6 modes
| Pin name | AF3 mode | AF4 mode | AF6 mode | |||
|---|---|---|---|---|---|---|
| Type | Signal | Type | Signal | Type | Signal | |
| Port A | ||||||
| PA0 (1) | I | - | I/O | TIM2_CH3 | - | - |
| PA1 (1) | - | - | I/O | TIM2_CH4 | - | - |
| PA2 | O | I2S3_MCK | I/O | TIM2_CH1 | I/O | TIM16_CH1 |
| PA3 | I/O | SPI3_SCK / I2S3_SCK | I/O | TIM2_CH2 | O | TIM16_CH1N |
| PA8 | I/O | SPI3_MISO | I/O | TIM2_CH3 | I/O | TIM16_BRK |
| PA9 | I/O | SPI3_NSS / I2S3_WS | I/O | TIM2_CH4 | I/O | TIM17_CH1 |
| PA10 | O | I2S3_MCK | - | - | O | TIM17_CH1N |
| PA11 | I/O | SPI3_MOSI / I2S3_SD | - | - | I/O | TIM17_BRK |
| Port B | ||||||
| PB0 | - | - | - | - | O | ANT_ID[0] |
| PB1 | I | TIM2_ETR | - | - | O | ANT_ID[1] |
| PB2 | I/O | TIM2_CH3 | - | - | O | ANT_ID[2] |
| PB3 | I/O | TIM2_CH4 | I/O | SPI3_SCK / I2S3_SCK | O | ANT_ID[3] |
| PB4 | - | - | I/O | TIM2_CH1 | O | ANT_ID[4] |
| PB5 | - | - | I/O | TIM2_CH2 | O | ANT_ID[5] |
| PB6 (1) | I/O | LPUART_TX | I/O | TIM2_CH1 | O | ANT_ID[6] |
| PB7 (1) | I/O | LPUART_RX | I/O | TIM2_CH2 | O | RXACTIVITY |
| PB12 (2) | - | - | I/O | TIM2_CH3 | - | - |
| PB13 (3) | - | - | I/O | TIM2_CH4 | - | - |
| PB14 | O | MCO | - | - | I/O | USART_RX |
| PB15 | - | - | - | - | I/O | USART_TX |
- 1. This I/O is able to be configured in open-drain.
- 2. This I/O is shared with RCC_OSC32_OUT (low speed clock oscillator pin).
- 3. This I/O is shared with RCC_OSC32_IN (low speed clock oscillator pin).
Note: Concerning the ADC block present in the STM32WB05xZ device:
- • The eight ADC channels are available on PA2, PA3, PB0, PB1, PB2, PB3, PB4, PB5
The ADC features on those pins are available if the associated pin is configured in analog mode (see Section 7: General-purpose I/O (GPIO) for more details)
The Table 9. I/O analog feature mapping shows the mapping associated to analog configuration (for pins which can support analog mode).
Table 9. I/O analog feature mapping
| Pin name | Analog feature | Pin name | Analog feature | Parallel analog feature |
|---|---|---|---|---|
| Port A | Port B | |||
| PA0 | N/A (1) | PB0 | ADC_VINM1 | N/A (1) |
| PA1 | N/A (1) | PB1 | ADC_VINP1 | N/A (1) |
| PA2 | ADC_VINM2 | PB2 | ADC_VINM0 | N/A (1) |
| PA3 | ADC_VINP2 | PB3 | ADC_VINP0 | N/A (1) |
| PA8 | N/A (1) | PB4 | ADC_VINM3 | N/A (1) |
| PA9 | N/A (1) | PB5 | ADC_VINP3 | N/A (1) |
| PA10 | N/A (1) | PB6 | N/A (1) | N/A (1) |
| PA11 | N/A (1) | PB7 | N/A (1) | N/A (1) |
| - | - | PB12 | N/A (1) | RCC_OSC32_OUT |
| - | - | PB13 | N/A (1) | RCC_OSC32_IN |
| - | - | PB14 | N/A (1) | PVD input voltage |
| - | - | PB15 | N/A (1) | N/A |
1. N/A means not applicable as the associated I/O does not support analog option.
Table 10. I/O additional function mapping
| Pin name | Function | Pin name | Function |
|---|---|---|---|
| Port A | Port B | ||
| PA0 | Wakeup | PB0 | Wakeup |
| PA1 | Wakeup | PB1 | Wakeup |
| PA2 | Wakeup | PB2 | Wakeup |
| PA3 | Wakeup | PB3 | Wakeup |
| PA8 | Wakeup | PB4 | Wakeup |
| PA9 | Wakeup | PB5 | Wakeup |
| PA10 | Wakeup, RCC_LCO | PB6 | Wakeup |
| PA11 | Wakeup | PB7 | Wakeup |
| - | - | PB12 | Wakeup, RCC_OSC32_OUT (1) |
| - | - | PB13 | Wakeup, RCC_OSC32_IN (1) |
| - | - | PB14 | Wakeup |
| - | - | PB15 | Wakeup |
1. The additional functions for LSE oscillator are 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 RCC_OSC32_OUT/RCC_OSC32_IN whatever the selected mode in the associated GPIOx_MODER register, but if PWRC_CR1.APC bit is set, it is necessary to disable PUB12, PUB13, PDB12, PDB13 in PWRC registers.
Note: For the additional functions like Wakeup I/O, LSE oscillator, RCC_LCO configure the required function in the related PWRC, RCC, RTC registers. These functions have priority over the configuration in the standard GPIO registers.