2021-08-15 11:45:46 索煒達電子 809
STM32的USB庫文件,包括STM32_USB-FS-Device_Lib_V3.3.0原始庫、修改過的HID、SDT、COM功能庫;STM32_USB-Host-Device_Lib_V2.2.0原始庫、修改過的HID、SDT、COM功能庫。
使用舉例:
1、usb_io.c
//修改以下宏定義,用于USB上拉 #define USB_DISCONNECT GPIOC #define USB_DISCONNECT_PIN GPIO_Pin_3 #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOC
2、stm32f10x_it.c
#include "usb_io.h" void OTG_FS_IRQHandler() { USB_IO_Int(); } 或 void USB_LP_CAN1_RX0_IRQHandler() { USB_IO_Int(); }
3、main.c
#include "usb_io.h" void main() { ... USB_IO_Init(); ... while(1) { if(USB_RecvDataLen>0) { USB_IO_SendData(USB_RecvData,USB_RecvDataLen); USB_RecvDataLen=0; } } }
文件列表:
目錄│文件列表:
└ STM32-usb
├ f103dev
│ │ README.md
│ ├ ccid
│ │ │ ccid_cmd.c
│ │ │ ccid_cmd.h
│ │ │ ccid_core.c
│ │ │ ccid_core.h
│ │ │ README.md
│ │ │ usb_conf.h
│ │ │ usb_core.c
│ │ │ usb_core.h
│ │ │ usb_def.h
│ │ │ usb_desc.c
│ │ │ usb_desc.h
│ │ │ usb_endp.c
│ │ │ usb_init.c
│ │ │ usb_init.h
│ │ │ usb_int.c
│ │ │ usb_int.h
│ │ │ usb_io.c
│ │ │ usb_io.h
│ │ │ usb_istr.c
│ │ │ usb_istr.h
│ │ │ usb_lib.h
│ │ │ usb_mem.c
│ │ │ usb_mem.h
│ │ │ usb_prop.c
│ │ │ usb_prop.h
│ │ │ usb_pwr.c
│ │ │ usb_pwr.h
│ │ │ usb_regs.c
│ │ │ usb_regs.h
│ │ │ usb_sil.c
│ │ │ usb_sil.h
│ │ └ usb_type.h
│ ├ hid
│ │ │ README.md
│ │ │ usb_conf.h
│ │ │ usb_core.c
│ │ │ usb_core.h
│ │ │ usb_def.h
│ │ │ usb_desc.c
│ │ │ usb_desc.h
│ │ │ usb_endp.c
│ │ │ usb_init.c
│ │ │ usb_init.h
│ │ │ usb_int.c
│ │ │ usb_int.h
│ │ │ usb_io.c
│ │ │ usb_io.h
│ │ │ usb_istr.c
│ │ │ usb_istr.h
│ │ │ usb_lib.h
│ │ │ usb_mem.c
│ │ │ usb_mem.h
│ │ │ usb_prop.c
│ │ │ usb_prop.h
│ │ │ usb_pwr.c
│ │ │ usb_pwr.h
│ │ │ usb_regs.c
│ │ │ usb_regs.h
│ │ │ usb_sil.c
│ │ │ usb_sil.h
│ │ └ usb_type.h
│ ├ sdt
│ │ │ README.md
│ │ │ usb_conf.h
│ │ │ usb_core.c
│ │ │ usb_core.h
│ │ │ usb_def.h
│ │ │ usb_desc.c
│ │ │ usb_desc.h
│ │ │ usb_endp.c
│ │ │ usb_init.c
│ │ │ usb_init.h
│ │ │ usb_int.c
│ │ │ usb_int.h
│ │ │ usb_io.c
│ │ │ usb_io.h
│ │ │ usb_istr.c
│ │ │ usb_istr.h
│ │ │ usb_lib.h
│ │ │ usb_mem.c
│ │ │ usb_mem.h
│ │ │ usb_prop.c
│ │ │ usb_prop.h
│ │ │ usb_pwr.c
│ │ │ usb_pwr.h
│ │ │ usb_regs.c
│ │ │ usb_regs.h
│ │ │ usb_sil.c
│ │ │ usb_sil.h
│ │ └ usb_type.h
│ ├ std
│ │ └ README.md
│ └ vcom
│ │ README.md
│ │ usb_conf.h
│ │ usb_core.c
│ │ usb_core.h
│ │ usb_def.h
│ │ usb_desc.c
│ │ usb_desc.h
│ │ usb_endp.c
│ │ usb_init.c
│ │ usb_init.h
│ │ usb_int.c
│ │ usb_int.h
│ │ usb_io.c
│ │ usb_io.h
│ │ usb_istr.c
│ │ usb_istr.h
│ │ usb_lib.h
│ │ usb_mem.c
│ │ usb_mem.h
│ │ usb_prop.c
│ │ usb_prop.h
│ │ usb_pwr.c
│ │ usb_pwr.h
│ │ usb_regs.c
│ │ usb_regs.h
│ │ usb_sil.c
│ │ usb_sil.h
│ └ usb_type.h
└ f105dev
│ README.md
├ ccid
│ │ bsp_config.h
│ │ ccid_cmd.c
│ │ ccid_cmd.h
│ │ ccid_core.c
│ │ ccid_core.h
│ │ README.md
│ │ usbd_conf.h
│ │ usbd_core.c
│ │ usbd_core.h
│ │ usbd_customhid_core.c
│ │ usbd_customhid_core.h
│ │ usbd_def.h
│ │ usbd_desc.c
│ │ usbd_desc.h
│ │ usbd_ioreq.c
│ │ usbd_ioreq.h
│ │ usbd_req.c
│ │ usbd_req.h
│ │ usbd_usr.c
│ │ usbd_usr.h
│ │ usb_bsp.c
│ │ usb_bsp.h
│ │ usb_conf.h
│ │ usb_core.c
│ │ usb_core.h
│ │ usb_dcd.c
│ │ usb_dcd.h
│ │ usb_dcd_int.c
│ │ usb_dcd_int.h
│ │ usb_defines.h
│ │ usb_hcd_int.h
│ │ usb_io.c
│ │ usb_io.h
│ └ usb_regs.h
├ hid
│ │ bsp_config.h
│ │ README
│ │ usbd_conf.h
│ │ usbd_core.c
│ │ usbd_core.h
│ │ usbd_customhid_core.c
│ │ usbd_customhid_core.h
│ │ usbd_def.h
│ │ usbd_desc.c
│ │ usbd_desc.h
│ │ usbd_ioreq.c
│ │ usbd_ioreq.h
│ │ usbd_req.c
│ │ usbd_req.h
│ │ usbd_usr.c
│ │ usbd_usr.h
│ │ usb_bsp.c
│ │ usb_bsp.h
│ │ usb_conf.h
│ │ usb_core.c
│ │ usb_core.h
│ │ usb_dcd.c
│ │ usb_dcd.h
│ │ usb_dcd_int.c
│ │ usb_dcd_int.h
│ │ usb_defines.h
│ │ usb_io.c
│ │ usb_io.h
│ └ usb_regs.h
├ std
│ │ bsp_config.h
│ │ README.md
│ │ usbd_conf.h
│ │ usbd_core.c
│ │ usbd_core.h
│ │ usbd_customhid_core.c
│ │ usbd_customhid_core.h
│ │ usbd_def.h
│ │ usbd_desc.c
│ │ usbd_desc.h
│ │ usbd_ioreq.c
│ │ usbd_ioreq.h
│ │ usbd_req.c
│ │ usbd_req.h
│ │ usbd_usr.c
│ │ usbd_usr.h
│ │ usb_bsp.c
│ │ usb_bsp.h
│ │ usb_conf.h
│ │ usb_core.c
│ │ usb_core.h
│ │ usb_dcd.c
│ │ usb_dcd.h
│ │ usb_dcd_int.c
│ │ usb_dcd_int.h
│ │ usb_defines.h
│ │ usb_hcd_int.h
│ │ usb_io.c
│ │ usb_io.h
│ └ usb_regs.h
└ vcom
│ README.md
│ usbd_cdc_core.c
│ usbd_cdc_core.h
│ usbd_cdc_vcp.c
│ usbd_cdc_vcp.h
│ usbd_conf.h
│ usbd_core.c
│ usbd_core.h
│ usbd_def.h
│ usbd_desc.c
│ usbd_desc.h
│ usbd_ioreq.c
│ usbd_ioreq.h
│ usbd_req.c
│ usbd_req.h
│ usbd_usr.c
│ usbd_usr.h
│ usb_bsp.c
│ usb_bsp.h
│ usb_conf.h
│ usb_core.c
│ usb_core.h
│ usb_dcd.c
│ usb_dcd.h
│ usb_dcd_int.c
│ usb_dcd_int.h
│ usb_defines.h
│ usb_io.c
│ usb_io.h
└ usb_regs.h