Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single port migrate to multi port Guide #166

Closed
sakumisu opened this issue Jan 22, 2024 · 0 comments
Closed

Single port migrate to multi port Guide #166

sakumisu opened this issue Jan 22, 2024 · 0 comments

Comments

@sakumisu
Copy link
Collaborator

sakumisu commented Jan 22, 2024

Device

  • add CONFIG_USBDEV_MAX_BUS macro, and only hpm can be 2, others should be 1.
#define CONFIG_USBDEV_MAX_BUS 1
  • every api add uint8_t busid, and no use if CONFIG_USBDEV_MAX_BUS=1

  • USBD_BASE macro remove, use usbd_initialize instead.

usbd_initialize(0, USBD_BASE, usbd_event_handler)
  • USBD_IRQHandler macro remove, call USBD_IRQHandler(xxx) in your actual irq name, for example
void USBD_IRQ(void)
{
    extern void USBD_IRQHandler(uint8_t busid);
    USBD_IRQHandler(0);
}

Host

  • add CONFIG_USBHOST_MAX_BUS macro
#define CONFIG_USBHOST_MAX_BUS 1
  • USBH_BASE macro remove, use usbh_initialize instead.
usbh_initialize(0, USBH_BASE)
  • USBH_IRQHandler macro remove, call USBH_IRQHandler(xxx) in your actual irq name, for example
void USBH_IRQ(void)
{
    extern void USBH_IRQHandler(uint8_t busid);
    USBH_IRQHandler(0);
}
@sakumisu sakumisu changed the title Single port to multi port Guide Single port migrate to multi port Guide Jan 22, 2024
@sakumisu sakumisu pinned this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant