add esp32p4 to hil

This commit is contained in:
hathach
2024-11-11 16:07:33 +07:00
parent a8903d3152
commit 13f78e2e77
3 changed files with 23 additions and 0 deletions

View File

@@ -36,6 +36,10 @@
#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0
// For CI hardware test, to test both device and host on the same HS port with help of
#define HIL_DEVICE_HOST_MUX_PIN 47
#define HIL_DEVICE_STATE 1
#ifdef __cplusplus
}
#endif

View File

@@ -105,6 +105,12 @@ void board_init(void) {
usb_init();
#endif
#ifdef HIL_DEVICE_HOST_MUX_PIN
gpio_reset_pin(HIL_DEVICE_HOST_MUX_PIN);
gpio_set_direction(HIL_DEVICE_HOST_MUX_PIN, GPIO_MODE_OUTPUT);
gpio_set_level(HIL_DEVICE_HOST_MUX_PIN, CFG_TUD_ENABLED ? HIL_DEVICE_STATE : (1-HIL_DEVICE_STATE));
#endif
#if CFG_TUH_ENABLED && CFG_TUH_MAX3421
max3421_init();
#endif