#include "config.h"
#include "conf\conf_usb.h"
#include "lib_mcu\usb\usb_drv.h"
#include "usb_enum.h"
#include "usb_user_configuration.h"
#include "usb_user_enum.h"
Go to the source code of this file.
Functions | |
| void | usb_get_descriptor (void) |
| usb_get_descriptor. | |
| void | usb_read_request (void) |
| void | usb_set_address (void) |
| usb_set_address. | |
| void | usb_set_configuration (void) |
| usb_set_configuration. | |
| void | usb_clear_feature (void) |
| usb_clear_feature. | |
| void | usb_set_feature (void) |
| usb_set_feature. | |
| void | usb_get_status (void) |
| usb_get_status. | |
| void | usb_get_configuration (void) |
| usb_get_configuration. | |
| void | usb_enum_var_init (void) |
| usb_enum_variable_init. | |
| void | usb_process_request (void) |
| usb_process_request. | |
Variables | |
| bdata bit | rx_bank |
| bit | zlp |
| _MEM_TYPE_SLOW_ U8 | endpoint_status [7] |
| _MEM_TYPE_SLOW_ U8 * | pbuffer |
| _MEM_TYPE_SLOW_ U8 | data_to_transfer |
| U8 | bmRequestType |
| _MEM_TYPE_SLOW_ U8 | usb_configuration_nb |
| 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 /. | |
| code S_usb_device_descriptor | usb_user_device_descriptor |
| code S_usb_user_configuration_descriptor | usb_user_configuration_descriptor |
Use of this program is subject to Atmel's End User License Agreement. Please read file license.txt for copyright notice.
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_user_enum.c file for non-standard request management. The enumeration parameters (descriptor tables) are contained in the usb_user_configuration.c file.
Definition in file usb_enum.c.
|
|
usb_get_descriptor. This function manages the GET DESCRIPTOR request. The device descriptor, the configuration descriptor and the device qualifier are supported. All other descriptors must be supported by the usb_user_get_descriptor function. Only 1 configuration is supported.
< sizeof (usb_user_device_descriptor); < sizeof (usb_user_configuration_descriptor); < don't care of wIndex field < read wLength < clear the receive setup flag < send only requested number of data < abort from Host Definition at line 261 of file usb_enum.c. References CONFIGURATION_DESCRIPTOR, data_to_transfer, DEVICE_DESCRIPTOR, EP_CONTROL_LENGTH, FALSE, Is_usb_read_control_enabled, Is_usb_receive_out, pbuffer, TRUE, U16, U8, Usb_ack_in_ready, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_enable_stall_handshake, Usb_get_conf_desc_length, Usb_get_conf_desc_pointer, Usb_get_dev_desc_length, Usb_get_dev_desc_pointer, Usb_read_byte, Usb_send_control_in, Usb_set_DIR, usb_user_get_descriptor(), Usb_write_byte, and zlp. Referenced by usb_process_request(), and usb_user_read_request().
|
|
|
|
|
|
usb_set_address. This function manages the SET ADDRESS request. When complete, the device will filter the requests using the new address.
< send a ZLP for STATUS phase < waits for status phase done < before using the new address Definition at line 189 of file usb_enum.c. References Is_usb_in_ready, U8, Usb_ack_in_ready, Usb_ack_receive_setup, Usb_configure_address, Usb_enable_address, Usb_read_byte, and Usb_send_control_in. Referenced by usb_process_request().
|
|
|
usb_set_configuration. This function manages the SET CONFIGURATION request. If the selected configuration is valid, this function call the usb_user_endpoint_init() function that will configure the endpoints following the configuration number.
< send a ZLP for STATUS phase < endpoint configuration < keep that order (set StallRq/clear RxSetup) or a < OUT request following the SETUP may be acknowledged Definition at line 218 of file usb_enum.c. References Is_usb_in_ready, NB_CONFIGURATIONS, U8, Usb_ack_in_ready, Usb_ack_receive_setup, usb_configuration_nb, Usb_enable_stall_handshake, Usb_read_byte, Usb_send_control_in, Usb_set_configuration_action, and usb_user_endpoint_init(). Referenced by usb_process_request().
|
|
|
usb_clear_feature. This function manages the SET FEATURE request.
< dummy read < keep that order (set StallRq/clear RxSetup) or a < OUT request following the SETUP may be acknowledged < keep that order (set StallRq/clear RxSetup) or a < OUT request following the SETUP may be acknowledged Definition at line 505 of file usb_enum.c. References bmRequestType, endpoint_status, ENDPOINT_TYPE, EP_CONTROL, FEATURE_ENDPOINT_HALT, INTERFACE_TYPE, Is_usb_endpoint_enabled, MSK_EP_DIR, U8, Usb_ack_receive_setup, Usb_disable_stall_handshake, Usb_enable_stall_handshake, Usb_read_byte, Usb_reset_data_toggle, Usb_reset_endpoint, Usb_select_endpoint, Usb_send_control_in, and ZERO_TYPE. Referenced by usb_process_request().
|
|
|
usb_set_feature. This function manages the SET FEATURE request. The USB test modes are supported by this function.
< dummy read < keep that order (set StallRq/clear RxSetup) or a < OUT request following the SETUP may be acknowledged Definition at line 440 of file usb_enum.c. References bmRequestType, endpoint_status, ENDPOINT_TYPE, EP_CONTROL, FEATURE_ENDPOINT_HALT, INTERFACE_TYPE, Is_usb_endpoint_enabled, MSK_EP_DIR, U8, Usb_ack_receive_setup, Usb_enable_stall_handshake, Usb_read_byte, Usb_select_endpoint, and Usb_send_control_in. Referenced by usb_process_request().
|
|
|
usb_get_status. This function manages the GET STATUS request. The device, interface or endpoint status is returned.
< dummy read < dummy read Definition at line 389 of file usb_enum.c. References bmRequestType, DEVICE_STATUS, endpoint_status, INTERFACE_STATUS, Is_usb_in_ready, Is_usb_receive_out, MSK_EP_DIR, REQUEST_DEVICE_STATUS, REQUEST_ENDPOINT_STATUS, REQUEST_INTERFACE_STATUS, U8, Usb_ack_in_ready, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_enable_stall_handshake, Usb_read_byte, Usb_send_control_in, Usb_set_DIR, and Usb_write_byte. Referenced by usb_process_request().
|
|
|
usb_get_configuration. This function manages the GET CONFIGURATION request. The current configuration number is returned.
Definition at line 364 of file usb_enum.c. References Is_usb_in_ready, Is_usb_receive_out, Usb_ack_in_ready, Usb_ack_receive_out, Usb_ack_receive_setup, usb_configuration_nb, Usb_send_control_in, Usb_set_DIR, and Usb_write_byte. Referenced by usb_process_request().
|
|
|
usb_enum_variable_init. This function initializes the main usb variables:
< USB is not connected < Default configuration number is 0 Definition at line 78 of file usb_enum.c. References endpoint_status, ep_num, FALSE, NB_ENDPOINTS, rx_bank, U8, usb_configuration_nb, and usb_connected. Referenced by usb_interrupt().
|
|
|
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.
< un-supported request => call to user read request Definition at line 115 of file usb_enum.c. References bmRequestType, CLEAR_FEATURE, EP_CONTROL, FALSE, GET_CONFIGURATION, GET_DESCRIPTOR, GET_INTERFACE, GET_STATUS, SET_ADDRESS, SET_CONFIGURATION, SET_DESCRIPTOR, SET_FEATURE, SET_INTERFACE, SYNCH_FRAME, U8, Usb_ack_receive_setup, usb_clear_feature(), Usb_enable_stall_handshake, usb_get_configuration(), usb_get_descriptor(), usb_get_status(), Usb_read_byte, Usb_select_endpoint, usb_set_address(), usb_set_configuration(), usb_set_feature(), and usb_user_read_request(). Referenced by usb_task().
|
|
|
Definition at line 50 of file usb_enum.c. Referenced by usb_enum_var_init(). |
|
|
Definition at line 52 of file usb_enum.c. Referenced by usb_get_descriptor(). |
|
|
Definition at line 53 of file usb_enum.c. Referenced by usb_clear_feature(), usb_enum_var_init(), usb_get_status(), and usb_set_feature(). |
|
|
Definition at line 54 of file usb_enum.c. Referenced by usb_get_descriptor(), and usb_user_get_descriptor(). |
|
|
Definition at line 55 of file usb_enum.c. Referenced by usb_get_descriptor(), and usb_user_get_descriptor(). |
|
|
Definition at line 58 of file usb_enum.c. Referenced by usb_clear_feature(), usb_get_status(), usb_process_request(), and usb_set_feature(). |
|
|
Definition at line 60 of file usb_enum.c. Referenced by usb_enum_var_init(), usb_get_configuration(), usb_read_continuous(), usb_set_configuration(), and usb_write_continuous(). |
|
|
Public : (bit) usb_connected usb_connected is set to TRUE when VBUS has been detected usb_connected is set to FALSE otherwise /.
Definition at line 61 of file usb_enum.c. Referenced by usb_enum_var_init(), usb_interrupt(), usb_task(), and usb_task_init(). |
|
|
Definition at line 62 of file usb_enum.c. |
|
|
Definition at line 63 of file usb_enum.c. |
1.3.7