亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? readme.txt

?? USB CDC and HID composite unit.
?? TXT
字號:
[ Class and composite device support ]

This example implements CDC and HID composite device using IAD to SiLabs 'F320/'F340 DK.

Passed the USB compliance test, USBCV 1.3, ch9 and HID test.
Tested on modified HClient host app example on WinDDK for HID interface.
Tested on RealTerm and a custom test app (modified AN197SW.zip) for serial APIs
http://www.silabs.com/public/documents/software_doc/othersoftware/Microcontrollers/en/AN197SW.zip

See these topics for the implementation details of each class.
CDC implementation is based on
"USB CDC (Communication Device Class) implementation for 'F32x and 'F34x"
http://www.cygnal.org/ubb/Forum9/HTML/000945.html

HID implementation is based on 
"How to convert USB_Interrupt (USB_INT) to HID"
http://www.cygnal.org/ubb/Forum9/HTML/001193.html

The details of composite device implementation was discussed in this topic.
"USB Composite Device"
http://www.cygnal.org/ubb/Forum9/HTML/001050.html

[ Windows version ]
A composite device of CDC with IAD is supported on these Windows version.
- WinXP SP3
- Vista SP1

[ Installation ]
CDC device requires an INF file for the installation of your PC.
Specify the INF folder attached to the zip file, on the New Hardware dialog.


[ Select compiler - Keil or SDCC ]

On the SiLabs IDE, open one of these project files, according to the compiler.
	KEIL_USB_CDC_HID_IAD.wsp
	SDCC_USB_CDC_HID_IAD.wsp
Then, the project file handles everything.

For command line users,
	memory model:	small (Keil / SDCC)
	link library:	KEIL_FIFO_RW.lib (Keil)
			SDCC_FIFO_RW.lib (SDCC)

	The source code of these libraries are included in FIFO_RW_source folder.



[ Switch the MCU type - 'F32x, 'F340 ]

The MCU type is defined in USB_Type.h, as the include file.
Select one of appropriate include file for the device. 	USB_Type.h
	#include <C8051F320.h>
	//#include <C8051F340.h>

Then, the compiler sees the symbols in the include file, like C8051F320_H, and automatically dispatches the conditional compilation in the source code.

The USB engines of these MCUs are almost common, including register assignment. The major difference is just the number of supported endpoints;
	C8051F32x, 34x  IN1-3 / OUT1-3
Therefore, the the most of source code is common, except for USB_Main.c.
In USB_Main.c, the difference of peripherals on MCUs and Dev board configuration make the source code complicated with the MCU type switch. It may be better to split the USB_Main.c into each MCU type.



[ USB_Configuration.h ]

This include file lists up the essential parameters of the USB implementation.
VID/PID, revision number, MaxPacketSize of each EP.

Other than these parameters, these items for the endpoint setting are available.

- The endpoint usage        : USE_OUT_EP1, USE_IN_EP1, etc
- Double buffer for the EP  : ENABLE_OUT_EP1_DOUBLE_BUF, etc
- Isochronous EP (*1)       : ENABLE_OUT_EP1_ISO, etc
- Interrupt usage on the EP : ENABLE_OUT_EP1_INTERRUPT, etc

(*1) When this option is disabled, the EP is handled as a bulk or interrupt EP

Using these switches, you can quickly select the endpoint configuration. Also these switches ensure the proper handling on the standard request, without further modification of the code.

- ENABLE_SUSPEND_RESUME
This option enables suspend/resume interrupts on the code.
The actual handling of suspend/resume is implemented in the USB_Main.c, Usb_Suspend() and Usb_Resume().

- ENABLE_SOF_INTERRUPT
This option enables SOF interrupt. SOF interrupt is invoked by SOF (Start Of Frame) signaling on the USB bus, which gives handy 1 ms interval. Please note, SOF interrupt is generated by the engine, even when the device is not connected to host.

- ENABLE_INLINE_POLL_READ_WRITE
This option switches the definition of POLL_READ_BYTE and POLL_WRITE_BYTE between inline macro and function. Inline macro gives faster execution, but greater code size. The function implementation does vice-versa.


[ Where is the best place to initialize the USB-related variables? ]

When you need to initialize variables every time at the USB connection, these functions are the good place to implement it.
	Usb_Reset()         (USB_ISR.c)
	OR
	Set_Configuration() (USB_Standard_Requests.c)
	( Set_Interface() )
At the device connection to USB bus, host issues bus reset - Usb_Reset() is invoked.
Then, enumeration starts and Set_Configuration() is always called (almost) at the end of enumeration.
When the device has alternate interface(s), Set_Interface() will be called. But the device doesn't have any alternate interface, Set_Interface() is not called.

In this implementation, two flags, IN_FIFO_empty, OUT_FIFO_loaded, are initialized in Set_Configuration().



[ How to handle the endpoint(s) - interrupt or polling? ]

