Files
blinky/inc/events/usb_state_event.h

42 lines
734 B
C
Raw Permalink Normal View History

#ifndef BLINKY_USB_STATE_EVENT_H_
#define BLINKY_USB_STATE_EVENT_H_
#include <stdint.h>
#include <app_event_manager.h>
#include <app_event_manager_profiler_tracer.h>
#include <zephyr/sys/util.h>
#ifdef __cplusplus
extern "C" {
#endif
enum usb_state {
USB_STATE_DISABLED = 0,
USB_STATE_DISCONNECTED,
USB_STATE_POWERED,
USB_STATE_ACTIVE,
USB_STATE_SUSPENDED,
};
struct usb_state_event {
struct app_event_header header;
enum usb_state state;
};
APP_EVENT_TYPE_DECLARE(usb_state_event);
static inline void submit_usb_state(enum usb_state state)
{
struct usb_state_event *event = new_usb_state_event();
event->state = state;
APP_EVENT_SUBMIT(event);
}
#ifdef __cplusplus
}
#endif
#endif /* BLINKY_USB_STATE_EVENT_H_ */