You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.5 KiB

  1. /* Copyright 2021 QMK
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include <stdbool.h>
  18. #ifndef USB2422_ADDRESS
  19. # define USB2422_ADDRESS 0x58
  20. #endif
  21. #ifndef USB2422_VENDOR_ID
  22. # define USB2422_VENDOR_ID 0xFEED
  23. #endif
  24. #ifndef USB2422_PRODUCT_ID
  25. # define USB2422_PRODUCT_ID 0x0001
  26. #endif
  27. #ifndef USB2422_DEVICE_VER
  28. # define USB2422_DEVICE_VER 0x0001
  29. #endif
  30. #ifndef USB2422_MANUFACTURER
  31. # define USB2422_MANUFACTURER "QMK"
  32. #endif
  33. #ifndef USB2422_PRODUCT
  34. # define USB2422_PRODUCT "QMK Hub"
  35. #endif
  36. /** \brief Initialises the dependent subsystems */
  37. void USB2422_init(void);
  38. /** \brief Push configuration to the USB2422 device */
  39. void USB2422_configure(void);
  40. /** \brief Reset the chip (RESET_N)
  41. *
  42. * NOTE:
  43. * Depends on a valid USB2422_RESET_PIN configuration
  44. */
  45. void USB2422_reset(void);
  46. /** \brief Indicates the USB state of the hub (SUSP_IND)
  47. *
  48. * NOTE:
  49. * Depends on a valid USB2422_ACTIVE_PIN configuration
  50. */
  51. bool USB2422_active(void);