- Added GPIO pins 21-27 to esp32h2 (#501)

- fixed GPIO handler array size for esp32c2
This commit is contained in:
Roman Krüger 2024-12-16 14:16:39 +01:00 committed by GitHub
parent 506dc9bb5e
commit 6cb3ea5b9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/.vscode
/.idea
/.espressif
/.embuild
/target

View File

@ -2080,10 +2080,10 @@ mod chip {
#[allow(clippy::type_complexity)]
#[cfg(feature = "alloc")]
pub(crate) static mut PIN_ISR_HANDLER: [Option<Box<dyn FnMut() + Send + 'static>>; 20] =
[PIN_ISR_INIT; 20];
pub(crate) static mut PIN_ISR_HANDLER: [Option<Box<dyn FnMut() + Send + 'static>>; 21] =
[PIN_ISR_INIT; 21];
pub(crate) static PIN_NOTIF: [HalIsrNotification; 20] = [PIN_NOTIF_INIT; 20];
pub(crate) static PIN_NOTIF: [HalIsrNotification; 21] = [PIN_NOTIF_INIT; 21];
// NOTE: Gpio12 - Gpio17 are used by SPI0/SPI1 for external PSRAM/SPI Flash and
// are not recommended for other uses
@ -2184,13 +2184,16 @@ mod chip {
#[allow(clippy::type_complexity)]
#[cfg(feature = "alloc")]
pub(crate) static mut PIN_ISR_HANDLER: [Option<Box<dyn FnMut() + Send + 'static>>; 20] =
[PIN_ISR_INIT; 20];
pub(crate) static mut PIN_ISR_HANDLER: [Option<Box<dyn FnMut() + Send + 'static>>; 28] =
[PIN_ISR_INIT; 28];
pub(crate) static PIN_NOTIF: [HalIsrNotification; 20] = [PIN_NOTIF_INIT; 20];
pub(crate) static PIN_NOTIF: [HalIsrNotification; 28] = [PIN_NOTIF_INIT; 28];
// NOTE: Gpio12 - Gpio17 are used by SPI0/SPI1 for external PSRAM/SPI Flash and
// are not recommended for other uses
// NOTE: Following pins have special meaning and are not recommended for other uses. But one may use them with care.
// - Gpio12 - Gpio17 are used by SPI0/SPI1 for external PSRAM/SPI Flash
// - Gpio21 seems not to be exposed physically
// - Gpio23 + Gpio24 are used by serial debug interface
// - Gpio26 + Gpio27 are used by USB debug interface
pin!(Gpio0:0, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio1:1, IO, NORTC:0, ADC1:0, NODAC:0, NOTOUCH:0);
pin!(Gpio2:2, IO, NORTC:0, ADC1:1, NODAC:0, NOTOUCH:0);
@ -2212,6 +2215,13 @@ mod chip {
pin!(Gpio18:18, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio19:19, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio20:20, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio21:21, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio22:22, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio23:23, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio24:24, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio25:25, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio26:26, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pin!(Gpio27:27, IO, NORTC:0, NOADC:0, NODAC:0, NOTOUCH:0);
pub struct Pins {
pub gpio0: Gpio0,
@ -2235,6 +2245,13 @@ mod chip {
pub gpio18: Gpio18,
pub gpio19: Gpio19,
pub gpio20: Gpio20,
pub gpio21: Gpio21,
pub gpio22: Gpio22,
pub gpio23: Gpio23,
pub gpio24: Gpio24,
pub gpio25: Gpio25,
pub gpio26: Gpio26,
pub gpio27: Gpio27,
}
impl Pins {
@ -2265,6 +2282,13 @@ mod chip {
gpio18: Gpio18::new(),
gpio19: Gpio19::new(),
gpio20: Gpio20::new(),
gpio21: Gpio21::new(),
gpio22: Gpio22::new(),
gpio23: Gpio23::new(),
gpio24: Gpio24::new(),
gpio25: Gpio25::new(),
gpio26: Gpio26::new(),
gpio27: Gpio27::new(),
}
}
}