diff --git a/esp-lp-hal/CHANGELOG.md b/esp-lp-hal/CHANGELOG.md index dd831b7116e..b221ab942f8 100644 --- a/esp-lp-hal/CHANGELOG.md +++ b/esp-lp-hal/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add the `ulp-riscv-hal` package (#840) - Add LP_UART basic driver (#1113) - Added basic `LP-I2C` driver for C6 (#1185) +- Add remaining GPIO pins for ESP32-S2/S3 (#1695) ### Changed diff --git a/esp-lp-hal/src/gpio.rs b/esp-lp-hal/src/gpio.rs index f1120fff5cd..03ae0ef9680 100644 --- a/esp-lp-hal/src/gpio.rs +++ b/esp-lp-hal/src/gpio.rs @@ -7,6 +7,11 @@ type LpIo = crate::pac::LP_IO; #[cfg(any(feature = "esp32s2", feature = "esp32s3"))] type LpIo = crate::pac::RTC_IO; +#[cfg(feature = "esp32c6")] +const MAX_GPIO_PIN: u8 = 7; +#[cfg(any(feature = "esp32s2", feature = "esp32s3"))] +const MAX_GPIO_PIN: u8 = 21; + #[non_exhaustive] pub struct Input {} @@ -40,7 +45,7 @@ impl Output { // Used by the `entry` procmacro: #[doc(hidden)] pub unsafe fn conjure_output() -> Option> { - if PIN > 7 { + if PIN > MAX_GPIO_PIN { None } else { Some(Output {}) @@ -50,7 +55,7 @@ pub unsafe fn conjure_output() -> Option> { // Used by the `entry` procmacro: #[doc(hidden)] pub unsafe fn conjure_input() -> Option> { - if PIN > 7 { + if PIN > MAX_GPIO_PIN { None } else { Some(Input {})