OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | setup_data |
USB Control Setup Data. More... | |
struct | usb_config_descriptor |
USB Configuration Descriptor. More... | |
struct | usb_device_descriptor |
USB Device Descriptor. More... | |
struct | usb_endpoint_descriptor |
USB Endpoint Descriptor. More... | |
struct | usb_interface_descriptor |
USB Interface Descriptor. More... | |
struct | usb_language_descriptor |
USB Language Descriptor. More... | |
struct | usb_string_descriptor |
USB String Descriptor. More... | |
Enumerations | |
enum | usb_isr { SUDAV_ISR = 13 , SOF_ISR , SUTOK_ISR , SUSPEND_ISR , USBRESET_ISR , IBN_ISR , EP0IN_ISR , EP0OUT_ISR , EP1IN_ISR , EP1OUT_ISR , EP2IN_ISR , EP2OUT_ISR , EP3IN_ISR , EP3OUT_ISR , EP4IN_ISR , EP4OUT_ISR , EP5IN_ISR , EP5OUT_ISR , EP6IN_ISR , EP6OUT_ISR , EP7IN_ISR , EP7OUT_ISR } |
USB Interrupts. More... | |
Functions | |
__xdata uint8_t * | usb_get_endpoint_cs_reg (uint8_t ep) |
Return the control/status register for an endpoint. More... | |
bool | usb_handle_clear_feature (void) |
Handle CLEAR_FEATURE request. More... | |
bool | usb_handle_get_descriptor (void) |
Handle GET_DESCRIPTOR request. More... | |
bool | usb_handle_get_status (void) |
Handle GET_STATUS request. More... | |
bool | usb_handle_set_feature (void) |
Handle SET_FEATURE request. More... | |
void | usb_handle_set_interface (void) |
Handle SET_INTERFACE request. More... | |
void | usb_handle_setup_data (void) |
Handle the arrival of a USB Control Setup Packet. More... | |
void | usb_init (void) |
USB initialization. More... | |
void | usb_reset_data_toggle (uint8_t ep) |
Variables | |
volatile bool | EP2_in |
volatile bool | EP2_out |
volatile __xdata __at struct setup_data | setup_data |
#define CF_DEVICE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define CF_ENDPOINT (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_ENDPOINT) |
#define CF_INTERFACE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_INTERFACE) |
#define GC_DEVICE (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define GD_DEVICE (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define GI_INTERFACE (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_INTERFACE) |
#define GS_DEVICE (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define GS_ENDPOINT (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_ENDPOINT) |
#define GS_INTERFACE (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_INTERFACE) |
#define SC_DEVICE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define SD_DEVICE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define SF_DEVICE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_DEVICE) |
#define SF_ENDPOINT (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_ENDPOINT) |
#define SF_INTERFACE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_INTERFACE) |
#define SI_INTERFACE (USB_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_RECIP_INTERFACE) |
#define STR_DESCR | ( | len, | |
... | |||
) | { len * 2 + 2, DESCRIPTOR_TYPE_STRING, { __VA_ARGS__ } } |
#define SY_ENDPOINT (USB_DIR_IN | USB_REQ_TYPE_STANDARD | USB_RECIP_ENDPOINT) |
enum usb_isr |
__xdata uint8_t* usb_get_endpoint_cs_reg | ( | uint8_t | ep | ) |
Return the control/status register for an endpoint.
ep | endpoint address |
Definition at line 221 of file usb.c.
References NULL.
Referenced by usb_handle_clear_feature(), usb_handle_get_status(), and usb_handle_set_feature().
bool usb_handle_clear_feature | ( | void | ) |
Handle CLEAR_FEATURE request.
Definition at line 334 of file usb.c.
References setup_data::bmRequestType, CF_DEVICE, CF_ENDPOINT, EPSTALL, STALL_EP0, usb_get_endpoint_cs_reg(), setup_data::wIndex, and setup_data::wValue.
Referenced by usb_handle_setup_data().
bool usb_handle_get_descriptor | ( | void | ) |
Handle GET_DESCRIPTOR request.
Definition at line 403 of file usb.c.
References config_descriptor, DESCRIPTOR_TYPE_CONFIGURATION, DESCRIPTOR_TYPE_DEVICE, DESCRIPTOR_TYPE_STRING, device_descriptor, en_string_descriptors, HI8, language_descriptor, LO8, setup_data::wIndex, and setup_data::wValue.
Referenced by usb_handle_setup_data().
bool usb_handle_get_status | ( | void | ) |
Handle GET_STATUS request.
Definition at line 283 of file usb.c.
References setup_data::bmRequestType, EPSTALL, GS_DEVICE, GS_ENDPOINT, GS_INTERFACE, usb_get_endpoint_cs_reg(), and setup_data::wIndex.
Referenced by usb_handle_setup_data().
bool usb_handle_set_feature | ( | void | ) |
Handle SET_FEATURE request.
Definition at line 368 of file usb.c.
References setup_data::bmRequestType, EPSTALL, SF_DEVICE, SF_ENDPOINT, usb_get_endpoint_cs_reg(), setup_data::wIndex, and setup_data::wValue.
Referenced by usb_handle_setup_data().
void usb_handle_set_interface | ( | void | ) |
Handle SET_INTERFACE request.
Definition at line 444 of file usb.c.
References EPBSY, USB_DIR_IN, USB_DIR_OUT, and usb_reset_data_toggle().
Referenced by usb_handle_setup_data().
void usb_handle_setup_data | ( | void | ) |
Handle the arrival of a USB Control Setup Packet.
Definition at line 461 of file usb.c.
References usb_config_descriptor::bConfigurationValue, usb_interface_descriptor::bInterfaceNumber, setup_data::bRequest, CLEAR_FEATURE, config_descriptor, GET_CONFIGURATION, GET_DESCRIPTOR, GET_INTERFACE, GET_STATUS, interface_descriptor00, SET_ADDRESS, SET_CONFIGURATION, SET_DESCRIPTOR, SET_FEATURE, SET_INTERFACE, STALL_EP0, SYNCH_FRAME, usb_handle_clear_feature(), usb_handle_get_descriptor(), usb_handle_get_status(), usb_handle_set_feature(), and usb_handle_set_interface().
Referenced by sudav_isr().
void usb_init | ( | void | ) |
void usb_reset_data_toggle | ( | uint8_t | ep | ) |
|
extern |
Definition at line 25 of file usb.c.
Referenced by command_loop(), and ep2in_isr().
|
extern |
Definition at line 24 of file usb.c.
Referenced by command_loop(), and ep2out_isr().
|
extern |