• 大小: 224KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: 其他
  • 标签: STM32  KEIL  USB  HID  

资源简介

Example description =================== This Demo provides a description of how to use the USB-FS-Device on the STM32F10xxx, STM32F37xxx, STM32F30xxx and STM32L15xxx devices. The STM32 device is enumerated as HID compliant device, that uses the native PC Host USB-FS-Device HID driver. To test the example, you need to: 1)- Start the "USB HID Demonstrator" PC applet and connect STM32 USB to PC 2)- The device should be detected and shown in the USB HID target box 3)- Press Graphic View button 4)- You can Select "use SET_FEATURE" or "use SET_REPORT" in order to use SET_REPORT request to send HID Report for LED control 5)- Make sure that following report ID are configured: LED1 ID (0x1) , LED2 ID(0x2), LED3 ID(0x3), LED4 ID(0x4), and BUTTON1_ID(0x5) 6)- Select Leds to switch on/off on the EVAL board => a SET_REPORT request will be sent More details about this Demo implementation is given in the User manual "UM0424 STM32F10xxx USB development kit", available for download from the ST microcontrollers website: www.st.com/stm32

资源截图

代码片段和文件信息

/**
  ******************************************************************************
  * @file    hw_config.c
  * @author  MCD Application Team
  * @version V4.0.0
  * @date    21-January-2013
  * @brief   Hardware Configuration & Setup
  ******************************************************************************
  * @attention
  *
  * 

© COPYRIGHT 2013 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 “hw_config.h“
#include “usb_lib.h“
#include “usb_desc.h“
#include “usb_pwr.h“

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/

ErrorStatus HSEStartUpStatus;
uint32_t ADC_ConvertedValueX = 0;
uint32_t ADC_ConvertedValueX_1 = 0;
__IO uint16_t  ADC1ConvertedValue = 0 ADC1ConvertedVoltage = 0 calibration_value = 0;

/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
static void IntToUnicode (uint32_t value  uint8_t *pbuf  uint8_t len);
/* Private functions ---------------------------------------------------------*/

/*******************************************************************************
* Function Name  : Set_System
* Description    : Configures Main system clocks & power.
* Input          : None.
* Return         : None.
*******************************************************************************/
void Set_System(void)
{
#if defined (STM32F37X) || defined (STM32F30X)
  GPIO_InitTypeDef  GPIO_InitStructure;
#endif /*STM32L1XX_XD */
  
#if defined(USB_USE_EXTERNAL_PULLUP)
  GPIO_InitTypeDef  GPIO_InitStructure;
#endif /* USB_USE_EXTERNAL_PULLUP */
  
  /*!< At this stage the microcontroller clock setting is already configured 
  this is done through SystemInit() function which is called from startup
  file (startup_stm32xxx.s) before to branch to application main.
  To reconfigure the default setting of SystemInit() functio

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-29 21:02  Custom_HID\
     目录           0  2013-01-29 21:02  Custom_HID\EWARM\
     文件      221280  2013-01-22 02:27  Custom_HID\EWARM\Custom_HID.ewd
     文件      193659  2013-01-22 02:27  Custom_HID\EWARM\Custom_HID.ewp
     文件         904  2013-01-22 02:27  Custom_HID\EWARM\Custom_HID.eww
     文件        1354  2013-01-22 02:27  Custom_HID\EWARM\stm32f10x_flash.icf
     文件        1340  2013-01-22 02:27  Custom_HID\EWARM\stm32f30x_flash.icf
     文件        1429  2013-01-22 02:27  Custom_HID\EWARM\stm32f37x_flash.icf
     文件        1343  2013-01-22 02:27  Custom_HID\EWARM\stm32l1xx_flash.icf
     目录           0  2013-01-29 21:02  Custom_HID\inc\
     文件        2341  2013-01-22 02:27  Custom_HID\inc\hw_config.h
     文件        8872  2013-01-22 02:27  Custom_HID\inc\platform_config.h
     文件        3568  2013-01-22 02:27  Custom_HID\inc\stm32f10x_conf.h
     文件        3329  2013-01-22 02:27  Custom_HID\inc\stm32f30x_conf.h
     文件        3357  2013-01-22 02:27  Custom_HID\inc\stm32f37x_conf.h
     文件        3288  2013-01-22 02:27  Custom_HID\inc\stm32l1xx_conf.h
     文件        2241  2013-01-22 02:27  Custom_HID\inc\stm32_it.h
     文件        3721  2013-01-22 02:27  Custom_HID\inc\usb_conf.h
     文件        3249  2013-01-22 02:27  Custom_HID\inc\usb_desc.h
     文件        2823  2013-01-22 02:27  Custom_HID\inc\usb_istr.h
     文件        3358  2013-01-22 02:27  Custom_HID\inc\usb_prop.h
     文件        2455  2013-01-22 02:27  Custom_HID\inc\usb_pwr.h
     目录           0  2013-01-29 21:02  Custom_HID\MDK-ARM\
     文件       82440  2013-01-22 02:27  Custom_HID\MDK-ARM\Custom_HID.uvopt
     文件      513947  2013-01-22 02:27  Custom_HID\MDK-ARM\Custom_HID.uvproj
     文件        8740  2013-01-22 02:27  Custom_HID\readme.txt
     目录           0  2013-01-29 21:02  Custom_HID\RIDE\
     文件       83841  2013-01-26 02:57  Custom_HID\RIDE\Custom_HID.rapp
     文件         313  2013-01-26 02:57  Custom_HID\RIDE\Custom_HID.rprj
     目录           0  2013-01-29 21:02  Custom_HID\src\
     文件       25312  2013-01-22 02:27  Custom_HID\src\hw_config.c
............此处省略107个文件信息

评论

共有 条评论