usb_specific_request.h File Reference

Specific enumeration process requests header file. More...

#include "config.h"

Include dependency graph for usb_specific_request.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  S_line_coding

Defines

#define GET_LINE_CODING   0x21
#define SET_LINE_CODING   0x20
#define SET_CONTROL_LINE_STATE   0x22
#define SEND_BREAK   0x23
#define SEND_ENCAPSULATED_COMMAND   0x00
#define GET_ENCAPSULATED_COMMAND   0x01

Functions

Bool usb_user_read_request (U8, U8)
 This function is called by the standard usb read request function when the Usb request is not supported.
Bool usb_user_get_descriptor (U8, U8)
 usb_user_get_descriptor.This function returns the size and the pointer on a user information structure
void usb_user_endpoint_init (U8)
 usb_user_endpoint_init.This function configures the endpoints.
void cdc_get_line_coding ()
 cdc_get_line_coding.This function manages reception of line coding parameters (baudrate...).
void cdc_set_line_coding ()
 cdc_set_line_coding.This function manages reception of line coding parameters (baudrate...).
void cdc_set_control_line_state (void)
 cdc_set_control_line_state.This function manages the SET_CONTROL_LINE_LINE_STATE CDC request.

Variables

code S_usb_device_descriptor usb_dev_desc
code S_usb_user_configuration_descriptor usb_conf_desc
code S_usb_user_configuration_descriptor usb_other_conf_desc
code S_usb_device_qualifier_descriptor usb_qual_desc
code S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor
code S_usb_product_string_descriptor usb_user_product_string_descriptor
code S_usb_serial_number usb_user_serial_number
code S_usb_language_id usb_user_language_id


Detailed Description

Specific enumeration process requests header file.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file usb_specific_request.h.


Define Documentation

#define GET_LINE_CODING   0x21

Definition at line 51 of file usb_specific_request.h.

Referenced by usb_user_read_request().

#define SET_LINE_CODING   0x20

Definition at line 52 of file usb_specific_request.h.

Referenced by usb_user_read_request().

#define SET_CONTROL_LINE_STATE   0x22

Definition at line 53 of file usb_specific_request.h.

Referenced by usb_user_read_request().

#define SEND_BREAK   0x23

Definition at line 54 of file usb_specific_request.h.

#define SEND_ENCAPSULATED_COMMAND   0x00

Definition at line 55 of file usb_specific_request.h.

#define GET_ENCAPSULATED_COMMAND   0x01

Definition at line 56 of file usb_specific_request.h.


Function Documentation

Bool usb_user_read_request ( U8  type,
U8  request 
)

This function is called by the standard usb read request function when the Usb request is not supported.

This function returns TRUE when the request is processed. This function returns FALSE if the request is not supported. In this case, a STALL handshake will be automatically sent by the standard usb read request function.

Parameters:
none 
Returns:
none

Definition at line 76 of file usb_specific_request.c.

References cdc_get_line_coding(), cdc_set_control_line_state(), cdc_set_line_coding(), FALSE, GET_LINE_CODING, SET_CONTROL_LINE_STATE, SET_LINE_CODING, TRUE, and Usb_read_byte.

Referenced by usb_process_request().

00077 {
00078 U8  descriptor_type ;
00079 U8  string_type     ;
00080 
00081    string_type     = Usb_read_byte();
00082    descriptor_type = Usb_read_byte();
00083    switch(request)
00084    {
00085       case GET_LINE_CODING:
00086          cdc_get_line_coding();
00087                return TRUE;
00088                break;
00089 
00090       case SET_LINE_CODING:
00091          cdc_set_line_coding();
00092                return TRUE;
00093                break;
00094 
00095       case SET_CONTROL_LINE_STATE:
00096          cdc_set_control_line_state();
00097       return TRUE;
00098       break;
00099 
00100       default:
00101          return FALSE;
00102          break;
00103 
00104    }
00105    return FALSE;
00106 }

Here is the call graph for this function:

Here is the caller graph for this function:

Bool usb_user_get_descriptor ( U8  type,
U8  string 
)

usb_user_get_descriptor.This function returns the size and the pointer on a user information structure

Parameters:
none 
Returns:
none

Definition at line 118 of file usb_specific_request.c.

References FALSE.

Referenced by usb_get_descriptor().

00119 { /*
00120    switch(type)
00121    {
00122       case STRING_DESCRIPTOR:
00123          switch (string)
00124          {
00125             case LANG_ID:
00126                data_to_transfer = sizeof (usb_user_language_id);
00127                pbuffer = &(usb_user_language_id.bLength);
00128                return TRUE;
00129                break;
00130             case MAN_INDEX:
00131                data_to_transfer = sizeof (usb_user_manufacturer_string_descriptor);
00132                pbuffer = &(usb_user_manufacturer_string_descriptor.bLength);
00133                return TRUE;
00134                break;
00135             case PROD_INDEX:
00136                data_to_transfer = sizeof (usb_user_product_string_descriptor);
00137                pbuffer = &(usb_user_product_string_descriptor.bLength);
00138                return TRUE;
00139                break;
00140             case SN_INDEX:
00141                data_to_transfer = sizeof (usb_user_serial_number);
00142                pbuffer = &(usb_user_serial_number.bLength);
00143                return TRUE;
00144                break;
00145             default:
00146                return FALSE;
00147          }
00148       default:
00149          return FALSE;
00150    }*/
00151 
00152    return FALSE;
00153 }

