Skip to content

Commit 485fe79

Browse files
committed
finish
1 parent 9fca215 commit 485fe79

21 files changed

+64
-56
lines changed

.github/workflows/hil.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ jobs:
172172
# Xtensa devices:
173173
- soc: esp32
174174
runner: esp32-jtag
175-
usb: USB1 # ESP32 HIL TODO
176175
host: aarch64
176+
hubs: "1 3"
177177
- soc: esp32s2
178178
runner: esp32s2-jtag
179179
host: armv7

hil-test/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ macro_rules! i2c_pins {
3030
cfg_if::cfg_if! {
3131
if #[cfg(any(esp32s2, esp32s3))] {
3232
($io.pins.gpio2, $io.pins.gpio3)
33+
} else if #[cfg(esp32)] {
34+
($io.pins.gpio32, $io.pins.gpio33)
3335
} else if #[cfg(esp32c6)] {
3436
($io.pins.gpio6, $io.pins.gpio7)
3537
} else if #[cfg(esp32h2)] {
@@ -50,6 +52,9 @@ macro_rules! common_test_pins {
5052
if #[cfg(any(esp32s2, esp32s3))] {
5153
($io.pins.gpio9, $io.pins.gpio10)
5254
}
55+
else if #[cfg(esp32)] {
56+
($io.pins.gpio26, $io.pins.gpio27)
57+
}
5358
else {
5459
($io.pins.gpio2, $io.pins.gpio3)
5560
}

hil-test/tests/embassy_timers_executors.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ use esp_hal::{
1212
interrupt::software::SoftwareInterruptControl,
1313
peripherals::Peripherals,
1414
prelude::*,
15-
timer::{timg::TimerGroup, ErasedTimer, OneShotTimer, PeriodicTimer},
15+
timer::{timg::TimerGroup, OneShotTimer, PeriodicTimer},
1616
};
1717
#[cfg(not(feature = "esp32"))]
1818
use esp_hal::{
19+
interrupt::software::SoftwareInterruptControl,
1920
interrupt::Priority,
2021
timer::systimer::{Alarm, FrozenUnit, Periodic, SystemTimer, Target},
22+
timer::ErasedTimer,
2123
};
2224
#[cfg(not(feature = "esp32"))]
2325
use esp_hal_embassy::InterruptExecutor;
2426
use hil_test as _;
2527

28+
#[cfg(not(feature = "esp32"))]
2629
macro_rules! mk_static {
2730
($t:ty,$val:expr) => {{
2831
static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new();
@@ -123,7 +126,9 @@ fn set_up_embassy_with_systimer(peripherals: Peripherals) {
123126
#[embedded_test::tests(executor = esp_hal_embassy::Executor::new())]
124127
mod test {
125128
use super::*;
126-
use crate::{test_cases::*, test_helpers::*};
129+
use crate::test_cases::*;
130+
#[cfg(not(feature = "esp32"))]
131+
use crate::test_helpers::*;
127132

128133
#[init]
129134
fn init() -> Peripherals {

hil-test/tests/gpio.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! GPIO Test
22
//!
33
//! Folowing pins are used:
4-
//! GPIO2 / GPIO9 (esp32s2 and esp32s3)
5-
//! GPIO3 / GPIO10 (esp32s2 and esp32s3)
4+
//! GPIO2 / GPIO9 / GPIO26 (esp32s2 / esp32s3 / esp32)
5+
//! GPIO3 / GPIO10 / GPIO26 (esp32s2 / esp32s3 / esp32)
66
77
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
88
//% FEATURES: generic-queue
@@ -13,10 +13,6 @@
1313
use core::cell::RefCell;
1414

1515
use critical_section::Mutex;
16-
#[cfg(feature = "esp32")]
17-
use esp_hal::gpio::Gpio4;
18-
#[cfg(not(feature = "esp32"))]
19-
use esp_hal::gpio::Gpio3;
2016
use esp_hal::{
2117
delay::Delay,
2218
gpio::{AnyPin, GpioPin, Input, Io, Level, Output, Pull},
@@ -31,12 +27,15 @@ static INPUT_PIN: Mutex<RefCell<Option<Input<'static, TestGpio1>>>> =
3127
Mutex::new(RefCell::new(None));
3228

3329
cfg_if::cfg_if! {
34-
if #[cfg(not(any(esp32s2, esp32s3)))] {
30+
if #[cfg(not(any(esp32, esp32s2, esp32s3)))] {
3531
pub type TestGpio1 = GpioPin<2>;
3632
pub type TestGpio2 = GpioPin<3>;
3733
} else if #[cfg(any(esp32s2, esp32s3))] {
3834
pub type TestGpio1 = GpioPin<9>;
3935
pub type TestGpio2 = GpioPin<10>;
36+
} else if #[cfg(esp32)] {
37+
pub type TestGpio1 = GpioPin<26>;
38+
pub type TestGpio2 = GpioPin<27>;
4039
}
4140
}
4241

hil-test/tests/i2c.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
//! SDA GPIO2 (esp32s2 and esp32s3)
55
//! GPIO6 (esp32c6)
66
//! GPIO18 (esp32c2)
7-
//! GPIO4 (esp32, esp32h2 and esp32c3)
7+
//! GPIO4 (esp32h2 and esp32c3)
8+
//! GPIO32 (esp32)
89
//!
910
//! SCL GPIO3 (esp32s2 and esp32s3)
10-
//! GPIO7 (esp32c6, esp32 and esp32c3)
11+
//! GPIO7 (esp32c6 and esp32c3)
1112
//! GPIO22 (esp32h2)
1213
//! GPIO19 (esp32c2)
14+
//! GPIO33 (esp32)
1315
1416
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
1517

hil-test/tests/pcnt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! It's assumed GPIO2 is connected to GPIO3
44
//! (GPIO9 and GPIO10 for esp32s2 and esp32s3)
5+
//! (GPIO26 and GPIO27 for esp32)
56
67
//% CHIPS: esp32 esp32c6 esp32h2 esp32s2 esp32s3
78

hil-test/tests/qspi_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! Connect MISO and GPIO pins.
99
10-
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
10+
//% CHIPS: esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
1111

1212
#![no_std]
1313
#![no_main]

hil-test/tests/qspi_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!
1010
//! Connect MOSI and PCNT pins.
1111
12-
//% CHIPS: esp32 esp32c6 esp32h2 esp32s2 esp32s3
12+
//% CHIPS: esp32c6 esp32h2 esp32s2 esp32s3
1313

1414
#![no_std]
1515
#![no_main]

hil-test/tests/qspi_write_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!
1010
//! Connect MOSI/MISO and GPIO pins.
1111
12-
//% CHIPS: esp32 esp32c6 esp32h2 esp32s2 esp32s3
12+
//% CHIPS: esp32c6 esp32h2 esp32s2 esp32s3
1313

1414
#![no_std]
1515
#![no_main]

hil-test/tests/rmt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! It's assumed GPIO2 is connected to GPIO3
44
//! (GPIO9 and GPIO10 for esp32s2 and esp32s3)
5+
//! (GPIO26 and GPIO27 for esp32)
56
67
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
78

0 commit comments

Comments
 (0)