usb_standard_request.c File Reference

This file contains the USB endpoint 0 management routines corresponding to the standard enumeration process (refer to chapter 9 of the USB specification. This file calls routines of the usb_specific_request.c file for non-standard request management. The enumeration parameters (descriptor tables) are contained in the usb_descriptors.c file. More...

#include "config.h"
#include "usb_drv.h"
#include "usb_descriptors.h"
#include "usb_specific_request.h"
#include <string.h>

Go to the source code of this file.

Functions

void usb_process_request (void)
 usb_process_request.
void usb_get_string_descriptor_sram (U8 string_type)
void usb_get_string_descriptor (U8 string_type)

Variables

U8 usb_configuration_nb
 Public : (U8) usb_configuration_nb Store the number of the USB configuration used by the USB device when its value is different from zero, it means the device mode is enumerated Used with USB_DEVICE_FEATURE == ENABLED only /.
bit usb_connected
 Public : (bit) usb_connected usb_connected is set to TRUE when VBUS has been detected usb_connected is set to FALSE otherwise Used with USB_DEVICE_FEATURE == ENABLED only /.

Detailed Description

This file contains the USB endpoint 0 management routines corresponding to the standard enumeration process (refer to chapter 9 of the USB specification. This file calls routines of the usb_specific_request.c file for non-standard request management. The enumeration parameters (descriptor tables) are contained in the usb_descriptors.c file.

Definition in file usb_standard_request.c.


Function Documentation

void usb_get_string_descriptor ( U8  string_type  ) 

< don't care of wIndex field

< read wLength

< clear the receive setup flag

< Send data until necessary

< Check endpoint 0 size

abort from Host

Definition at line 330 of file usb_standard_request.c.

References Is_usb_receive_out, PGM_P, TRUE, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_enable_stall_handshake, usb_get_string_descriptor_sram(), Usb_read_byte, Usb_send_control_in, and Usb_write_byte.

void usb_get_string_descriptor_sram ( U8  string_type  ) 

< don't care of wIndex field

< read wLength

< clear the receive setup flag

< Send data until necessary

< Check endpoint 0 size

abort from Host

Definition at line 244 of file usb_standard_request.c.

References Is_usb_receive_out, TRUE, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_enable_stall_handshake, Usb_read_byte, Usb_send_control_in, and Usb_write_byte.

Referenced by usb_get_string_descriptor().

void usb_process_request ( void   ) 

usb_process_request.

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.

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

< un-supported request => call to user read request

Definition at line 118 of file usb_standard_request.c.

References CLEAR_FEATURE, Is_usb_receive_setup, SET_FEATURE, Usb_ack_in_ready, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_enable_stall_handshake, Usb_read_byte, Usb_select_endpoint, and usb_user_read_request().

Referenced by usb_mass_storage_csw().


Generated on Mon Apr 11 14:23:48 2011 for Contiki 2.5 by  doxygen 1.6.1