標(biāo)題:
STM32鼠標(biāo)按鍵程序
[打印本頁]
作者:
fourz
時(shí)間:
2020-1-9 12:58
標(biāo)題:
STM32鼠標(biāo)按鍵程序
鼠標(biāo)按鍵的實(shí)現(xiàn),沒main函數(shù)
#include <stm32f10x_lib.h>
#include "sys.h"
#include "delay.h"
#include "usb_lib.h"
#include "hw_config.h"
#include "usb_pwr.h"
extern u8 EP1BUSY;
extern u8 USB_INIT;
u8 key[2]={0x4f,0x50};
int main(void)
{
u32 i=0;
u8 j=0;
Stm32_Clock_Init(9);//系統(tǒng)時(shí)鐘設(shè)置
delay_init(72); //延時(shí)初始化
//USB配置
USB_Interrupts_Config();
Set_USBClock();
USB_Init();
while(1)
{
if(USB_INIT)
{
if(bDeviceState==CONFIGURED)
{
if (EP1BUSY==0)
{
i++;
if(i%2)
{
Joystick_Send(0x01, 0, key[j]);
j++;
if(j==2)
j=0;
}
else
Joystick_Send(0x01, 0, 0);
}
}
}
}
}
復(fù)制代碼
STM32_USB_鼠標(biāo)鍵盤.zip
2020-1-9 12:57 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
158.76 KB, 下載次數(shù): 29, 下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1