test_hci.c 743 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <stdio.h>
  2. #include <platform_usb.h>
  3. #include <hal_log.h>
  4. #include <hal_cmd.h>
  5. #include <usb/hal_hci.h>
  6. static int cmd_test_hci(int argc, const char **argv)
  7. {
  8. hal_usb_core_init();
  9. for (int hci_num = 0; hci_num < USB_MAX_CONTROLLER_COUNT; hci_num++)
  10. {
  11. /*usb0 need hcd neet to choose */
  12. hal_usb_hcd_init(hci_num);
  13. }
  14. return 0;
  15. }
  16. FINSH_FUNCTION_EXPORT_CMD(cmd_test_hci, hal_hci, hci hal APIs tests)
  17. static int cmd_test_hci_rm(int argc, const char **argv)
  18. {
  19. for (int hci_num = 0; hci_num < USB_MAX_CONTROLLER_COUNT; hci_num++)
  20. {
  21. hal_usb_hcd_deinit(hci_num);
  22. }
  23. hal_usb_core_exit();
  24. return 0;
  25. }
  26. FINSH_FUNCTION_EXPORT_CMD(cmd_test_hci_rm, hal_hci_rm, hci hal APIs tests)