Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB device standard requests decoding module

Macros

#define ADDRESSED   3
 
#define ATTACHED   0
 
#define CONFIGURED   4
 
#define DEFAULT   2
 
#define Is_device_enumerated()   (usb_configuration_nb != 0)
 Returns true when device connected and correctly enumerated with a host. More...
 
#define POWERED   1
 
#define SUSPENDED   5
 
#define USB_CONFIG_ATTRIBUTES_RESERVED   0x80
 
#define USB_CONFIG_BUSPOWERED   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x00)
 
#define USB_CONFIG_REMOTEWAKEUP   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x20)
 
#define USB_CONFIG_SELFPOWERED   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x40)
 

Functions

void usb_process_request (void)
 This function reads the SETUP request sent to the default control endpoint and calls the appropriate function. More...
 

Variables

volatile U8 usb_configuration_nb
 

#define ADDRESSED   3
#define ATTACHED   0
#define CONFIGURED   4
#define DEFAULT   2
#define Is_device_enumerated ( )    (usb_configuration_nb != 0)

Returns true when device connected and correctly enumerated with a host.

The device high-level application should test this before performing any applicative request.

Referenced by device_template_task().

#define POWERED   1
#define SUSPENDED   5
#define USB_CONFIG_ATTRIBUTES_RESERVED   0x80
#define USB_CONFIG_BUSPOWERED   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x00)
#define USB_CONFIG_REMOTEWAKEUP   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x20)
#define USB_CONFIG_SELFPOWERED   (USB_CONFIG_ATTRIBUTES_RESERVED | 0x40)

void usb_process_request ( void  )

This function reads the SETUP request sent to the default control endpoint and calls the appropriate function.

When exiting of the usb_read_request function, the device is ready to manage the next request.

If the received request is not supported or a non-standard USB request, the function will call the custom decoding function in usb_specific_request module.

Note
List of supported requests: GET_DESCRIPTOR GET_CONFIGURATION SET_ADDRESS SET_CONFIGURATION CLEAR_FEATURE SET_FEATURE GET_STATUS

< unsupported request => call to user read request

References bmRequestType, CLEAR_FEATURE, EP_CONTROL, GET_CONFIGURATION, GET_DESCRIPTOR, GET_INTERFACE, GET_STATUS, SET_ADDRESS, SET_CONFIGURATION, SET_DESCRIPTOR, SET_FEATURE, SET_INTERFACE, SYNCH_FRAME, Usb_ack_setup_received_free, usb_clear_feature(), Usb_enable_stall_handshake, usb_get_configuration(), usb_get_descriptor(), usb_get_interface(), usb_get_status(), Usb_read_endpoint_data, Usb_reset_endpoint_fifo_access, usb_set_address(), usb_set_configuration(), usb_set_feature(), usb_set_interface(), and usb_user_read_request().

Referenced by usb_device_task().