usb: hid: implement idle rate
Idle rate functionality has been implemented for HID USB class. Bassed on Device Class Definition for Human Interface Devices 1.11. Tested with USB3CV and host with idle rate. Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
This commit is contained in:
parent
6a4ddffaf9
commit
d5b79ff42c
5 changed files with 169 additions and 37 deletions
|
@ -2,6 +2,7 @@
|
|||
* Human Interface Device (HID) USB class core header
|
||||
*
|
||||
* Copyright (c) 2018 Intel Corporation
|
||||
* Copyright (c) 2018 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@ -59,6 +60,7 @@ struct usb_hid_descriptor {
|
|||
typedef int (*hid_cb_t)(struct usb_setup_packet *setup, s32_t *len,
|
||||
u8_t **data);
|
||||
typedef void (*hid_int_ready_callback)(void);
|
||||
typedef void (*hid_idle_cb_t)(u16_t report_id);
|
||||
|
||||
struct hid_ops {
|
||||
hid_cb_t get_report;
|
||||
|
@ -67,6 +69,7 @@ struct hid_ops {
|
|||
hid_cb_t set_report;
|
||||
hid_cb_t set_idle;
|
||||
hid_cb_t set_protocol;
|
||||
hid_idle_cb_t on_idle;
|
||||
/*
|
||||
* int_in_ready is an optional callback that is called when
|
||||
* the current interrupt IN transfer has completed. This can
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* Copyright(c) 2015,2016 Intel Corporation.
|
||||
* Copyright(c) 2017 PHYTEC Messtechnik GmbH
|
||||
* Copyright(c) 2018 Nordic Semiconductor ASA
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -86,6 +87,9 @@
|
|||
#define MAX_LOW_POWER 0x32
|
||||
#define MAX_HIGH_POWER 0xFA
|
||||
|
||||
/* Highest value of Frame Number in SOF packets. */
|
||||
#define USB_SOF_MAX 2047
|
||||
|
||||
/* bmAttributes:
|
||||
* D7:Reserved, always 1,
|
||||
* D6:Self-Powered -> 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue