8 Star 62 Fork 36

lhdjply / f1c200s_library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
usbh_msc_config.c 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
#include "usbh_msc_config.h"
volatile bool mounted_flag;
USB_NOCACHE_RAM_SECTION struct usbh_msc * active_msc_class;
extern void USBH_IRQHandler(uint8_t busid);
static void My_USBH_IRQHandler(int irqno, void * param)
{
rt_interrupt_enter();
USBH_IRQHandler(0);
rt_interrupt_leave();
}
void usb_hc_low_level_init(struct usbh_bus * bus)
{
usb_phy_open_clock();
USBC_PhyConfig();
USBC_ConfigFIFO_Base();
USBC_EnableDpDmPullUp();
USBC_EnableIdPullUp();
USBC_ForceId(USBC_ID_TYPE_HOST);
USBC_ForceVbusValid(USBC_VBUS_TYPE_HIGH);
rt_hw_interrupt_install(USB_OTG_INTERRUPT, (rt_isr_handler_t)My_USBH_IRQHandler, NULL, "musb_irq");
rt_hw_interrupt_umask(USB_OTG_INTERRUPT);
}
void usb_disk_set_active_msc_class(void * ptr)
{
active_msc_class = (struct usbh_msc *)ptr;
}
void usbh_msc_run(struct usbh_msc * msc_class)
{
if(msc_class != NULL)
{
usb_disk_set_active_msc_class((void *)msc_class);
mounted_flag = true;
}
}
void usbh_msc_stop(struct usbh_msc * msc_class)
{
mounted_flag = false;
}
C
1
https://gitee.com/lhdjply/f1c200s_library.git
git@gitee.com:lhdjply/f1c200s_library.git
lhdjply
f1c200s_library
f1c200s_library
master

搜索帮助