Here is the caller graph for this function:

void usb_user_endpoint_init ( U8  conf_nb  ) 

usb_user_endpoint_init.This function configures the endpoints.

Parameters:
none 
Returns:
none

Definition at line 163 of file usb_specific_request.c.

References DIRECTION_IN, DIRECTION_OUT, INT_EP, NYET_ENABLED, ONE_BANK, RX_EP, SIZE_32, TX_EP, TYPE_BULK, TYPE_INTERRUPT, usb_configure_endpoint, and Usb_reset_endpoint.

Referenced by usb_set_configuration().

00164 {
00165   usb_configure_endpoint(INT_EP,      \
00166                          TYPE_INTERRUPT,     \
00167                          DIRECTION_IN,  \
00168                          SIZE_32,       \
00169                          ONE_BANK,     \
00170                          NYET_ENABLED);
00171 
00172   usb_configure_endpoint(TX_EP,      \
00173                          TYPE_BULK,  \
00174                          DIRECTION_OUT,  \
00175                          SIZE_32,     \
00176                          ONE_BANK,     \
00177                          NYET_ENABLED);
00178 
00179   usb_configure_endpoint(RX_EP,      \
00180                          TYPE_BULK,     \
00181                          DIRECTION_IN,  \
00182                          SIZE_32,       \
00183                          ONE_BANK,     \
00184                          NYET_ENABLED);
00185 
00186   Usb_reset_endpoint(INT_EP);
00187   Usb_reset_endpoint(TX_EP);
00188   Usb_reset_endpoint(RX_EP);
00189 
00190 
00191 }

Here is the caller graph for this function:

void cdc_get_line_coding ( void   ) 

cdc_get_line_coding.This function manages reception of line coding parameters (baudrate...).

Parameters:
none 
Returns:
none

Definition at line 201 of file usb_specific_request.c.

References S_line_coding::bCharFormat, S_line_coding::bDataBits, S_line_coding::bParityType, S_line_coding::dwDTERate, Is_usb_read_control_enabled, Is_usb_receive_out, line_coding, LSB0, LSB1, LSB2, LSB3, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_send_control_in, and Usb_write_byte.

Referenced by usb_user_read_request().

Here is the caller graph for this function:

void cdc_set_line_coding ( void   ) 

cdc_set_line_coding.This function manages reception of line coding parameters (baudrate...).

Parameters:
none 
Returns:
none

Definition at line 229 of file usb_specific_request.c.

References S_line_coding::bCharFormat, S_line_coding::bDataBits, S_line_coding::bParityType, S_line_coding::dwDTERate, Is_usb_read_control_enabled, Is_usb_receive_out, line_coding, LSB0, LSB1, LSB2, LSB3, Usb_ack_receive_out, Usb_ack_receive_setup, Usb_read_byte, and Usb_send_control_in.

Referenced by usb_user_read_request().

Here is the caller graph for this function:

void cdc_set_control_line_state ( void   ) 

cdc_set_control_line_state.This function manages the SET_CONTROL_LINE_LINE_STATE CDC request.

Todo:
Manages here hardware flow control...
Parameters:
none 
Returns:
none

Definition at line 257 of file usb_specific_request.c.

References Is_usb_read_control_enabled, Usb_ack_receive_setup, and Usb_send_control_in.

Referenced by usb_user_read_request().

00258 {
00259    Usb_ack_receive_setup();
00260    Usb_send_control_in();
00261    while(!(Is_usb_read_control_enabled()));
00262 
00263 }

Here is the caller graph for this function:


Variable Documentation

code S_usb_device_descriptor usb_dev_desc

Definition at line 64 of file usb_descriptors.c.

code S_usb_user_configuration_descriptor usb_conf_desc

Definition at line 83 of file usb_descriptors.c.

code S_usb_user_configuration_descriptor usb_other_conf_desc

code S_usb_device_qualifier_descriptor usb_qual_desc

code S_usb_manufacturer_string_descriptor usb_user_manufacturer_string_descriptor

Definition at line 149 of file usb_descriptors.c.

code S_usb_product_string_descriptor usb_user_product_string_descriptor

Definition at line 158 of file usb_descriptors.c.

code S_usb_serial_number usb_user_serial_number

Definition at line 167 of file usb_descriptors.c.

code S_usb_language_id usb_user_language_id

Definition at line 176 of file usb_descriptors.c.


Generated on Mon May 5 15:58:16 2008 for ATMEL by  doxygen 1.5.1-p1