Atmel Software Framework

common/services/usb/uhc/unit_tests/target/unit_tests.h File Reference

Declaration of main function.

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

#include "uhc.h"

Functions

void main_usb_connection_event (uhc_device_t *dev, bool b_present)
 Notify that a USB device has been connected or disconnected. More...
 
void main_usb_enum_event (uhc_device_t *dev, uhc_enum_status_t status)
 Notify the end of a USB device enumeration. More...
 
void main_usb_mode_change (bool b_host_mode)
 Notify that the USB mode was automatically switched. This is possible only when ID pin is available. More...
 
void main_usb_sof_event (void)
 Notify that a SOF has been sent (each 1 ms) More...
 
void main_usb_vbus_change (bool b_vbus_present)
 Notify that a Vbus transition has occurred Available only in USB hardware with Vbus monitoring. More...
 
void main_usb_vbus_error (void)
 Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring. More...
 
void main_usb_wakeup_event (void)
 Notify that a USB device or the host has wake up the USB line. More...
 

void main_usb_connection_event ( uhc_device_t dev,
bool  b_present 
)

Notify that a USB device has been connected or disconnected.

Parameters
devPointer on USB device information
b_presenttrue, if the device has been connected
void main_usb_enum_event ( uhc_device_t dev,
uhc_enum_status_t  status 
)

Notify the end of a USB device enumeration.

Parameters
devPointer on USB device information
statusStatus of the USB enumeration

Device is bus enumerated with at least one supported interface

All interfaces are not supported by UHIs

Device power can not be supported

A problem has been occurred during USB enumeration

USB hardware can not support it. Not enough free pipes.

References MAIN_EVENT_ENUM_FAIL, MAIN_EVENT_ENUM_HARDWARE_LIMIT, MAIN_EVENT_ENUM_OVERCURRENT, MAIN_EVENT_ENUM_SUCCESS_FULL_SPEEP, MAIN_EVENT_ENUM_SUCCESS_HIGH_SPEEP, MAIN_EVENT_ENUM_SUCCESS_LOW_SPEEP, MAIN_EVENT_ENUM_UNKNOW, MAIN_EVENT_ENUM_UNSUPPORTED, main_events, uhc_device_t::speed, UHC_ENUM_FAIL, UHC_ENUM_HARDWARE_LIMIT, UHC_ENUM_OVERCURRENT, UHC_ENUM_SUCCESS, UHC_ENUM_UNSUPPORTED, UHD_SPEED_FULL, UHD_SPEED_HIGH, and UHD_SPEED_LOW.

void main_usb_mode_change ( bool  b_host_mode)

Notify that the USB mode was automatically switched. This is possible only when ID pin is available.

Parameters
b_host_modetrue, if the host mode has been selected

References MAIN_EVENT_DEVICE_MODE, MAIN_EVENT_HOST_MODE, and main_events.

void main_usb_sof_event ( void  )

Notify that a SOF has been sent (each 1 ms)

void main_usb_vbus_change ( bool  b_vbus_present)

Notify that a Vbus transition has occurred Available only in USB hardware with Vbus monitoring.

Parameters
b_vbus_presenttrue, if Vbus is high.

References MAIN_EVENT_VBUS_NOT_PRESENT, MAIN_EVENT_VBUS_PRESENT, and main_events.

void main_usb_vbus_error ( void  )

Notify that a Vbus error has occurred Available only in USB hardware with Vbus monitoring.

void main_usb_wakeup_event ( void  )

Notify that a USB device or the host has wake up the USB line.

References MAIN_EVENT_WAKEUP, and main_events.