Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

Class internal implementation.

Functions

bool udi_hid_generic_send_report_in (uint8_t *data)
 Routine used to send a report to USB Host. More...
 

Variables

UDC_DESC_STORAGE
udi_hid_generic_report_desc_t 
udi_hid_generic_report_desc
 HID report descriptor for standard HID generic. More...
 

Internal defines and variables to manage HID generic

static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_generic_rate
 To store current rate of HID generic. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_generic_protocol
 To store current protocol of HID generic. More...
 
static bool udi_hid_generic_b_report_in_free
 To signal if the report IN buffer is free (no transfer on going) More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_generic_report_in [UDI_HID_REPORT_IN_SIZE]
 Report to send. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_generic_report_out [UDI_HID_REPORT_OUT_SIZE]
 Report to receive. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_generic_report_feature [UDI_HID_REPORT_FEATURE_SIZE]
 Report to receive via SetFeature. More...
 

Internal routines

static bool udi_hid_generic_setreport (void)
 Send a report to HID interface. More...
 
static void udi_hid_generic_setfeature_valid (void)
 Initialize UDD to receive setfeature data. More...
 
static void udi_hid_generic_report_out_received (udd_ep_status_t status, iram_size_t nb_received, udd_ep_id_t ep)
 Callback called when the report is received. More...
 
static bool udi_hid_generic_report_out_enable (void)
 Enable reception of out report. More...
 
static void udi_hid_generic_report_in_sent (udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep)
 Callback called when the report is sent. More...
 

static void udi_hid_generic_report_in_sent ( udd_ep_status_t  status,
iram_size_t  nb_sent,
udd_ep_id_t  ep 
)
static

Callback called when the report is sent.

Parameters
statusUDD_EP_TRANSFER_OK, if transfer is completed
statusUDD_EP_TRANSFER_ABORT, if transfer is aborted
nb_sentnumber of data transfered

References udi_hid_generic_b_report_in_free, and UNUSED().

static bool udi_hid_generic_report_out_enable ( void  )
static

Enable reception of out report.

Returns
1 if function was successfully done, otherwise 0.

References UDI_HID_GENERIC_EP_OUT, and udi_hid_generic_report_out.

Referenced by udi_hid_generic_enable(), and udi_hid_generic_report_out_received().

static void udi_hid_generic_report_out_received ( udd_ep_status_t  status,
iram_size_t  nb_received,
udd_ep_id_t  ep 
)
static

Callback called when the report is received.

Parameters
statusUDD_EP_TRANSFER_OK, if transfer is completed
statusUDD_EP_TRANSFER_ABORT, if transfer is aborted
nb_sentnumber of data received

References UDD_EP_TRANSFER_OK, udi_hid_generic_report_out, udi_hid_generic_report_out_enable(), and UNUSED().

bool udi_hid_generic_send_report_in ( uint8_t *  data)

Routine used to send a report to USB Host.

Parameters
dataPointer on the report to send (size = UDI_HID_REPORT_IN_SIZE)
Returns
1 if function was successfully done, otherwise 0.

References cpu_irq_restore(), cpu_irq_save(), udi_hid_generic_b_report_in_free, UDI_HID_GENERIC_EP_IN, and udi_hid_generic_report_in.

static void udi_hid_generic_setfeature_valid ( void  )
static

Initialize UDD to receive setfeature data.

References udd_ctrl_request_t::payload_size, udd_g_ctrlreq, and udi_hid_generic_report_feature.

Referenced by udi_hid_generic_setreport().

bool udi_hid_generic_b_report_in_free
static

To signal if the report IN buffer is free (no transfer on going)

Referenced by udi_hid_generic_enable(), udi_hid_generic_report_in_sent(), and udi_hid_generic_send_report_in().

COMPILER_WORD_ALIGNED uint8_t udi_hid_generic_protocol
static

To store current protocol of HID generic.

Referenced by udi_hid_generic_enable(), and udi_hid_generic_setup().

COMPILER_WORD_ALIGNED uint8_t udi_hid_generic_rate
static

To store current rate of HID generic.

Referenced by udi_hid_generic_enable(), and udi_hid_generic_setup().

UDC_DESC_STORAGE udi_hid_generic_report_desc_t udi_hid_generic_report_desc

HID report descriptor for standard HID generic.

Referenced by udi_hid_generic_setup().

COMPILER_WORD_ALIGNED uint8_t udi_hid_generic_report_feature[UDI_HID_REPORT_FEATURE_SIZE]
static

Report to receive via SetFeature.

Referenced by udi_hid_generic_setfeature_valid(), and udi_hid_generic_setreport().

COMPILER_WORD_ALIGNED uint8_t udi_hid_generic_report_in[UDI_HID_REPORT_IN_SIZE]
static

Report to send.

Referenced by udi_hid_generic_send_report_in().

COMPILER_WORD_ALIGNED uint8_t udi_hid_generic_report_out[UDI_HID_REPORT_OUT_SIZE]
static