As of the EP1-3, either will do. Select appropriate option which fits to your requirement.
In this implementation, I showed a combined method.

- interrupt IN
When you already have large size of data on a buffer (more than the MaxPacketSize of the EP), interrupt gives better performance. Enable double buffer, too.

- interrupt OUT
When the host sends large size of data to the device, interrupt gives better performance. Enable double buffer, too.

- polling IN
When you don't have any new data to send to the host, leave the FIFO unloaded. Just when you get data to send, load the data to the FIFO in the main loop. Until the firmware loads data to the FIFO, the USB engine returns NAK to the host. And the host retries the transfer again and again without any error. This is the flow control mechanism built-in to the USB protocol.

- polling OUT
When you don't want to accept new data from host until the current process finishes, polling in the main loop gives smart coding. Until the firmware unloads the FIFO, the USB engine returns NAK to the host. And the host retries the transfer again and again without any error. This is also the flow control mechanism built-in to the USB protocol.

Around the access to the USB engine from the main loop, disable USB interrupt to prevent the conflict with the USB ISR.

When you apply the polling method, you may see the host app hangs, when the host app calls ReadFile / WriteFile synchronously. When these API is called synchronously, they don't return until the transfer finishes, then they block the execution of the host app. In this case, these APIs should be called in OVERLAPPED. Or use ReadFileEX or WriteFileEx, instead.


As of the default EP (EP0), it is the usual way to split the control transfer handling into interrupt and polling;
	SETUP stage           - interrupt
	DATA and STATUS stage - polling on main loop
However, I didn't take this approach on this implementation, because of the bug of Windows (*1) and the defect of this USB engine (*2). Handling control transfers as fast as possible in the USB ISR, the chance of hang reduces.

(*1) Bug of Windows
http://support.microsoft.com/kb/892050/en-us
In this bug, TT (transaction translator) issues the next control transfer prematurely.
This bug is not fixed until the next SP (WinXP SP3).

(*2) Defect of the USB engine
This USB engine has just one common FIFO for the EP0 IN/OUT. When new SETUP is prematurely issued by host while the engine (firmware) handles previous control transfer, the FIFO write from the firmware may overwrite the new SETUP on the FIFO. This causes hang on the control transfer handling.
When common IN/OUT FIFO is applied, the engine is usually equipped a mechanism to prevent the overwrite, because SETUP has priority. I can see this mechanism on most of engines on other manufacturers. However, SiLabs engine doesn't have this mechanism, it allows the overwrite. This is the background which is not told in this SiLabs KB article.
"USB Driver Freezing"
http://portal.knowledgebase.net/article.asp?article=194217&p=4120



[ Detailed implementation suggestions ]

In USB_Standard_Requests.c, I attached suggestions for these items.
In this implementation, I chose one of popular option. If you need other option, these suggestions will guide you how to modify this implementation.

	USB_Standard_Requests.c
	- HALT and STALL handling on interrupt and bulk EPs
	- Data toggle handling on interrupt and bulk EPs
	- Bus-powered/Self-powered
	- Suspend/Resume and Remote wakeup



[ Thanks to forum members ]
This implementation has been inspired by the discussion with members on SiLabs Forum,
Patryk, vanmierlo, frief, egawtry, ReneK, dsnook, MarcelJ, and many many other members.
Thanks to you all.


Enjoy!!

