Typedefs | Functions | Variables

usb/include/usb.h File Reference

M-Stack. More...

Go to the source code of this file.

Typedefs

typedef int8_t(* usb_ep0_data_stage_callback )(bool data_ok, void *context)
 Endpoint 0 data stage callback definition.

Functions

int16_t USB_STRING_DESCRIPTOR_FUNC (uint8_t string_number, const void **ptr)
 String Descriptor Function.
void SET_CONFIGURATION_CALLBACK (uint8_t configuration)
 Callback for SET_CONFIGURATION requests.
uint16_t GET_DEVICE_STATUS_CALLBACK ()
 Callback for GET_STATUS requests.
void ENDPOINT_HALT_CALLBACK (uint8_t endpoint, bool halted)
 Callback for SET_FEATURE or CLEAR_FEATURE with ENDPOINT_HALT.
int8_t SET_INTERFACE_CALLBACK (uint8_t interface, uint8_t alt_setting)
 Callback for the SET_INTERFACE request.
int8_t GET_INTERFACE_CALLBACK (uint8_t interface)
 Callback for the GET_INTERFACE request.
void OUT_TRANSACTION_CALLBACK (uint8_t endpoint)
 Callback for an OUT transaction.
void IN_TRANSACTION_COMPLETE_CALLBACK (uint8_t endpoint)
 Callback for an IN transaction.
int8_t UNKNOWN_SETUP_REQUEST_CALLBACK (const struct setup_packet *pkt)
 Callback for an unrecognized SETUP request.
int16_t UNKNOWN_GET_DESCRIPTOR_CALLBACK (const struct setup_packet *pkt, const void **descriptor)
 Callback for a GET_DESCRIPTOR request for an unknown descriptor.
void START_OF_FRAME_CALLBACK (void)
 Callback for USB Start of Frame event.
void USB_RESET_CALLBACK (void)
 USB Reset Callback.
void usb_init (void)
 Initialize the USB library and hardware.
void usb_service (void)
 Update the USB library and hardware.
uint8_t usb_get_configuration (void)
 Get the device configuration.
unsigned char * usb_get_in_buffer (uint8_t endpoint)
 Get a pointer to an endpoint's input buffer.
void usb_send_in_buffer (uint8_t endpoint, size_t len)
 Send an endpoint's IN buffer to the host.
bool usb_in_endpoint_busy (uint8_t endpoint)
 Check whether an IN endpoint is busy.
uint8_t usb_halt_ep_in (uint8_t ep)
 Halt an IN endpoint.
bool usb_in_endpoint_halted (uint8_t endpoint)
 Check whether an endpoint is halted.
bool usb_out_endpoint_has_data (uint8_t endpoint)
 Check whether an OUT endpoint has received data.
void usb_arm_out_endpoint (uint8_t endpoint)
 Re-enable reception on an OUT endpoint.
uint8_t usb_halt_ep_out (uint8_t ep)
 Halt an OUT endpoint.
bool usb_out_endpoint_halted (uint8_t endpoint)
 Check whether an OUT endpoint is halted.
uint8_t usb_get_out_buffer (uint8_t endpoint, const unsigned char **buffer)
 Get a pointer to an endpoint's OUT buffer.
void usb_start_receive_ep0_data_stage (char *buffer, size_t len, usb_ep0_data_stage_callback callback, void *context)
 Start the data stage of an OUT control transfer.
void usb_send_data_stage (char *buffer, size_t len, usb_ep0_data_stage_callback callback, void *context)
 Start the data stage of an IN control transfer.

Variables

struct device_descriptor USB_DEVICE_DESCRIPTOR
 Device Descriptor.
struct configuration_descriptorUSB_CONFIG_DESCRIPTOR_MAP []
 Configuration Descriptor.

Detailed Description

M-Stack.

Microsoft-Specific OS Descriptors.

USB Chapter 9 Enumerations and Structures.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator