USB Host Core Example Applications#

This section describes the examples that are related to the core component of Micrium OS USB Host.

USB Host Module Simple Initialization Example#

This is a generic example for the USB host module. It accomplishes the following tasks:

  • Initialize the USB host core module with one host

  • Initialize the PBHCI module, if it is part of your project

  • Add one USB host controller

  • Initialize all the available class application example(s)

  • Start the USB host controller

This example is mandatory if you add any class application examples.

By default, this example will assume the presence of a USB controller named "usb1" and will attempt to add it. If this device is not present on your platform or you prefer to use another one, modify the define EX_USBH_CTRLR_NAME accordingly.

Location#

The example implementation is located in /examples/usb/host/ex_usbh.c and /examples/usb/host/ex_usbh.h.

API#

This application offers two API named Ex_USBH_Init() and Ex_USBH_Start(). The function Ex_USBH_Init() must be called first from your application. Once your application is ready to accept device connections, you can call the function Ex_USBH_Start().

Simple Device Port Operation Example#

Description#

This is a simple example application that shows you how to perform basic operations on USB devices such as suspend, resume, and reset.

Location#

The example implementation is located in /examples/usb/host/ex_usbh_dev_port_oper.c and /examples/usb/host/ex_usbh_dev_port_oper.h.

API#

This application offers three API named Ex_USBH_DevSuspendExec() and Ex_USBH_DevResumeExec() and Ex_USBH_DevResetExec(). These functions can be called at any time after a device has been connected.