久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费
標題:
USB鼠標源碼 Labview USB-RAW-Bulk上位機發(fā)送數據STM32下位機接受
[打印本頁]
作者:
愛兒
時間:
2018-6-8 15:04
標題:
USB鼠標源碼 Labview USB-RAW-Bulk上位機發(fā)送數據STM32下位機接受
為了獲得一點黑幣,好下載,也是不擇手段了!
0.png
(47.44 KB, 下載次數: 40)
下載附件
2018-6-9 03:45 上傳
IDE-Version:
*********************************************
μVision V4
下載方式
*********************************************
·SWD JTAG
程序功能
*********************************************
·STM32 USB鼠標實驗
硬件連接
*********************************************
·將USB插到開發(fā)板上
實驗現象
*********************************************
·可以使用KEY來控制電腦的鼠標的方向
單片機源程序如下:
/*********************************************************************************************************
*
* File : main.c
* Hardware Environment:
* Build Environment : RealView MDK-ARM Version: 4.32
* Version : V1.0
* By : mao
*
*
*********************************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "usb_lib.h"
#include "hw_config.h"
#include "usb_pwr.h"
#include "usart1.h"
#include "Data.h"
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
/* Private function prototypes -----------------------------------------------*/
u8 MsgCmd;
void Delay (uint32_t nCount);
void USB_SendString(u8 *str) //
{
u8 ii=0;
while(*str)
{
Transi_Buffer[ii++]=*(str++);
if (ii ==22) break;
}
UserToPMABufferCopy(Transi_Buffer, ENDP2_TXADDR, 22);
_SetEPTxStatus(ENDP2, EP_TX_VALID);
}
/*******************************************************************************
* Function Name : main
* Description : Main program
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
int main(void)
{
Set_System();
USB_Interrupts_Config();
Set_USBClock();
USB_Init();
/* USART1 config 115200 8-N-1 */
USART1_Config();
NVIC_USART1_Configuration();
MsgCmd=0;
while (1)
{
if(MsgCmd) //當上位機發(fā)送數據以后,對MsgCmd置1
{
Delay(50000); //沒有這個延時,會少部分數據?為什么?
// while(EP_RX_NAK!=GetEPRxStatus(ENDP1));
printf("\r\n進入主函數");
GET_CMD();
}
}
}
/*******************************************************************************
* Function Name : Delay
* Description : Delay Time
* Input : - nCount: Delay Time
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
void Delay (uint32_t nCount)
{
for(; nCount != 0; nCount--)
{
}
}
/*******************************************************************************
* Function Name : GPIO_Configuration
* Description : Configure GPIO Pin
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
//void GPIO_Configuration(void)
//{
// GPIO_InitTypeDef GPIO_InitStructure;
//
// RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB , ENABLE);
///**
// * LED1 -> PB15 , LED2 -> PB14 , LED3 -> PB13 , LED4 -> PB12
// */
// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
// GPIO_Init(GPIOB, &GPIO_InitStructure);
//}
//
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval 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
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
復制代碼
所有資料51hei提供下載:
usb下位機1(上位機發(fā),下位機收).rar
(407.71 KB, 下載次數: 36)
2018-6-9 03:45 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
lzts88
時間:
2018-6-9 09:01
很好的參考資料, 收藏了
歡迎光臨 (http://m.zg4o1577.cn/bbs/)
Powered by Discuz! X3.1
主站蜘蛛池模板:
精品小视频
|
国产一区二区三区在线视频
|
色片在线
|
亚洲一级免费视频
|
在线理论片
|
羞羞的网站
|
91人人爽
|
91av在线看
|
中文字幕在线观看第一页
|
亚洲精品久久久久avwww潮水
|
国产午夜精品一区二区三区视频
|
天天视频国产
|
久久都是精品
|
日韩欧美小视频
|
秋霞国产
|
日韩不卡av
|
在线观看日韩
|
深夜福利久久
|
夜夜精品视频
|
久久久久久网
|
色婷婷久久综合
|
可以免费看av的网站
|
欧美日韩a
|
欧美日韩在线免费观看
|
国产精品久久久一区二区三区
|
欧美视频一区二区三区
|
蜜桃一区二区
|
福利视频午夜
|
亚洲视频一区在线观看
|
国产不卡视频
|
黄色三级网
|
怡红院在线播放
|
国产精品久久久久久久久久
|
天天精品视频
|
亚洲国产毛片
|
懂色av一区二区三区
|
亚洲视频一区在线观看
|
黄色一级片免费看
|
青青草视频污
|
国产欧美精品一区二区
|
av黄页
|