summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test/support/ehci_controller.c10
-rw-r--r--tests/test/support/ehci_controller.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/test/support/ehci_controller.c b/tests/test/support/ehci_controller.c
index fed3c730e..0bc09f53a 100644
--- a/tests/test/support/ehci_controller.c
+++ b/tests/test/support/ehci_controller.c
@@ -76,3 +76,13 @@ void ehci_controller_run(uint8_t hostid)
regs->usb_sts = EHCI_INT_MASK_NXP_ASYNC;
}
+
+void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed)
+{
+ ehci_registers_t* const regs = get_operational_register(hostid);
+
+ regs->usb_sts_bit.port_change_detect = 1;
+ regs->portsc_bit.connect_status_change = 1;
+ regs->portsc_bit.current_connect_status = 1;
+ regs->portsc_bit.nxp_port_speed = speed;
+}
diff --git a/tests/test/support/ehci_controller.h b/tests/test/support/ehci_controller.h
index 945e8e13f..aee3f0116 100644
--- a/tests/test/support/ehci_controller.h
+++ b/tests/test/support/ehci_controller.h
@@ -56,6 +56,7 @@
#endif
void ehci_controller_run(uint8_t hostid);
+void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed);
#ifdef __cplusplus
}