Tsueno

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av不卡一区二区| 亚洲一区二区三区小说| 国产精品丝袜在线| 日日嗨av一区二区三区四区| 国产成人av网站| 欧美人牲a欧美精品| 日本一区二区三区高清不卡| 日韩成人免费看| 日本丶国产丶欧美色综合| 2024国产精品| 日韩电影免费在线| 欧美无乱码久久久免费午夜一区 | 欧美日韩激情一区| 国产精品久久99| 国产一区二区三区四区五区美女 | 欧美日韩一区二区三区四区五区| 国产日韩精品一区二区三区在线| 日韩国产精品久久久久久亚洲| 97久久精品人人做人人爽50路| 久久婷婷色综合| 蜜乳av一区二区三区| 欧美性生活一区| 亚洲黄色在线视频| 成人免费毛片高清视频| 久久毛片高清国产| 国产一区二区导航在线播放| 日韩精品自拍偷拍| 毛片不卡一区二区| 日韩精品一区二| 久久电影网站中文字幕| 日韩欧美一级二级| 美国毛片一区二区| 2020日本不卡一区二区视频| 激情图区综合网| 国产日本一区二区| 国产成人精品三级| 国产精品麻豆欧美日韩ww| av亚洲精华国产精华精华| 国产精品天美传媒| 97se亚洲国产综合在线| 亚洲免费成人av| 欧美视频在线观看一区| 亚洲h动漫在线| 欧美放荡的少妇| 久国产精品韩国三级视频| 337p粉嫩大胆噜噜噜噜噜91av| 国产美女久久久久| 国产精品麻豆久久久| 99久久精品费精品国产一区二区| 一区二区三区自拍| 欧美电影在线免费观看| 极品少妇xxxx精品少妇偷拍| 久久久精品黄色| 91猫先生在线| 日本在线不卡视频一二三区| 久久婷婷色综合| 91在线精品一区二区| 亚洲国产精品久久久久秋霞影院 | 一区二区三区四区不卡视频| 欧美日韩免费视频| 老司机精品视频线观看86| 国产欧美精品一区| 在线欧美日韩精品| 久久99最新地址| 18成人在线观看| 欧美一级在线视频| 99热这里都是精品| 日韩高清不卡在线| 国产精品美女久久久久aⅴ国产馆| 99re亚洲国产精品| 蜜臀久久99精品久久久画质超高清 | 日韩1区2区3区| 中文字幕欧美激情一区| 欧美日韩国产免费| 国产91丝袜在线观看| 亚洲专区一二三| 国产网站一区二区三区| 欧美视频一区二区三区| 一区二区三区中文字幕在线观看| 4438x成人网最大色成网站| 国产精品一二三四区| 午夜在线成人av| 国产婷婷一区二区| 欧美一级二级在线观看| 99re热视频这里只精品| 国产九色sp调教91| 视频精品一区二区| 亚洲精品视频在线| 国产日韩亚洲欧美综合| 日韩欧美二区三区| 欧美色精品天天在线观看视频| 高清日韩电视剧大全免费| 日韩电影一区二区三区| 一区二区三区欧美激情| 国产精品免费丝袜| 久久色成人在线| 欧美成人女星排名| 9191精品国产综合久久久久久| 色婷婷综合久久久久中文 | 国产精品一级片| 日韩精品视频网| 亚洲永久精品国产| 日韩毛片在线免费观看| 欧美经典一区二区三区| 欧美sm极限捆绑bd| 欧美不卡激情三级在线观看| 欧美久久久久中文字幕| 欧美伊人久久久久久久久影院| 99久久伊人久久99| 成人av高清在线| 成人精品国产福利| 99这里只有精品| 不卡的av电影在线观看| gogo大胆日本视频一区| 国产成人av网站| 成人黄色小视频在线观看| 成人黄色电影在线| 91麻豆精品在线观看| 色综合色狠狠天天综合色| 国产精品沙发午睡系列990531| 亚洲国产精品99久久久久久久久| 欧美理论片在线| 欧美老女人在线| 欧美一区二区三区色| 欧美一区二区在线视频| 欧美乱熟臀69xxxxxx| 56国语精品自产拍在线观看| 欧美精三区欧美精三区| 日韩欧美中文字幕精品| 精品国产乱码久久| 国产精品美女一区二区| 亚洲精品国产第一综合99久久| 国产成人精品1024| 丁香六月综合激情| 99久久免费国产| 欧美喷潮久久久xxxxx| 日韩欧美成人午夜| 国产精品国模大尺度视频| 亚洲视频一二区| 日韩中文字幕91| 国产高清无密码一区二区三区| 成人免费视频一区| 欧美三级日韩三级| 日韩欧美成人激情| 综合久久久久综合| 日韩电影在线一区二区| 国产成人精品免费看| 精品污污网站免费看| 久久综合九色综合欧美就去吻| 成人欧美一区二区三区白人| 亚洲www啪成人一区二区麻豆| 精品综合久久久久久8888| 99久精品国产| 欧美电视剧在线看免费| 亚洲色图视频网| 久久国产精品色| 欧美在线观看视频在线| 久久久91精品国产一区二区精品| 夜夜爽夜夜爽精品视频| 国产一区二区主播在线| 成人app下载| 久久疯狂做爰流白浆xx| 91在线看国产| 精品卡一卡二卡三卡四在线| 亚洲视频一区二区在线观看| 另类欧美日韩国产在线| 在线观看91精品国产入口| 国产日韩欧美综合在线| 免费成人美女在线观看.| 94色蜜桃网一区二区三区| 日韩欧美视频在线| 亚洲在线观看免费| 99v久久综合狠狠综合久久| 日韩精品一区二区三区在线| 亚洲成人精品一区二区| 91日韩精品一区| 中文字幕免费不卡| 精油按摩中文字幕久久| 91精品国产色综合久久ai换脸| 亚洲欧美在线aaa| 国产麻豆视频一区| 日韩精品一区二区三区四区| 亚洲一区二区美女| 色老汉一区二区三区| 国产精品久久久久天堂| 激情综合色播五月| 欧美电影精品一区二区| 同产精品九九九| 欧美日韩日本视频| 亚洲福利视频一区| 日韩av二区在线播放| 日韩欧美高清在线| 亚洲超丰满肉感bbw| 91麻豆蜜桃一区二区三区| 国产日韩欧美综合在线| 国产在线精品视频| 久久午夜老司机| 国产白丝精品91爽爽久久 | 亚洲色图在线播放| 99视频精品在线|