|
typedef void(* | HIDKBD_SetReportFunc_t) (uint8_t report) |
| Callback function pointer for HID output reports. This function will be called by the driver each time an output report is received by the device. More...
|
|
Implements a USB HID class keyboard.
HIDKBD implementation.
The source code of the HIDKBD implementation resides in kits/common/drivers/hidkbd.c and hidkbd.h. This driver implements a basic USB keyboard. Refer to hidkbd examples for STK3700 and DK3750 for examples using this driver.
HIDKBD device configuration options.
This section contains a description of the configuration options for the driver. The options are #define's which are expected to be found in the application "usbconfig.h" header file. The values shown below are from the Giant Gecko STK3700 hidbkd example.
// USB interface number. Interfaces are numbered from zero to one less than
// the number of concurrent interfaces supported by the configuration.
// The interfac numbers must be 0 standalone HID device, for a
// composite device which includes a HID interface it must not be in conflict
// with other device interfaces.
#define HIDKBD_INTERFACE_NO 0
// Endpoint address for HID input reports.
#define HIDKBD_INTR_IN_EP_ADDR 0x81
// The bInterval reported with the interrupt IN endpoint descriptor.
#define HIDKBD_POLL_RATE 24
// Timer id, see USBTIMER in the USB device stack documentation.
// The HID driver use a timer to implement the idle-rate defined in the HID class spec.
#define HIDKBD_IDLE_TIMER 0
typedef void(* HIDKBD_SetReportFunc_t) (uint8_t report) |
- Parameters
-
[in] | report | Output report byte.
Bit 0 : State of keyboard NumLock LED.
Bit 1 : State of keyboard CapsLock LED.
Bit 2 : State of keyboard ScrollLock LED. |
Definition at line 58 of file hidkbd.h.
int HIDKBD_SetupCmd |
( |
const USB_Setup_TypeDef * |
setup | ) |
|
- Parameters
-
[in] | setup | Pointer to the setup packet received. |
- Returns
- USB_STATUS_OK if command accepted, USB_STATUS_REQ_UNHANDLED when command is unknown. In the latter case the USB device stack will handle the request.
Definition at line 232 of file hidkbd.c.
References EFM32_MIN, and HIDKBD_ReportDescriptor.
void HIDKBD_StateChangeEvent |
( |
USBD_State_TypeDef |
oldState, |
|
|
USBD_State_TypeDef |
newState |
|
) |
| |
- Parameters
-
[in] | oldState | The device state the device has just left. |
[in] | newState | The new device state. |
Definition at line 344 of file hidkbd.c.
References DEFAULT_IDLE_RATE.
const char HIDKBD_ReportDescriptor[69] |
HID report descriptor created with usb.org's "HID Descriptor Tool(DT)" version 2.4. The descriptor defines an input report which matches the HIDKBD_KeyReport_t typedef, and an output report with 3 bits for controlling NumLock, CapsLock and ScrollLock keyboard LED's
Definition at line 67 of file hidkbd.c.
Referenced by HIDKBD_SetupCmd().