esp_hidd_private.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #pragma once
  14. #include "esp_err.h"
  15. #include "esp_hidd.h"
  16. #include "esp_hid_common.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct esp_hidd_dev_s {
  21. void *dev;
  22. esp_hid_transport_t transport;
  23. bool (*connected) (void *dev);
  24. esp_err_t (*deinit) (void *dev);
  25. esp_err_t (*battery_set) (void *dev, uint8_t level);
  26. esp_err_t (*input_set) (void *dev, size_t map_index, size_t report_id, uint8_t *data, size_t length);
  27. esp_err_t (*feature_set) (void *dev, size_t map_index, size_t report_id, uint8_t *data, size_t length);
  28. esp_err_t (*event_handler_register) (void *dev, esp_event_handler_t callback, esp_hidd_event_t event);
  29. esp_err_t (*event_handler_unregister) (void *dev, esp_event_handler_t callback, esp_hidd_event_t event);
  30. };
  31. typedef struct esp_hidd_dev_s esp_hidd_dev_t;
  32. #ifdef __cplusplus
  33. }
  34. #endif