Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
USB Host Core API

USB HOST Core Layer API. More...

Data Structures

struct  usbh_contex
 USB host support runtime context. More...
 
struct  usbh_code_triple
 USB Class Code triple. More...
 
struct  usbh_class_data
 USB host class data and class instance API. More...
 

Macros

#define USBH_CONTROLLER_DEFINE(device_name, uhc_dev)
 
#define USBH_DEFINE_CLASS(name)    static STRUCT_SECTION_ITERABLE(usbh_class_data, name)
 

Functions

int usbh_init (struct usbh_contex *uhs_ctx)
 Initialize the USB host support;.
 
int usbh_enable (struct usbh_contex *uhs_ctx)
 Enable the USB host support and class instances.
 
int usbh_disable (struct usbh_contex *uhs_ctx)
 Disable the USB host support.
 
int usbh_shutdown (struct usbh_contex *const uhs_ctx)
 Shutdown the USB host support.
 

Detailed Description

USB HOST Core Layer API.

Macro Definition Documentation

◆ USBH_CONTROLLER_DEFINE

#define USBH_CONTROLLER_DEFINE (   device_name,
  uhc_dev 
)

#include <zephyr/usb/usbh.h>

Value:
static STRUCT_SECTION_ITERABLE(usbh_contex, device_name) = { \
.name = STRINGIFY(device_name), \
.mutex = Z_MUTEX_INITIALIZER(device_name.mutex), \
.dev = uhc_dev, \
}
#define STRINGIFY(s)
Definition: common.h:134
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition: iterable_sections.h:216
USB host support runtime context.
Definition: usbh.h:38

◆ USBH_DEFINE_CLASS

#define USBH_DEFINE_CLASS (   name)     static STRUCT_SECTION_ITERABLE(usbh_class_data, name)

#include <zephyr/usb/usbh.h>

Function Documentation

◆ usbh_disable()

int usbh_disable ( struct usbh_contex uhs_ctx)

#include <zephyr/usb/usbh.h>

Disable the USB host support.

This function disables the USB host support.

Parameters
[in]uhs_ctxPointer to USB host support context
Returns
0 on success, other values on fail.

◆ usbh_enable()

int usbh_enable ( struct usbh_contex uhs_ctx)

#include <zephyr/usb/usbh.h>

Enable the USB host support and class instances.

This function enables the USB host support.

Parameters
[in]uhs_ctxPointer to USB host support context
Returns
0 on success, other values on fail.

◆ usbh_init()

int usbh_init ( struct usbh_contex uhs_ctx)

#include <zephyr/usb/usbh.h>

Initialize the USB host support;.

Parameters
[in]uhs_ctxPointer to USB host support context
Returns
0 on success, other values on fail.

◆ usbh_shutdown()

int usbh_shutdown ( struct usbh_contex *const  uhs_ctx)

#include <zephyr/usb/usbh.h>

Shutdown the USB host support.

This function completely disables the USB host support.

Parameters
[in]uhs_ctxPointer to USB host support context
Returns
0 on success, other values on fail.