usbd_hid.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * @file usbd_hid.h
  3. * @brief
  4. *
  5. * Copyright (c) 2022 sakumisu
  6. *
  7. * Licensed to the Apache Software Foundation (ASF) under one or more
  8. * contributor license agreements. See the NOTICE file distributed with
  9. * this work for additional information regarding copyright ownership. The
  10. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  11. * "License"); you may not use this file except in compliance with the
  12. * License. You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  19. * License for the specific language governing permissions and limitations
  20. * under the License.
  21. *
  22. */
  23. #ifndef _USBD_HID_H_
  24. #define _USBD_HID_H_
  25. #include "usb_hid.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. void usbd_hid_descriptor_register(uint8_t intf_num, const uint8_t *desc);
  30. void usbd_hid_report_descriptor_register(uint8_t intf_num, const uint8_t *desc, uint32_t desc_len);
  31. void usbd_hid_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
  32. uint8_t usbh_hid_get_report(uint8_t intf, uint8_t report_id, uint8_t report_type);
  33. uint8_t usbh_hid_get_idle(uint8_t intf, uint8_t report_id);
  34. uint8_t usbh_hid_get_protocol(uint8_t intf);
  35. void usbh_hid_set_report(uint8_t intf, uint8_t report_id, uint8_t report_type, uint8_t *report, uint8_t report_len);
  36. void usbh_hid_set_idle(uint8_t intf, uint8_t report_id, uint8_t duration);
  37. void usbh_hid_set_protocol(uint8_t intf, uint8_t protocol);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif /* _USBD_HID_H_ */