Microchip® Advanced Software Framework

common/services/usb/class/vendor/device/example/main.h File Reference

Declaration of main function used by example.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

Functions

void main_resume_action (void)
 Turn on a led to notify active mode Called when the USB line is resumed from the suspend state. More...
 
bool main_setup_in_received (void)
 Manage the reception of setup request IN. More...
 
bool main_setup_out_received (void)
 Manage the reception of setup request OUT. More...
 
void main_sof_action (void)
 Manages the leds behaviors Called when a start of frame is received on USB line each 1ms. More...
 
void main_suspend_action (void)
 Enters the application in low power mode Callback called when USB host sets USB line in suspend state. More...
 
void main_vendor_disable (void)
 Notify via user interface that enumeration is disabled This is called by vendor interface when USB Host disable it. More...
 
bool main_vendor_enable (void)
 Notify via user interface that enumeration is ok This is called by vendor interface when USB Host enable it. More...
 

void main_resume_action ( void  )

Turn on a led to notify active mode Called when the USB line is resumed from the suspend state.

Turn on a led to notify active mode Called when the USB line is resumed from the suspend state.

bool main_setup_in_received ( void  )

Manage the reception of setup request IN.

Return values
trueif request accepted

References main_buf_loopback, min, udd_ctrl_request_t::payload, udd_ctrl_request_t::payload_size, udd_ctrl_request_t::req, udd_g_ctrlreq, ui_loop_back_state(), and usb_setup_req_t::wLength.

bool main_setup_out_received ( void  )

Manage the reception of setup request OUT.

Return values
trueif request accepted

References main_buf_loopback, min, udd_ctrl_request_t::payload, udd_ctrl_request_t::payload_size, udd_ctrl_request_t::req, udd_g_ctrlreq, ui_loop_back_state(), and usb_setup_req_t::wLength.

void main_sof_action ( void  )

Manages the leds behaviors Called when a start of frame is received on USB line each 1ms.

Manages the leds behaviors Called when a start of frame is received on USB line each 1ms.

void main_suspend_action ( void  )

Enters the application in low power mode Callback called when USB host sets USB line in suspend state.

void main_vendor_disable ( void  )

Notify via user interface that enumeration is disabled This is called by vendor interface when USB Host disable it.

References main_b_vendor_enable.

bool main_vendor_enable ( void  )

Notify via user interface that enumeration is ok This is called by vendor interface when USB Host enable it.

Return values
trueif vendor startup is successfully done

References main_b_vendor_enable, main_buf_iso_sel, main_vendor_bulk_in_received(), main_vendor_int_in_received(), main_vendor_iso_out_received(), and UDD_EP_TRANSFER_OK.