/**
* @file usb_lib.c
* @brief USB library
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <string.h>
#include "rl_usb.h"
#include "usb.h"
#include "settings.h"
#pragma thumb
#pragma O3
/*------------------------------------------------------------------------------
* Library for usb_config.c
*----------------------------------------------------------------------------*/
#ifdef __USB_CONFIG__
/*------------------------------------------------------------------------------
* USB Device Configuration
*----------------------------------------------------------------------------*/
#if (USBD_ENABLE)
U8 USBD_AltSetting[USBD_IF_NUM_MAX];
U8 USBD_EP0Buf[USBD_MAX_PACKET0];
const U8 usbd_power = USBD_POWER;
const U8 usbd_hs_enable = USBD_HS_ENABLE;
const U8 usbd_bos_enable = USBD_BOS_ENABLE;
U16 usbd_if_num = USBD_IF_NUM_MAX;
const U8 usbd_ep_num = USBD_EP_NUM;
const U8 usbd_max_packet0 = USBD_MAX_PACKET0;
/*------------------------------------------------------------------------------
* USB Device Class Configuration
*----------------------------------------------------------------------------*/
#if (!USBD_HID_BINTERVAL)
#define USBD_HID_INTERVAL 1
#else
#define USBD_HID_INTERVAL USBD_HID_BINTERVAL
#endif
#if (!USBD_HID_HS_BINTERVAL)
#define USBD_HID_HS_INTERVAL 1
#else
#define USBD_HID_HS_INTERVAL (2 << ((USBD_HID_HS_BINTERVAL & 0x0F)-1))
#endif
#if (USBD_HID_ENABLE)
U8 usbd_hid_if_num; //assigned during runtime init
const U8 usbd_hid_ep_intin = USBD_HID_EP_INTIN;
const U8 usbd_hid_ep_intout = USBD_HID_EP_INTOUT;
const U16 usbd_hid_interval[2] = {USBD_HID_INTERVAL, USBD_HID_HS_INTERVAL};
const U16 usbd_hid_maxpacketsize[2] = {USBD_HID_WMAXPACKETSIZE, USBD_HID_HS_WMAXPACKETSIZE};
const U8 usbd_hid_inreport_num = USBD_HID_INREPORT_NUM;
const U8 usbd_hid_outreport_num = USBD_HID_OUTREPORT_NUM;
const U16 usbd_hid_inreport_max_sz = USBD_HID_INREPORT_MAX_SZ;
const U16 usbd_hid_outreport_max_sz = USBD_HID_OUTREPORT_MAX_SZ;
const U16 usbd_hid_featreport_max_sz = USBD_HID_FEATREPORT_MAX_SZ;
U16 USBD_HID_PollingCnt;
U8 USBD_HID_IdleCnt[USBD_HID_INREPORT_NUM];
U8 USBD_HID_IdleReload[USBD_HID_INREPORT_NUM];
U8 USBD_HID_IdleSet[USBD_HID_INREPORT_NUM];
U8 USBD_HID_InReport[USBD_HID_INREPORT_MAX_SZ + 1];
U8 USBD_HID_OutReport[USBD_HID_OUTREPORT_MAX_SZ + 1];
U8 USBD_HID_FeatReport[USBD_HID_FEATREPORT_MAX_SZ + 1];
#endif
#if (USBD_MSC_ENABLE)
U8 usbd_msc_if_num; //assigned during runtime init
const U8 usbd_msc_ep_bulkin = USBD_MSC_EP_BULKIN;
const U8 usbd_msc_ep_bulkout = USBD_MSC_EP_BULKOUT;
const U16 usbd_msc_maxpacketsize[2] = {USBD_MSC_WMAXPACKETSIZE, USBD_MSC_HS_WMAXPACKETSIZE};
const U8 *usbd_msc_inquiry_data = USBD_MSC_INQUIRY_DATA;
const U16 USBD_MSC_BulkBufSize = USBD_MSC_MAX_PACKET;
U8 USBD_MSC_BulkBuf[USBD_MSC_MAX_PACKET];
#endif
#if (USBD_ADC_ENABLE)
const U8 usbd_adc_cif_num = USBD_ADC_CIF_NUM;
const U8 usbd_adc_sif1_num = USBD_ADC_SIF1_NUM;
const U8 usbd_adc_sif2_num = USBD_ADC_SIF2_NUM;
const U8 usbd_adc_ep_isoout = USBD_ADC_EP_ISOOUT;
const U32 usbd_adc_cfg_datafreq = USBD_ADC_TSAMFREQ;
const U32 usbd_adc_cfg_p_s = USBD_ADC_CFG_P_S;
const U32 usbd_adc_cfg_p_c = USBD_ADC_CFG_P_C;
const U32 usbd_adc_cfg_b_s = (8 * USBD_ADC_CFG_P_C *USBD_ADC_CFG_P_S);
S16 USBD_ADC_DataBuf[8 * USBD_ADC_CFG_P_C * USBD_ADC_CFG_P_S];
#endif
#ifndef USBD_CDC_ACM_ENABLE
#if (USBD_CDC_ENABLE == 1)
#error "Please update usb_config.c file with new definitions for CDC, as new CDC is incompatible with the old one!"
#else
#define USBD_CDC_ACM_ENABLE 0
#endif
#endif
#if (USBD_CDC_ACM_ENABLE)
U8 usbd_cdc_acm_cif_num = 0; //assigned during runtime init
U8 usbd_cdc_acm_dif_num = 0; //assigned during runtime init
const U8 usbd_cdc_acm_ep_intin = USBD_CDC_ACM_EP_INTIN;
const U8 usbd_cdc_acm_ep_bulkin = USBD_CDC_ACM_EP_BULKIN;
const U8 usbd_cdc_acm_ep_bulkout = USBD_CDC_ACM_EP_BULKOUT;
const U16 usbd_cdc_acm_sendbuf_sz = USBD_CDC_ACM_SENDBUF_SIZE;
const U16 usbd_cdc_acm_receivebuf_sz = USBD_CDC_ACM_RECEIVEBUF_SIZE;
const U16 usbd_cdc_acm_maxpacketsize[2] = {USBD_CDC_ACM_WMAXPACKETSIZE, USBD_CDC_ACM_HS_WMAXPACKETSIZE};
const U16 usbd_cdc_acm_maxpacketsize1[2] = {USBD_CDC_ACM_WMAXPACKETSIZE1, USBD_CDC_ACM_HS_WMAXPACKETSIZE1};
U8 USBD_CDC_ACM_SendBuf[USBD_CDC_ACM_SENDBUF_SIZE];
U8 USBD_CDC_ACM_ReceiveBuf[USBD_CDC_ACM_RECEIVEBUF_SIZE];
U8 USBD_CDC_ACM_NotifyBuf[10];
#endif
#if (USBD_WEBUSB_ENABLE)
U8 usbd_webusb_if_num; //assigned during runtime init
const U8 usbd_webusb_vendor_code = USBD_WEBUSB_VENDOR_CODE;
#else
const U8 usbd_webusb_vendor_code;
#endif
#if (USBD_WINUSB_ENABLE)
const U8 usbd_winusb_vendor_code = USBD_WINUSB_VENDOR_CODE;
#else
const U8 usbd_winusb_vendor_code;
#endif
#if (USBD_BULK_ENABLE)
U8 usbd_bulk_if_num = 0; //assigned during runtime init
const U8 usbd_bulk_ep_bulkin = USBD_BULK_EP_BULKIN;
const U8 usbd_bulk_ep_bulkout = USBD_BULK_EP_BULKOUT;
const U16 usbd_bulk_maxpacketsize[2] = {USBD_BULK_WMAXPACKETSIZE, USBD_BULK_HS_WMAXPACKETSIZE};
const U16 USBD_Bulk_BulkBufSize = USBD_BULK_MAX_PACKET;
U8 USBD_Bulk_BulkInBuf[USBD_BULK_MAX_PACKET];
U8 USBD_Bulk_BulkOutBuf[USBD_BULK_MAX_PACKET];
#endif
/*------------------------------------------------------------------------------
* USB Device Override Event Handler Fuctions
*----------------------------------------------------------------------------*/
#if (USBD_HID_ENABLE)
#ifndef __RTX
void USBD_Configure_Event(void)
{
USBD_HID_Configure_Event();
}
#endif
#ifdef __RTX
#if ((USBD_HID_EP_INTOUT != 0) && (USBD_HID_EP_INTIN != USBD_HID_EP_INTOUT))
#if (USBD_HID_EP_INTIN == 1)
#define USBD_RTX_EndPoint1 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 2)
#define USBD_RTX_EndPoint2 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 3)
#define USBD_RTX_EndPoint3 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 4)
#define USBD_RTX_EndPoint4 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 5)
#define USBD_RTX_EndPoint5 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 6)
#define USBD_RTX_EndPoint6 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 7)
#define USBD_RTX_EndPoint7 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 8)
#define USBD_RTX_EndPoint8 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 9)
#define USBD_RTX_EndPoint9 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 10)
#define USBD_RTX_EndPoint10 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 11)
#define USBD_RTX_EndPoint11 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 12)
#define USBD_RTX_EndPoint12 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 13)
#define USBD_RTX_EndPoint13 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 14)
#define USBD_RTX_EndPoint14 USBD_RTX_HID_EP_INTIN_Event
#elif (USBD_HID_EP_INTIN == 15)
#define USBD_RTX_EndPoint15 USBD_RTX_HID_EP_INTIN_Event
#endif
#if (USBD_HID_EP_INTOUT == 1)
#define USBD_RTX_EndPoint1 USBD_RTX_HID_EP_INTOUT_Event
#elif (USBD_HID_EP_INTOUT == 2)
#define USBD_RTX_EndPoint2 USBD_RTX_HID_EP_INTOUT_Event
#elif (USBD_HID_EP_INTOUT == 3)
没有合适的资源?快使用搜索试试~ 我知道了~
基于stm32-GD32的DAPLink调试仿真器源码.zip
共352个文件
h:161个
c:123个
md:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 6 下载量 4 浏览量
2023-08-27
20:50:09
上传
评论 2
收藏 12.61MB ZIP 举报
温馨提示
基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。 基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。基于stm32_GD32的DAPLink调试仿真器源码.zip 代码完整下载可用。
资源推荐
资源详情
资源评论
收起资源包目录
基于stm32-GD32的DAPLink调试仿真器源码.zip (352个子文件)
start_bl.act 0B
start_if.act 0B
erase.act 0B
gdcpu-daplink.axf 1.98MB
gdcpu-daplink_bl.axf 1.12MB
launch_uvision.bat 2KB
astyle.bat 1KB
pre_build_script.bat 1KB
post_build_script.bat 1KB
Clean.bat 576B
gdcpu-daplink.bin 79KB
gdcpu-daplink_bl.bin 47KB
usb_lib.c 130KB
USART_STM32F10x.c 77KB
USART_GD32F10x.c 77KB
DAP.c 51KB
system_stm32f10x.c 34KB
system_stm32f10x.c 34KB
usbd_core.c 32KB
usbd_msc.c 32KB
usbd_cdc_acm.c 30KB
vfs_manager.c 29KB
virtual_fs.c 27KB
swd_host.c 26KB
usb_config.c 25KB
usb_config.c 24KB
swd_host_ca.c 22KB
SWO.c 19KB
vfs_user.c 19KB
usbd_STM32F103.c 19KB
usbd_GD32F103.c 19KB
JTAG_DP.c 16KB
usbd_hid.c 16KB
main.c 14KB
SW_DP.c 14KB
DMA_STM32F10x.c 13KB
DMA_GD32F10x.c 13KB
iap_flash_intf.c 13KB
RTX_lib.c 13KB
flash_decoder.c 13KB
target_flash.c 12KB
file_stream.c 10KB
flash_manager.c 10KB
intelhex.c 10KB
rt_Task.c 10KB
HAL_CM3.c 9KB
info.c 9KB
rt_List.c 8KB
main.c 8KB
uart.c 7KB
rt_Mailbox.c 7KB
error.c 7KB
uart.c 7KB
RTX_Config.c 7KB
rt_System.c 6KB
settings.c 6KB
gpio.c 6KB
gpio.c 6KB
usbd_core_hid.c 6KB
DAP_vendor.c 6KB
GPIO_STM32F10x.c 6KB
GPIO_GD32F10x.c 6KB
usbd_core_cdc.c 5KB
usbd_user_cdc_acm.c 5KB
crc32.c 5KB
settings_rom.c 5KB
target_family.c 5KB
rt_Event.c 5KB
flash_blob.c 4KB
stm32f10x_it.c 4KB
stm32f10x_it.c 4KB
usbd_user_hid.c 4KB
usbd_user_hid.c 4KB
rt_Mutex.c 4KB
rt_MemBox.c 4KB
flash_blob.c 4KB
util.c 4KB
flash_blob.c 4KB
crc16.c 4KB
rt_Timer.c 3KB
cmsis_os2_port.c 3KB
rt_Semaphore.c 3KB
circ_buf.c 3KB
SysTick_Handler.c 3KB
bootloader_update.c 3KB
flash_blob.c 3KB
usbd_bulk.c 3KB
validation.c 3KB
flash_blob.c 3KB
flash_blob.c 3KB
flash.c 3KB
flash_blob.c 3KB
usbd_core_webusb.c 3KB
flash_blob.c 3KB
DAP_queue.c 3KB
flash.c 2KB
flash_blob.c 2KB
flash_blob.c 2KB
flash_blob.c 2KB
flash_blob.c 2KB
共 352 条
- 1
- 2
- 3
- 4
盈梓的博客
- 粉丝: 9638
- 资源: 2391
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 圆薄片自动装配设备sw20可编辑全套技术资料100%好用.zip
- 重型龙门CNC加工中心sw12全套技术资料100%好用.zip
- Analytics-90Day-2024-12-26-134101.000.ips.ca.synced
- 竹筷自动计数大袋包装封装输送设备sw16可编辑全套技术资料100%好用.zip
- 竹筷自动包装机sw16可编辑全套技术资料100%好用.zip
- 自动车钢管机(sw19可编辑+工程图)全套技术资料100%好用.zip
- 自动化球阀切割机(sw19可编辑+工程图)全套技术资料100%好用.zip
- 麒麟系统部署服务!!!!!!
- 自动剥离高精度贴膜机sw18可编辑全套技术资料100%好用.zip
- 自动化贴标机料卷送料拨料机 sw18可编辑全套技术资料100%好用.zip
- 自动化上下料烫金印刷机sw16可编辑全套技术资料100%好用.zip
- 自动化衣架除水口插针钩一体机sw17可编辑全套技术资料100%好用.zip
- 自动双轴包胶机sw18可编辑全套技术资料100%好用.zip
- 自动矫正叠料装盒机sw12全套技术资料100%好用.zip
- 自动上纸吸尘上料机圆盘烫印机sw16可编辑全套技术资料100%好用.zip
- 自动丝印机sw12可编辑全套技术资料100%好用.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页