Skip to content

Commit 7903526

Browse files
author
Josuah Demangeon
committed
usb: host: add host status to the host context
Add a "struct usbh_status" that contains a bitmask of flags to keep track of the global state of the host context, like done for the device_next implementation. Add helpers to check the status. Signed-off-by: Josuah Demangeon <[email protected]>
1 parent bc77dfb commit 7903526

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/zephyr/usb/usbh.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ extern "C" {
3333
* @{
3434
*/
3535

36+
/**
37+
* USB host support status
38+
*/
39+
struct usbh_status {
40+
/** USB host support is initialized */
41+
unsigned int initialized : 1;
42+
/** USB host support is enabled */
43+
unsigned int enabled : 1;
44+
};
45+
3646
/**
3747
* USB host support runtime context
3848
*/
@@ -43,6 +53,8 @@ struct usbh_context {
4353
struct k_mutex mutex;
4454
/** Pointer to UHC device struct */
4555
const struct device *dev;
56+
/** Status of the USB host support */
57+
struct usbh_status status;
4658
/** USB device list */
4759
sys_dlist_t udevs;
4860
/** USB root device */

0 commit comments

Comments
 (0)