資源簡介
usb之CDC(CDC_Standalone.rar)
代碼片段和文件信息
/**
******************************************************************************
*?@file????USB_Device/CDC_Standalone/Src/main.c
*?@author??MCD?Application?Team
*?@version?V1.1.0
*?@date????26-June-2014
*?@brief???USB?device?CDC?application?main?file
******************************************************************************
*?@attention
*
*?©?COPYRIGHT(c)?2014?STMicroelectronics
*
*?Licensed?under?MCD-ST?Liberty?SW?License?Agreement?V2?(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.st.com/software_license_agreement_liberty_v2
*
*?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.
*
******************************************************************************
*/
/*?Includes?------------------------------------------------------------------*/
#include?“main.h“
#include? /*?因為用到了va_start等va_宏,所以必須包含這個文件?*/
#include? /*?因為用到了printf函數,所以必須包含這個文件?*/
/*?Private?typedef?-----------------------------------------------------------*/
/*?Private?define?------------------------------------------------------------*/
/*?Private?macro?-------------------------------------------------------------*/
/*?Private?variables?---------------------------------------------------------*/
USBD_HandleTypeDef??USBD_Device;
/*?Private?function?prototypes?-----------------------------------------------*/
static?void?SystemClock_Config(void);
static?void?Toggle_Leds(void);
void UsbPrintf(const?char*?lpszFormat?...);
uint8_t UsbSendData(uint8_t*?pBuf?uint16_t?nLen);
#define?TxBufSize?20480
int?bSendMark?=?0; ////?發送數據的標志
uint8_t?SendData[TxBufSize];
extern?uint8_t?UserRxBuffer[2][APP_RX_DATA_SIZE];////?用雙緩存保存數據
extern?uint32_t?nRxLength; ////?接收到的數據長度
extern?uint8_t?uRxBufIndex; ////?當前使用的緩沖區索引號
extern?uint8_t??uLastRxBufIndex;////?上次使用的接收緩沖區索引號
/*?Private?functions?---------------------------------------------------------*/?
/**
*?@brief??Main?program
*?@param??None
*?@retval?None
*/
int?main(void)
{
int?i;
/*?STM32F4xx?HAL?library?initialization:
-?Configure?the?Flash?prefetch?instruction?and?Data?caches
-?Configure?the?Systick?to?generate?an?interrupt?each?1?msec
-?Set?NVIC?Group?Priority?to?4
-?Global?MSP?(MCU?Support?Package)?initialization
*/
HAL_Init();
/*?Configure?the?system?clock?to?168?Mhz?*/
SystemClock_Config();
#ifdef?USE_USB_FS
/*?Configure?LED3?LED4?LED5?and?LED6?*/
BSP_LED_Init(LED3); ////?HS模式下LED3與USB_RESET引腳沖突,因此LED代碼僅在FS模式下使用
BSP_LED_Init(LED4);
BSP_LED_Init(LED5);
BSP_LED_Init(LED6);
#endif
/*?Init?Device?Library?*/
USB
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1928??2014-09-18?01:48??CDC_Standalone\Inc\main.h
?????文件??????16347??2014-09-28?02:18??CDC_Standalone\Inc\stm32f4xx_hal_conf.h
?????文件???????3355??2014-06-26?21:46??CDC_Standalone\Inc\stm32f4xx_it.h
?????文件???????5698??2014-09-23?00:08??CDC_Standalone\Inc\usbd_cdc_interface.h
?????文件???????3051??2014-06-26?21:46??CDC_Standalone\Inc\usbd_conf.h
?????文件???????2069??2014-06-26?21:46??CDC_Standalone\Inc\usbd_desc.h
????.......?????38887??2015-11-06?00:27??CDC_Standalone\MDK-ARM\Project.uvopt
????.......?????50399??2015-11-05?23:42??CDC_Standalone\MDK-ARM\Project.uvproj
?????文件??????30234??2015-11-05?23:57??CDC_Standalone\MDK-ARM\startup_stm32f407xx.s
?????文件?????579876??2015-11-06?00:27??CDC_Standalone\MDK-ARM\STM32F4-Discovery_USBD-HS\STM32F4-Discovery_USBD-HS.axf
?????文件??????10473??2014-10-08?23:47??CDC_Standalone\readme.txt
?????文件??????14336??2014-10-03?21:28??CDC_Standalone\Src\HS實現過程記錄.doc
?????文件???????8929??2014-10-09?10:50??CDC_Standalone\Src\main.c
?????文件???????5375??2014-09-28?02:34??CDC_Standalone\Src\stm32f4xx_it.c
?????文件??????19504??2014-09-28?02:36??CDC_Standalone\Src\system_stm32f4xx.c
?????文件???????5917??2014-10-08?22:20??CDC_Standalone\Src\usbd_cdc_interface.c
?????文件??????15701??2014-10-03?21:20??CDC_Standalone\Src\usbd_conf.c
?????文件???????9423??2014-09-19?21:29??CDC_Standalone\Src\usbd_desc.c
?????文件???????1104??2015-11-06?00:15??CDC_Standalone\Visual?Studio?Project\Project.sln
?????文件??????12800??2015-11-06?00:17??CDC_Standalone\Visual?Studio?Project\Project.suo
?????文件???????8039??2015-11-06?00:15??CDC_Standalone\Visual?Studio?Project\Project.vcxproj
?????文件???????9054??2015-11-06?00:15??CDC_Standalone\Visual?Studio?Project\Project.vcxproj.filters
?????文件???????1031??2015-11-06?00:15??CDC_Standalone\Visual?Studio?Project\Project.vcxproj.user
?????文件???????1157??2015-11-06?00:15??CDC_Standalone\Visual?Studio?Project\readme.txt
?????目錄??????????0??2015-11-06?00:28??CDC_Standalone\MDK-ARM\STM32F4-Discovery_USBD-HS
?????目錄??????????0??2014-10-09?10:28??CDC_Standalone\Inc
?????目錄??????????0??2015-11-06?00:29??CDC_Standalone\MDK-ARM
?????目錄??????????0??2020-07-31?11:22??CDC_Standalone\Src
?????目錄??????????0??2015-11-06?00:17??CDC_Standalone\Visual?Studio?Project
?????目錄??????????0??2015-11-06?00:18??CDC_Standalone
............此處省略3個文件信息
- 上一篇:ESP32驅動攝像頭
- 下一篇:usb鍵盤(MyUSB_HID_KEIL)
評論
共有 條評論