cherryusb.c 821 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-01-17 Supperthomas first version
  9. */
  10. #include "board.h"
  11. #include "rtthread.h"
  12. #include "drv_config.h"
  13. #ifdef RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM
  14. /* Register the EMAC device */
  15. static int rt_hw_stm32_cherryusb_cdc_init(void)
  16. {
  17. extern void cdc_acm_init(uint8_t busid, uintptr_t reg_base);
  18. cdc_acm_init(0, USB_OTG_FS_PERIPH_BASE);
  19. return 0;
  20. }
  21. INIT_COMPONENT_EXPORT(rt_hw_stm32_cherryusb_cdc_init);
  22. static int cherry_usb_cdc_send(int argc, char **argv)
  23. {
  24. extern void cdc_acm_data_send_with_dtr_test(uint8_t busid);
  25. cdc_acm_data_send_with_dtr_test(0);
  26. return 0;
  27. }
  28. MSH_CMD_EXPORT(cherry_usb_cdc_send, send the cdc data for test)
  29. #endif