18#ifndef __VSF_USBH_HID_H__
19#define __VSF_USBH_HID_H__
24#if VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_HID == ENABLED
28#if defined(__VSF_USBH_HID_CLASS_IMPLEMENT)
29# define __VSF_CLASS_IMPLEMENT__
30#elif defined(__VSF_USBH_HID_CLASS_INHERIT__)
31# define __VSF_CLASS_INHERIT__
43#define vk_usbh_hid_send_report1(__hid, __buffer, __size, __complete) \
44 __vk_usbh_hid_send_report_imp( \
45 (vk_usbh_hid_teda_t *)(__hid), (__buffer), (__size), (__complete))
46#define vk_usbh_hid_send_report0(__hid, __buffer, __size) \
47 __vk_usbh_hid_send_report_imp( \
48 (vk_usbh_hid_teda_t *)(__hid), (__buffer), (__size), NULL)
50#define vk_usbh_hid_send_report(__hid, __buffer, __size, ...) \
51 __PLOOC_EVAL(vk_usbh_hid_send_report, __VA_ARGS__)((__hid), (__buffer), (__size), ##__VA_ARGS__)
53#define vk_usbh_hid_recv_report1(__hid, __buffer, __size, __complete) \
54 __vk_usbh_hid_recv_report_imp( \
55 (vk_usbh_hid_teda_t *)(__hid), (__buffer), (__size), (__complete))
56#define vk_usbh_hid_recv_report0(__hid, __buffer, __size) \
57 vk_usbh_hid_recv_report1( \
58 (vk_usbh_hid_teda_t *)(__hid), (__buffer), (__size), NULL)
60#define vk_usbh_hid_recv_report(__hid, __buffer, __size, ...) \
61 __PLOOC_EVAL(vk_usbh_hid_recv_report, __VA_ARGS__)((__hid), (__buffer), (__size), ##__VA_ARGS__)
63#define vk_usbh_hid_get_rx_report(__hid) \
64 __vk_usbh_hid_get_rx_report_imp((vk_usbh_hid_teda_t *)(__hid))
65#define vk_usbh_hid_get_tx_report(__hid) \
66 __vk_usbh_hid_get_tx_report_imp((vk_usbh_hid_teda_t *)(__hid))
68#define vk_usbh_hid_set_idle(__hid, __id, __duration) \
69 __vk_usbh_hid_set_idle_imp( \
70 (vk_usbh_hid_base_t *)(__hid), (__id), (__duration))
72#define vk_usbh_hid_send_report_req(__hid, __type_id, __report, __report_len) \
73 __vk_usbh_hid_send_report_req_imp( \
74 (vk_usbh_hid_base_t *)(__hid), (__type_id), (__report), (__report_len))
76#define vk_usbh_hid_recv_report_req(__hid, __type_id, __report, __report_len) \
77 __vk_usbh_hid_recv_report_req_imp( \
78 (vk_usbh_hid_base_t *)(__hid), (__type_id), (__report), (__report_len))
121#ifdef __VSF_USBH_HID_CLASS_INHERIT__
143#undef __VSF_USBH_HID_CLASS_IMPLEMENT
144#undef __VSF_USBH_HID_CLASS_INHERIT__
vsf_err_t
Definition __type.h:42
Definition vsf_usbh.h:268
Definition vsf_usbh.h:478
Definition vsf_usbh_HID.h:82
Definition vsf_usbh_HID.h:105
Definition vsf_usbh.h:523
Definition vsf_usbh.h:450
__le16 duration
Definition ieee80211.h:1
unsigned short uint16_t
Definition lvgl.h:41
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned int uint_fast32_t
Definition stdint.h:27
int int_fast32_t
Definition stdint.h:26
unsigned short uint_fast16_t
Definition stdint.h:25
Definition vsf_usbh.h:473
Definition vsf_usbh.h:228
Definition vsf_usbh.h:179
void(* vsf_eda_evthandler_t)(vsf_eda_t *eda, vsf_evt_t evt)
Definition vsf_eda.h:656
uint32_t size
Definition vsf_memfs.h:50
void(* vsf_usbh_urb_complete_t)(void *param, vk_usbh_hcd_urb_t *)
Definition vsf_usbh.h:395
vsf_err_t __vk_usbh_hid_recv_report_req_imp(vk_usbh_hid_base_t *hid, uint_fast16_t type_id, uint8_t *report, uint_fast16_t report_len)
Definition vsf_usbh_HID.c:243
void * vk_usbh_hid_probe(vk_usbh_t *usbh, vk_usbh_dev_t *dev, vk_usbh_ifs_parser_t *parser_ifs, uint_fast32_t obj_size, bool has_hid_desc)
Definition vsf_usbh_HID.c:132
vsf_err_t __vk_usbh_hid_send_report_req_imp(vk_usbh_hid_base_t *hid, uint_fast16_t type_id, uint8_t *report, uint_fast16_t report_len)
Definition vsf_usbh_HID.c:227
uint8_t * __vk_usbh_hid_get_rx_report_imp(vk_usbh_hid_teda_t *hid)
Definition vsf_usbh_HID.c:278
vsf_err_t __vk_usbh_hid_set_idle_imp(vk_usbh_hid_base_t *hid, uint_fast8_t id, uint_fast8_t duration)
Definition vsf_usbh_HID.c:261
uint8_t * __vk_usbh_hid_get_tx_report_imp(vk_usbh_hid_teda_t *hid)
Definition vsf_usbh_HID.c:273
void vk_usbh_hid_disconnect(vk_usbh_hid_teda_t *hid)
Definition vsf_usbh_HID.c:196
vsf_err_t __vk_usbh_hid_recv_report_imp(vk_usbh_hid_teda_t *hid, uint8_t *buffer, int_fast32_t size, vsf_usbh_urb_complete_t complete)
Definition vsf_usbh_HID.c:288
const vk_usbh_class_drv_t vk_usbh_hid_drv
Definition vsf_usbh_HID.c:83
vsf_err_t __vk_usbh_hid_send_report_imp(vk_usbh_hid_teda_t *hid, uint8_t *buffer, int_fast32_t size, vsf_usbh_urb_complete_t complete)
Definition vsf_usbh_HID.c:283