SAMV71 Xplained Ultra Software Package 1.3

USBH.c File Reference

USB Host Controller (UHC). More...

#include "conf_usb_host.h"
#include "USBHDriver.h"
#include "uhi.h"
#include "USBH.h"
#include <stdlib.h>

Go to the source code of this file.

Defines

#define UHC_CONNECTION_EVENT(dev, b_present)
#define UHC_DEVICE_CONF(dev)   1
#define UHC_ENUM_EVENT(dev, event)
#define UHC_WAKEUP_EVENT()

Functions

Internal functions to manage the USB device enumeration

Callbacks used by USB Host Driver (UHD) to notify events

void USBH_notify_connection (bool b_plug)
 Notify device connection or disconnection.
void USBH_notify_sof (bool b_micro)
 Notify each start of frame sent by driver.
void USBH_notify_resume (void)
 Notify that a resume bus occurs A resume can occur after a downstream or an upstream resume.
Functions to control the USB host stack

void USBH_start (void)
 Starts the host mode.
void USBH_stop (bool b_id_stop)
 Stops the host mode.
void USBH_suspend (bool b_remotewakeup)
 Suspends a USB line.
bool USBH_is_suspend (void)
 Test if the suspend state is enabled on the USB line.
void USBH_resume (void)
 Resumes the USB line.
User functions to manage the devices

uint8_t USBH_get_device_number (void)
 Returns the number of connected devices.
char * USBH_dev_get_string_manufacturer (USBH_device_t *dev)
 Gets the USB string manufacturer from a USB device.
char * USBH_dev_get_string_product (USBH_device_t *dev)
 Gets the USB string product from a USB device.
char * USBH_dev_get_string_serial (USBH_device_t *dev)
 Gets the USB string serial from a USB device.
char * USBH_dev_get_string (USBH_device_t *dev, uint8_t str_id)
 Gets a USB string from a USB device.
uint16_t USBH_dev_get_power (USBH_device_t *dev)
 Gets the maximum consumption of a device (mA).
USBH_Speed_t USBH_dev_get_speed (USBH_device_t *dev)
 Returns the current device speed.
bool USBH_dev_is_high_speed_support (USBH_device_t *dev)
 Tests if the device supports the USB high speed This function can wait the end of a setup request and the timing can be long (1ms to 5s). Thus, do not call it in an interrupt routine.

Internal variables to manage the USB host stack



#define UHC_ENUM_NB_TRY   4
 Maximum try to enumerate a device.
#define UHC_USB_ADD_NOT_VALID   0xFF
 Entry point of all devices connected on USB tree.
#define UHC_DEVICE_ENUM_ADD   1
 USB address of the USB device under enumeration process.
#define USBH_dev_enum   (&USBH_device_root)
 Device under enumeration process.
#define USBH_power_running   0
 Total power of the devices connected.
#define UHC_NB_UHI   (sizeof(USBH_uhis)/sizeof(USBH_uhis[0]))
 Number of UHI available.
typedef void(* USBH_sof_timeout_callback_t )(void)
 Type of callback on a SOF timeout.
uint8_t USBH_sof_timeout
 Number of SOF remaining before call USBH_sof_timeout_callback callback.

Detailed Description

USB Host Controller (UHC).

Copyright (C) 2011-2015 Atmel Corporation. All rights reserved.

Definition in file USBH.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines