欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
MM32F103 USB應(yīng)用實(shí)例Custom_HID通訊例程
[打印本頁]
作者:
ben.young
時(shí)間:
2020-7-30 16:39
標(biāo)題:
MM32F103 USB應(yīng)用實(shí)例Custom_HID通訊例程
基于MM32F103 USB Custom_HID 通訊例程,基于32位 ARM Cortex M3 的MM32F103xBx8的例程
單片機(jī)源程序如下:
/* Includes ------------------------------------------------------------------*/
#include "MM32F103.h"
#include "usb_lib.h"
#include "hw_config.h"
#include "usbio.h"
#include "usb_regs.h"
#include "usb_pwr.h"
#include "usb_desc.h"
#include "sys.h"
#include "uart.h"
#include "delay.h"
#include "led.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
void Delay(__IO uint32_t nCount);
extern uint8_t Flag_Receive;
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : main.
* Description : main routine.
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
uint8_t table_data[64]={
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
};
int main(void)
{
delay_init();
uart_initwBaudRate(115200);
LED_Init();
Set_System();
USB_Interrupts_Config();
Set_USBClock();
USB_Init();
printf("System Initial Success\r\n");
while (1)
{
if(bDeviceState == CONFIGURED) //等待USB初始化完成
{
// if(Flag_Receive)
// {
//
// USB_Send_Buffer[0] = 0xaa;
// USB_Send_Buffer[1] = 0x55;
// USB_Send_Buffer[2] = 0xaa;
// USB_Send_Buffer[3] = 0x55;
// USB_Send_Buffer[4] = 0xaa;
// USB_Send_Buffer[5] = 0x55;
// USB_SendData(USB_Send_Buffer,64);
//
// Flag_Receive = 0;
//
// }
USB_SendData(table_data,5);
delay_ms(5000);
}
//USB_SendData(table_data,64);
}
}
/*******************************************************************************
* Function Name : Delay
* Description : Inserts a delay time.
* Input : nCount: specifies the delay time length.
* Output : None
* Return : None
*******************************************************************************/
void Delay(__IO uint32_t nCount)
{
for(; nCount!= 0;nCount--);
}
#ifdef USE_FULL_ASSERT
/*******************************************************************************
* Function Name : assert_failed
* Description : Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* Input : - file: pointer to the source file name
* - line: assert_param error line source number
* Output : None
* Return : None
*******************************************************************************/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while(1)
{
}
}
#endif
/******************* (C) COPYRIGHT 2009 Mindmotion *****END OF FILE****/
復(fù)制代碼
所有資料51hei提供下載:
MM32F103_USB_Custom_HID.7z
(161.23 KB, 下載次數(shù): 43)
2020-7-30 16:39 上傳
點(diǎn)擊文件名下載附件
USB HID
下載積分: 黑幣 -5
作者:
zyluglugl
時(shí)間:
2021-8-5 22:40
樓主,好像用這個(gè)的人很少呀?你是做宣傳的嗎?
作者:
zhu1980
時(shí)間:
2022-3-31 09:18
這個(gè)程序,我在WIN10上可用正常使用,在win7 和 XP上USB不能識(shí)別,是什么問題?
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1