Atmel Software Framework

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

Class internal implementation.

Functions

bool udi_hid_kbd_down (uint8_t key_id)
 Send events key pressed. More...
 
bool udi_hid_kbd_modifier_down (uint8_t modifier_id)
 Send events key modifier pressed. More...
 
bool udi_hid_kbd_modifier_up (uint8_t modifier_id)
 Send events key modifier released. More...
 
bool udi_hid_kbd_up (uint8_t key_id)
 Send events key released. More...
 

Variables

UDC_DESC_STORAGE
udi_hid_kbd_report_desc_t 
udi_hid_kbd_report_desc
 HID report descriptor for standard HID keyboard. More...
 

Internal defines and variables to manage HID keyboard

static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_kbd_rate
 To store current rate of HID keyboard. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_kbd_protocol
 To store current protocol of HID keyboard. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_kbd_report_set
 To store report feedback from USB host. More...
 
static bool udi_hid_kbd_b_report_valid
 To signal if a valid report is ready to send. More...
 
static uint8_t udi_hid_kbd_report [UDI_HID_KBD_REPORT_SIZE]
 Report ready to send. More...
 
static bool udi_hid_kbd_b_report_trans_ongoing
 Signal if a report transfer is on going. More...
 
static COMPILER_WORD_ALIGNED
uint8_t 
udi_hid_kbd_report_trans [UDI_HID_KBD_REPORT_SIZE]
 Buffer used to send report. More...
 
#define UDI_HID_KBD_REPORT_SIZE   8
 Size of report for standard HID keyboard. More...
 

Internal routines

static bool udi_hid_kbd_setreport (void)
 Changes keyboard report states (like LEDs) More...
 
static bool udi_hid_kbd_send_report (void)
 Send the report. More...
 
static void udi_hid_kbd_report_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_kbd_setreport_valid (void)
 Callback called to update report from USB host udi_hid_kbd_report_set is updated before callback execution. More...
 

#define UDI_HID_KBD_REPORT_SIZE   8

Size of report for standard HID keyboard.

Referenced by udi_hid_kbd_down(), udi_hid_kbd_enable(), udi_hid_kbd_send_report(), and udi_hid_kbd_up().

bool udi_hid_kbd_down ( uint8_t  key_id)
bool udi_hid_kbd_modifier_down ( uint8_t  modifier_id)

Send events key modifier pressed.

Parameters
modifier_idID of key modifier
Returns
1 if function was successfully done, otherwise 0.

References cpu_irq_restore(), cpu_irq_save(), udi_hid_kbd_b_report_valid, udi_hid_kbd_report, and udi_hid_kbd_send_report().

bool udi_hid_kbd_modifier_up ( uint8_t  modifier_id)

Send events key modifier released.

Parameters
modifier_idID of key modifier
Returns
1 if function was successfully done, otherwise 0.

References cpu_irq_restore(), cpu_irq_save(), udi_hid_kbd_b_report_valid, udi_hid_kbd_report, and udi_hid_kbd_send_report().

static void udi_hid_kbd_report_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
Returns
1 if function was successfully done, otherwise 0.

References udi_hid_kbd_b_report_trans_ongoing, udi_hid_kbd_b_report_valid, udi_hid_kbd_send_report(), and UNUSED().

Referenced by udi_hid_kbd_send_report().

static void udi_hid_kbd_setreport_valid ( void  )
static

Callback called to update report from USB host udi_hid_kbd_report_set is updated before callback execution.

References UDI_HID_KBD_CHANGE_LED, and udi_hid_kbd_report_set.

Referenced by udi_hid_kbd_setreport().

bool udi_hid_kbd_up ( uint8_t  key_id)

Send events key released.

Parameters
key_idID of key
Returns
1 if function was successfully done, otherwise 0.

References cpu_irq_restore(), cpu_irq_save(), i, udi_hid_kbd_b_report_valid, udi_hid_kbd_report, UDI_HID_KBD_REPORT_SIZE, and udi_hid_kbd_send_report().

bool udi_hid_kbd_b_report_trans_ongoing
static

Signal if a report transfer is on going.

Referenced by udi_hid_kbd_enable(), udi_hid_kbd_report_sent(), and udi_hid_kbd_send_report().

bool udi_hid_kbd_b_report_valid
static
COMPILER_WORD_ALIGNED uint8_t udi_hid_kbd_protocol
static

To store current protocol of HID keyboard.

Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().

COMPILER_WORD_ALIGNED uint8_t udi_hid_kbd_rate
static

To store current rate of HID keyboard.

Referenced by udi_hid_kbd_enable(), and udi_hid_kbd_setup().

HID report descriptor for standard HID keyboard.

Referenced by udi_hid_kbd_setup().

COMPILER_WORD_ALIGNED uint8_t udi_hid_kbd_report_set
static

To store report feedback from USB host.

Referenced by udi_hid_kbd_setreport(), and udi_hid_kbd_setreport_valid().

COMPILER_WORD_ALIGNED uint8_t udi_hid_kbd_report_trans[UDI_HID_KBD_REPORT_SIZE]
static

Buffer used to send report.

Referenced by udi_hid_kbd_send_report().