Atmel Software Framework

services/usb/_asf_v1/class/hid/examples/enum/device/usb_specific_request.c File Reference
#include "conf_usb.h"
#include "usb_drv.h"
#include "usb_descriptors.h"
#include "usb_standard_request.h"
#include "usb_specific_request.h"

Functions

static void hid_get_descriptor (uint8_t size_of_report, const uint8_t *p_usb_hid_report)
 This function manages the HID Get_Descriptor request. More...
 
void usb_hid_get_idle (uint8_t u8_report_id)
 This function manages hid get idle request. More...
 
void usb_hid_set_idle (uint8_t u8_report_id, uint8_t u8_duration)
 This function manages hid set idle request. More...
 
void usb_user_endpoint_init (uint8_t conf_nb)
 This function configures the endpoints of the device application. More...
 
bool usb_user_get_descriptor (uint8_t type, uint8_t string)
 This function returns the size and the pointer on a user information structure. More...
 
bool usb_user_read_request (uint8_t type, uint8_t request)
 This function is called by the standard USB read request function when the USB request is not supported. More...
 

Variables

uint16_t data_to_transfer
 
uint8_t g_u8_report_rate =0
 
const void * pbuffer
 
volatile uint8_t usb_hid_report_mouse []
 

static void hid_get_descriptor ( uint8_t  size_of_report,
const uint8_t *  p_usb_hid_report 
)
static

This function manages the HID Get_Descriptor request.

< clear the setup received flag

< zero length packet condition

< send only requested number of data bytes

< Send data until necessary

References data_to_transfer, EP_CONTROL, EP_CONTROL_LENGTH, Is_usb_control_in_ready, Is_usb_control_out_received, Is_usb_nak_out, pbuffer, Usb_ack_control_in_ready_send, Usb_ack_control_out_received_free, Usb_ack_nak_out, Usb_ack_setup_received_free, usb_format_usb_to_mcu_data, Usb_read_endpoint_data, Usb_reset_endpoint_fifo_access, and usb_write_ep_txpacket().

Referenced by usb_user_read_request().

void usb_hid_get_idle ( uint8_t  u8_report_id)

This function manages hid get idle request.

Parameters
u8_report_id0 the idle rate applies to all input reports, else only applies to the Report ID

References EP_CONTROL, g_u8_report_rate, INTERFACE_NB_MOUSE, Is_usb_control_out_received, Usb_ack_control_in_ready_send, Usb_ack_control_out_received_free, Usb_ack_setup_received_free, Usb_read_endpoint_data, and Usb_write_endpoint_data.

Referenced by usb_user_read_request().

void usb_hid_set_idle ( uint8_t  u8_report_id,
uint8_t  u8_duration 
)

This function manages hid set idle request.

Parameters
u8_report_id0 the idle rate applies to all input reports, else only applies to the Report ID
u8_durationWhen the upper byte of wValue is 0 (zero), the duration is indefinite else from 0.004 to 1.020 seconds

References EP_CONTROL, g_u8_report_rate, INTERFACE_NB_MOUSE, Is_usb_control_in_ready, Usb_ack_control_in_ready_send, Usb_ack_setup_received_free, and Usb_read_endpoint_data.

Referenced by usb_user_read_request().

uint16_t data_to_transfer
uint8_t g_u8_report_rate =0
const void* pbuffer
volatile uint8_t usb_hid_report_mouse[]