You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
734 B

2 years ago
/*
* usb_host.c
*
* Created on: 23 окт. 2021 г.
* Author: ivan
*/
#include "drv_usb_hw.h"
#include "drv_usb_core.h"
#include "usbh_usr.h"
#include "usbh_msc_core.h"
#include "gd32vf103v_eval.h"
#include "downstream_statemachine.h"
usb_core_driver usbh_msc_core;
usbh_host usb_host = {
.class_cb = &usbh_msc_cb,
.usr_cb = &user_callback_funs,
.pUser=&Downstream_HostUserCallback
};
usbh_host hUsbHostFS;
void USB_Host_Init(void){
usb_rcu_config();
usb_timer_init();
usbh_init(&usbh_msc_core, USB_CORE_ENUM_FS, &usb_host);
usb_intr_config();
}
void USB_Host_Process(void){
usbh_core_task (&usbh_msc_core, &usb_host);
}
void USB_Host_Disconnect(void){
usbh_deinit(&usbh_msc_core, &usb_host);
}