OpenOCD
|
Defines USB descriptors, interrupt routines and helper functions. More...
Go to the source code of this file.
Macros | |
#define | NUM_ENDPOINTS 2 |
Functions | |
void | ep0in_isr (void) |
void | ep0out_isr (void) |
void | ep1in_isr (void) |
void | ep1out_isr (void) |
void | ep2in_isr (void) |
EP2 IN: called after the transfer from uC->Host has finished: we sent data. More... | |
void | ep2out_isr (void) |
EP2 OUT: called after the transfer from Host->uC has finished: we got data. More... | |
void | ep3in_isr (void) |
void | ep3out_isr (void) |
void | ep4in_isr (void) |
void | ep4out_isr (void) |
void | ep5in_isr (void) |
void | ep5out_isr (void) |
void | ep6in_isr (void) |
void | ep6out_isr (void) |
void | ep7in_isr (void) |
void | ep7out_isr (void) |
void | ibn_isr (void) |
void | sof_isr (void) |
void | sudav_isr (void) |
void | suspend_isr (void) |
void | sutok_isr (void) |
__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) |
void | usbreset_isr (void) |
Variables | |
__code struct usb_endpoint_descriptor | Bulk_EP2_IN_Endpoint_Descriptor |
__code struct usb_endpoint_descriptor | Bulk_EP2_OUT_Endpoint_Descriptor |
__code struct usb_config_descriptor | config_descriptor |
__code struct usb_device_descriptor | device_descriptor |
__code struct usb_string_descriptor *__code | en_string_descriptors [4] |
volatile bool | EP2_in |
volatile bool | EP2_out |
__code struct usb_interface_descriptor | interface_descriptor00 |
__code struct usb_language_descriptor | language_descriptor |
volatile __xdata __at struct setup_data | setup_data |
__code struct usb_string_descriptor | strConfigDescr |
__code struct usb_string_descriptor | strManufacturer |
__code struct usb_string_descriptor | strProduct |
__code struct usb_string_descriptor | strSerialNumber |
Defines USB descriptors, interrupt routines and helper functions.
To minimize code size, we make the following assumptions:
Therefore, we do not have to support the Set Configuration USB request.
Definition in file usb.c.
void ep2in_isr | ( | void | ) |
void ep2out_isr | ( | void | ) |
void sudav_isr | ( | void | ) |
__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 | ) |
__code struct usb_endpoint_descriptor Bulk_EP2_IN_Endpoint_Descriptor |
__code struct usb_endpoint_descriptor Bulk_EP2_OUT_Endpoint_Descriptor |
__code struct usb_config_descriptor config_descriptor |
Definition at line 52 of file usb.c.
Referenced by usb_handle_get_descriptor(), and usb_handle_setup_data().
__code struct usb_device_descriptor device_descriptor |
Definition at line 33 of file usb.c.
Referenced by usb_handle_get_descriptor().
__code struct usb_string_descriptor* __code en_string_descriptors[4] |
Definition at line 114 of file usb.c.
Referenced by usb_handle_get_descriptor().
volatile bool EP2_in |
Definition at line 25 of file usb.c.
Referenced by command_loop(), and ep2in_isr().
volatile bool EP2_out |
Definition at line 24 of file usb.c.
Referenced by command_loop(), and ep2out_isr().
__code struct usb_interface_descriptor interface_descriptor00 |
Definition at line 65 of file usb.c.
Referenced by usb_handle_setup_data().
__code struct usb_language_descriptor language_descriptor |
Definition at line 95 of file usb.c.
Referenced by usb_handle_get_descriptor().
volatile __xdata __at struct setup_data setup_data |
__code struct usb_string_descriptor strConfigDescr |
__code struct usb_string_descriptor strManufacturer |
__code struct usb_string_descriptor strProduct |
__code struct usb_string_descriptor strSerialNumber |