logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

usb_main.h (1430B)


  1. // Copyright 2023 Stefan Kerkmann (@KarlK90)
  2. // Copyright 2020 Ryan (@fauxpark)
  3. // Copyright 2020 Joel Challis (@zvecr)
  4. // Copyright 2018 James Laird-Wah
  5. // Copyright 2016 Fredizzimo
  6. // Copyright 2016 Giovanni Di Sirio
  7. // SPDX-License-Identifier: GPL-3.0-or-later OR Apache-2.0
  8. #pragma once
  9. #include <ch.h>
  10. #include <hal.h>
  11. #include "usb_device_state.h"
  12. #include "usb_descriptor.h"
  13. #include "usb_driver.h"
  14. #include "usb_endpoints.h"
  15. /* -------------------------
  16. * General USB driver header
  17. * -------------------------
  18. */
  19. /* The USB driver to use */
  20. #ifndef USB_DRIVER
  21. # define USB_DRIVER USBD1
  22. #endif // USB_DRIVER
  23. /* Initialize the USB driver and bus */
  24. void init_usb_driver(USBDriver *usbp);
  25. /* Restart the USB driver and bus */
  26. void restart_usb_driver(USBDriver *usbp);
  27. bool send_report(usb_endpoint_in_lut_t endpoint, void *report, size_t size);
  28. /* ---------------
  29. * USB Event queue
  30. * ---------------
  31. */
  32. /* Initialisation of the FIFO */
  33. void usb_event_queue_init(void);
  34. /* Task to dequeue and execute any handlers for the USB events on the main thread */
  35. void usb_event_queue_task(void);
  36. /* --------------
  37. * Console header
  38. * --------------
  39. */
  40. #ifdef CONSOLE_ENABLE
  41. /* Putchar over the USB console */
  42. int8_t sendchar(uint8_t c);
  43. #endif /* CONSOLE_ENABLE */
  44. /* --------------
  45. * Virtser header
  46. * --------------
  47. */
  48. #if defined(VIRTSER_ENABLE)
  49. bool virtser_usb_request_cb(USBDriver *usbp);
  50. #endif