- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# USB software Events Management
[USB task entry point]

Macros to manage USB events detected under interrupt. More...

## Defines
#define | Usb_send_event(x) (g_usb_event |= (1<<x))
#define | Usb_ack_event(x) (g_usb_event &= ~(1<<x))
#define | Usb_clear_all_event() (g_usb_event = 0)
#define | Is_usb_event(x) ((g_usb_event & (1<<x)) ? TRUE : FALSE)
#define | Is_not_usb_event(x) ((g_usb_event & (1<<x)) ? FALSE: TRUE)
#define | Is_host_emergency_exit() (Is_usb_id_device())
#define | Is_usb_device() (g_usb_mode==USB_MODE_DEVICE ? TRUE : FALSE)
#define | Is_usb_host() (g_usb_mode==USB_MODE_HOST ? TRUE : FALSE)
#define | Otg_send_event(x) (g_otg_event |= (1<<x))
#define | Otg_ack_event(x) (g_otg_event &= ~(1<<x))
#define | Otg_clear_all_event() (g_otg_event = 0)
#define | Is_otg_event(x) ((g_otg_event & (1<<x)) ? TRUE : FALSE)
#define | Is_not_otg_event(x) ((g_otg_event & (1<<x)) ? FALSE: TRUE)
#define | EVT_USB_POWERED 1
#define | EVT_USB_UNPOWERED 2
#define | EVT_USB_DEVICE_FUNCTION 3
#define | EVT_USB_HOST_FUNCTION 4
#define | EVT_USB_SUSPEND 5
#define | EVT_USB_WAKE_UP 6
#define | EVT_USB_RESUME 7
#define | EVT_USB_RESET 8
#define | EVT_HOST_SOF 9
#define | EVT_HOST_HWUP 10
#define | EVT_HOST_DISCONNECTION 11
#define | EVT_HOST_REMOTE_WAKEUP 12
#define | EVT_OTG_HNP_ERROR 1
#define | EVT_OTG_HNP_SUCCESS 2
#define | EVT_OTG_SRP_RECEIVED 3
#define | EVT_OTG_DEV_UNSUPPORTED 4
#define | EVT_OTG_DEVICE_CONNECTED 5

## Detailed Description

Macros to manage USB events detected under interrupt.

## Define Documentation

#define Usb_send_event | ( | x |  | ) | (g_usb_event |= (1<<x))

Definition at line 57 of file usb_task.h.

Referenced by usb_device_task(), and usb_general_interrupt().

#define Usb_ack_event | ( | x |  | ) | (g_usb_event &= ~(1<<x))

Definition at line 58 of file usb_task.h.

Referenced by usb_device_task().

#define Usb_clear_all_event | ( |  | ) | (g_usb_event = 0)

Definition at line 59 of file usb_task.h.

#define Is_usb_event | ( | x |  | ) | ((g_usb_event & (1<<x)) ? TRUE : FALSE)

Definition at line 60 of file usb_task.h.

Referenced by usb_device_task().

#define Is_not_usb_event | ( | x |  | ) | ((g_usb_event & (1<<x)) ? FALSE: TRUE)

Definition at line 61 of file usb_task.h.

#define Is_host_emergency_exit | ( |  | ) | (Is_usb_id_device())

Definition at line 62 of file usb_task.h.

#define Is_usb_device | ( |  | ) | (g_usb_mode==USB_MODE_DEVICE ? TRUE : FALSE)

Definition at line 63 of file usb_task.h.

#define Is_usb_host | ( |  | ) | (g_usb_mode==USB_MODE_HOST ? TRUE : FALSE)

Definition at line 64 of file usb_task.h.

#define Otg_send_event | ( | x |  | ) | (g_otg_event |= (1<<x))

Definition at line 66 of file usb_task.h.

#define Otg_ack_event | ( | x |  | ) | (g_otg_event &= ~(1<<x))

Definition at line 67 of file usb_task.h.

Referenced by usb_device_task().

#define Otg_clear_all_event | ( |  | ) | (g_otg_event = 0)

Definition at line 68 of file usb_task.h.

#define Is_otg_event | ( | x |  | ) | ((g_otg_event & (1<<x)) ? TRUE : FALSE)

Definition at line 69 of file usb_task.h.

Referenced by usb_device_task().

#define Is_not_otg_event | ( | x |  | ) | ((g_otg_event & (1<<x)) ? FALSE: TRUE)

Definition at line 70 of file usb_task.h.

#define EVT_USB_POWERED 1

Definition at line 72 of file usb_task.h.

Referenced by usb_device_task().

#define EVT_USB_UNPOWERED 2

Definition at line 73 of file usb_task.h.

Referenced by usb_device_task().

#define EVT_USB_DEVICE_FUNCTION 3

Definition at line 74 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_USB_HOST_FUNCTION 4

Definition at line 75 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_USB_SUSPEND 5

Definition at line 76 of file usb_task.h.

Referenced by usb_device_task(), and usb_general_interrupt().

#define EVT_USB_WAKE_UP 6

Definition at line 77 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_USB_RESUME 7

Definition at line 78 of file usb_task.h.

Referenced by usb_device_task(), and usb_general_interrupt().

#define EVT_USB_RESET 8

Definition at line 79 of file usb_task.h.

Referenced by usb_device_task(), and usb_general_interrupt().

#define EVT_HOST_SOF 9

Definition at line 80 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_HOST_HWUP 10

Definition at line 81 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_HOST_DISCONNECTION 11

Definition at line 82 of file usb_task.h.

Referenced by usb_general_interrupt().

#define EVT_HOST_REMOTE_WAKEUP 12

Definition at line 83 of file usb_task.h.

#define EVT_OTG_HNP_ERROR 1

Definition at line 85 of file usb_task.h.

Referenced by usb_device_task().

#define EVT_OTG_HNP_SUCCESS 2

Definition at line 86 of file usb_task.h.

#define EVT_OTG_SRP_RECEIVED 3

Definition at line 87 of file usb_task.h.

#define EVT_OTG_DEV_UNSUPPORTED 4

Definition at line 88 of file usb_task.h.

Referenced by usb_device_task().

#define EVT_OTG_DEVICE_CONNECTED 5

Definition at line 89 of file usb_task.h.

Referenced by usb_device_task().