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

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

?? usbdrv.h

?? USB-ASP下載線的制作完整資料,搞AVR的人是必須的
?? H
字號:
/* Name: usbdrv.h * Project: AVR USB driver * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: Proprietary, free under certain conditions. See Documentation. * This Revision: $Id: usbdrv.h 52 2005-04-12 16:57:29Z cs $ */#ifndef __usbdrv_h_included__#define	__usbdrv_h_included__#include "usbconfig.h"/*Hardware Prerequisites:=======================USB lines D+ and D- MUST be wired to the same I/O port. Line D- MUST be wiredto bit number 0. D+ must also be connected to INT0. D- requires a pullup of1.5k to +3.5V (and the device must be powered at 3.5V) to identify aslow-speed USB device. A pullup of 1M SHOULD be connected from D+ to +3.5V toprevent interference when no USB master is connected. We use D+ as interruptsource and not D- because it does not trigger on keep-alive and RESET states.Please adapt the values in usbconfig.h according to your hardware!The device MUST be clocked at 12 MHz. This is more than the 10 MHz allowed byan AT90S2313 powered at 4.5V. However, if the supply voltage to maximum clockrelation is interpolated linearly, an ATtiny2313 meets the requirement byspecification. In practice, the AT90S2313 can be overclocked and works well.Limitations:============Compiling:The bss segment of the driver must be in the first 256 bytes of the addressspace because byte wide variables are used as pointers for efficiency reasons.This is not a problem on devices with 128 byte RAM since the entire RAMmeets this condition. For larger devices please link usbdrv first.Robustness with respect to communication errors:The driver assumes error-free communication. It DOES check for errors inthe PID, but does NOT check bit stuffing errors, SE0 in middle of a byte,token CRC (5 bit) and data CRC (16 bit). CRC checks can not be performed dueto timing constraints: We must start sending a reply within 7 bit times. Bit stuffing and misplaced SE0 would have to be checked in real-time, but CPUperformance does not permit that. The driver does not check Data0/Data1toggling, but application software can implement the check.Sampling jitter:The driver guarantees a sampling window of 1/2 bit. The USB spec requiresthat the receiver has at most 1/4 bit sampling window. The 1/2 bit windowshould still work reliably enough because we work at low speed. If you wantto meet the spec, define the macro "USB_CFG_SAMPLE_EXACT" to 1 in usbconfig.h.This will unroll a loop which results in bigger code size.Input characteristics:Since no differential receiver circuit is used, electrical interferencerobustness may suffer. The driver samples only one of the data lines withan ordinary I/O pin's input characteristics. However, since this is only alow speed USB implementation and the specification allows for 8 times thebit rate over the same hardware, we should be on the safe side. Even the specrequires detection of asymmetric states at high bit rate for SE0 detection.Number of endpoints:The driver supports up to two endpoints: One control endpoint (endpoint 0) andone interrupt-in endpoint (endpoint 1) where the device can send interruptdata to the host. Endpoint 1 is only compiled in ifUSB_CFG_HAVE_INTRIN_ENDPOINT is defined to 1 in usbconfig.h.Maximum data payload:Data payload of control in and out transfers may be up to 255 bytes. In orderto accept payload data of out transfers, you need to implement'usbFunctionWrite()'.USB Suspend Mode supply current:The USB standard limits power consumption to 500uA when the bus is in suspendmode. This is not a problem for self-powered devices since they don't needbus power anyway. Bus-powered devices can achieve this only by putting theCPU in sleep mode. The driver does not implement suspend handling by itself.However, the application may implement activity monitoring and wakeup fromsleep. The host sends regular SE0 states on the bus to keep it active. TheseSE0 states can be detected by wiring the INT1 pin to D+. It is not necessaryto enable the interrupt, checking the interrupt pending flag should suffice.Before entering sleep mode, the application should enable INT1 for a wakeupon the next bus activity.Operation without an USB master:The driver behaves neutral without connection to an USB master if D- readsas 1. To avoid spurious interrupts, we recommend a high impedance (e.g. 1M)pullup resistor on D+. If D- becomes statically 0, the driver may block inthe interrupt routine.Interrupt latency:The application must ensure that the USB interrupt is not disabled for morethan 20 cycles.Maximum interrupt duration / CPU cycle consumption:The driver handles all USB communication during the interrupt serviceroutine. The routine will not return before an entire USB message is receivedand the reply is sent. This may be up to ca. 1200 cycles = 100us if the hostconforms to the standard. The driver will consume CPU cycles for all USBmessages, even if they address an other (low-speed) device on the same bus.*//* ------------------------------------------------------------------------- *//* --------------------------- Module Interface ---------------------------- *//* ------------------------------------------------------------------------- */#ifndef __ASSEMBLER__#ifndef uchar#define	uchar	unsigned char#endif#if USB_CFG_HAVE_INTRIN_ENDPOINTvoid	usbSetInterrupt(uchar *data, uchar len);/* This function sets the message which will be sent during the next interrupt * IN transfer. The message is copied to an internal buffer and must not exceed * a length of 7 bytes. The message may be 0 bytes long just to indicate the * interrupt status to the host. * If you need to transfer more bytes, use a control read after the interrupt. */#endif /* USB_CFG_HAVE_INTRIN_ENDPOINT */extern void		usbInit(void);/* This function must be called before interrupts are enabled and the main * loop is entered. */extern void		usbPoll(void);/* This function must be called at regular intervals from the main loop. * Maximum delay between calls is somewhat less than 50ms (USB timeout between * packages of a message). */extern uchar	*usbMsgPtr;/* This variable may be used to pass transmit data to the driver from the * implementation of usbFunctionWrite(). It is also used internally by the * driver for standard control requests. */ extern uchar	usbFunctionSetup(uchar data[8]);/* This function is called for all setup requests which are not of type * "Standard" (in practice: class and vendor requests). The 8 bytes setup * data is passed in 'data'. Data for control-out transfers is passed to the * application in separate calls to usbFunctionWrite() (unless you have turned * this option off). You should store the setup context in global/static * variables to have it available in usbFunctionWrite(). Data for control-in * transfers can be provided in two ways: (1) immediately as a result of * usbFunctionSetup() or (2) on demand of the driver in calls to the separate * function usbFunctionRead() (if enabled). For (1) write the data to a static * buffer, set the global variable 'usbMsgPtr' to this buffer and return the * data length (may be 0). To implement (2), simply return 0xff (== -1) in * usbFunctionSetup(). The driver will call usbFunctionRead() when data is * needed. You may use 'usbMsgPtr' to save your own status in this case. * The data passed in 'data' has the following content (see USB 1.1 spec): *	struct usbControlData{ *		uchar		requestType;	//[0] *		uchar		request;		//[1] *		unsigned	value;			//[2], [3] *		unsigned	index;			//[4], [5] *		unsigned	length;			//[6], [7] *	}; */#if USB_CFG_IMPLEMENT_FN_WRITEextern uchar	usbFunctionWrite(uchar *data, uchar len);/* This function is called by the driver to provide a control transfer's * payload data (control-out). It is called in chunks of up to 8 bytes. The * total count provided in the current control transfer can be obtained from * the 'length' property in the setup data. If an error occurred during * processing, return 0xff (== -1). The driver will answer the entire transfer * with a STALL token in this case. Otherwise return any number which is not * 0xff. NOTE: Only the return value of the LAST usbFunctionWrite() call * (the one immediately before the status phase) is used. */#endif /* USB_CFG_IMPLEMENT_FN_WRITE */#if USB_CFG_IMPLEMENT_FN_READextern uchar usbFunctionRead(uchar *data, uchar len);/* This function is called by the driver to ask the application for a control * transfer's payload data (control-in). You should supply up to 'len' bytes of * data in this chunk. 'len' will be 8 bytes for all but the last chunk. If * you return less than 8 bytes, the control transfer ends. If you return an * invalid value (e.g. -1), the driver sends a STALL token. */#endif /* USB_CFG_IMPLEMENT_FN_READ */extern unsigned	usbCrc16(uchar *data, uchar len);/* This function calculates the binary complement of the data CRC used in * USB data packets. The value is used to build raw transmit packets. * You may want to use this function for data checksums. */#endif	/* __ASSEMBLER__ *//* ------------------------------------------------------------------------- *//* ------------------------- Constant definitions -------------------------- *//* ------------------------------------------------------------------------- *//* I/O definitions for assembler module */#define	USBOUT		USB_CFG_IOPORT			/* output port for USB bits */#ifdef __ASSEMBLER__#define	USBIN		(USB_CFG_IOPORT - 2)	/* input port for USB bits */#define	USBDDR		(USB_CFG_IOPORT - 1)	/* data direction for USB bits */#else#define	USBIN		(*(&USB_CFG_IOPORT - 2))	/* input port for USB bits */#define	USBDDR		(*(&USB_CFG_IOPORT - 1))	/* data direction for USB bits */#endif#if USB_CFG_DMINUS_BIT != 0#	error "USB_CFG_DMINUS_BIT MUST be 0!"#endif#define	USBMINUS	0		/* D- MUST be on bit 0 */#define	USBIDLE		0x01	/* value representing J state */#define	USBMASK		((1<<USB_CFG_DPLUS_BIT) | 1)	/* mask for USB I/O bits */#define	USB_BUFSIZE		11	/* PID, 8 bytes data, 2 bytes CRC *//* Try to find registers and bits responsible for ext interrupt 0 */#if defined EICRA#	define	USB_INTR_CFG	EICRA#else#	define	USB_INTR_CFG	MCUCR#endif#define	USB_INTR_CFG_SET	((1 << ISC00) | (1 << ISC01))	/* cfg for rising edge */#define	USB_INTR_CFG_CLR	0	/* no bits to clear */#if defined GIMSK#	define	USB_INTR_ENABLE		GIMSK#elif defined EIMSK#	define	USB_INTR_ENABLE		EIMSK#else#	define	USB_INTR_ENABLE		GICR#endif#define	USB_INTR_ENABLE_BIT		INT0#if defined EIFR#	define	USB_INTR_PENDING	EIFR#else#	define	USB_INTR_PENDING	GIFR#endif#define	USB_INTR_PENDING_BIT	INTF0/*The defines above don't work for the following chipsat90c8534: no ISC0?, no PORTB, can't find a data sheetat86rf401: no PORTB, no MCUCR etcatmega103: no ISC0? (maybe omission in header, can't find data sheet)atmega603: not defined in avr-libcat43usb320, at43usb355, at76c711: have USB anywayat94k: is different...at90s1200, attiny11, attiny12, attiny15, attiny28: these have no RAM*//* ------------------------------------------------------------------------- *//* ---------------------- USB Specification Constants ---------------------- *//* ------------------------------------------------------------------------- *//* USB Token values */#define	USBPID_SETUP	0x2d#define	USBPID_OUT		0xe1#define	USBPID_IN		0x69#define	USBPID_DATA0	0xc3#define	USBPID_DATA1	0x4b#define	USBPID_ACK		0xd2#define	USBPID_NAK		0x5a#define	USBPID_STALL	0x1e/* USB descriptor constants */#define	USBATTR_BUSPOWER	0x80#define	USBATTR_SELFPOWER	0x40#define	USBATTR_REMOTEWAKE	0x20/* USB setup recipient values */#define	USBRQ_RCPT_DEVICE		0#define	USBRQ_RCPT_INTERFACE	1#define	USBRQ_RCPT_ENDPOINT		2/* USB request type values */#define	USBRQ_TYPE_STANDARD		0#define	USBRQ_TYPE_CLASS		1#define	USBRQ_TYPE_VENDOR		2/* ------------------------------------------------------------------------- */#endif /* __usbdrv_h_included__ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费亚洲电影| 成人激情综合网站| 亚洲一区视频在线| 综合亚洲深深色噜噜狠狠网站| 欧美精品一区男女天堂| 91麻豆精品国产自产在线观看一区| 91福利视频网站| 色婷婷久久99综合精品jk白丝| 99国内精品久久| 91麻豆自制传媒国产之光| 91网页版在线| 欧美日韩久久一区二区| 欧美三级电影一区| 日韩欧美中文字幕精品| 精品国产亚洲一区二区三区在线观看| 欧美成人vr18sexvr| 国产亚洲一区二区三区在线观看| 国产欧美精品一区aⅴ影院| 中文字幕精品三区| 亚洲综合免费观看高清完整版在线| 亚洲欧美另类久久久精品| 一区二区三区免费看视频| 五月激情综合网| 久久精品国产精品亚洲红杏| 国产高清亚洲一区| 日本高清不卡视频| 欧美大黄免费观看| 国产精品成人网| 视频一区欧美精品| 国产sm精品调教视频网站| 日本电影亚洲天堂一区| 制服丝袜亚洲精品中文字幕| 国产欧美日韩在线观看| 亚洲最大色网站| 国产在线精品一区二区不卡了| 播五月开心婷婷综合| 欧美日韩国产首页在线观看| 久久久精品欧美丰满| 亚洲精品欧美二区三区中文字幕| 日本 国产 欧美色综合| 成人小视频免费在线观看| 在线观看91视频| 久久久久99精品国产片| 亚洲成人激情综合网| 成人午夜激情影院| 欧美一级免费观看| 亚洲欧美色一区| 狠狠久久亚洲欧美| 欧美色爱综合网| 国产午夜精品一区二区三区嫩草| 亚洲成人777| av网站一区二区三区| 日韩欧美国产电影| 一区二区三区高清在线| 成人性生交大片免费看视频在线| 欧美一区二区在线播放| 一区二区三区电影在线播| 国产成人高清在线| 亚洲精品一区二区三区精华液| 亚洲综合激情另类小说区| 成人激情电影免费在线观看| 日韩欧美国产三级| 性欧美疯狂xxxxbbbb| 欧美亚洲综合色| 亚洲色大成网站www久久九九| 国产激情一区二区三区| 欧美变态凌虐bdsm| 麻豆精品国产传媒mv男同| 欧美午夜一区二区| 亚洲国产wwwccc36天堂| 色综合久久综合| 亚洲桃色在线一区| 99天天综合性| 中文字幕五月欧美| 99精品久久免费看蜜臀剧情介绍| 国产午夜一区二区三区| 国产精品夜夜嗨| 国产亚洲午夜高清国产拍精品| 久久国产精品色婷婷| 欧美大片在线观看一区二区| 日本vs亚洲vs韩国一区三区二区 | 亚洲一区二区在线免费观看视频| a4yy欧美一区二区三区| 国产精品久久毛片a| 成人在线综合网站| 国产精品第一页第二页第三页| 国产不卡视频一区| 国产精品久久久久一区| 91小视频在线| 一区2区3区在线看| 91精品国产综合久久精品图片| 日韩精品高清不卡| 精品成人一区二区| 粉嫩av一区二区三区在线播放| 欧美国产亚洲另类动漫| 色综合激情久久| 亚洲国产成人高清精品| 日韩欧美国产午夜精品| 丁香天五香天堂综合| 国产精品久久久久久久久图文区 | 欧美r级电影在线观看| 久久精品免费看| 亚洲国产精品成人综合| 99re成人精品视频| 视频一区在线播放| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲国产精品成人综合| 国产福利一区二区三区在线视频| 26uuu国产在线精品一区二区| 国产精品一品二品| 一区二区在线看| 日韩你懂的在线播放| 成人毛片在线观看| 亚洲高清免费观看| 欧美激情一区在线观看| 欧美日韩高清不卡| 成人性生交大片免费看视频在线| 一区二区三区不卡视频在线观看| 日韩免费观看高清完整版| www.亚洲激情.com| 精品午夜久久福利影院| 日韩伦理电影网| www日韩大片| 欧美日韩小视频| 成人av先锋影音| 国产在线不卡一区| 日本欧美肥老太交大片| 国产精品不卡在线| 精品久久人人做人人爽| 欧美专区在线观看一区| 成人三级在线视频| 久久精品国产99国产精品| 亚洲综合久久久| 中文一区二区在线观看| 精品不卡在线视频| 欧美久久久久久蜜桃| 91福利小视频| 成人app网站| 国产91综合网| 国产精品99久久久久久久女警| 青青草精品视频| 午夜精品免费在线| 亚洲二区在线观看| 亚洲成人资源网| 一区二区在线观看不卡| √…a在线天堂一区| 国产欧美日韩在线| 久久精品亚洲乱码伦伦中文| 欧美成人官网二区| 欧美xxx久久| 精品国产区一区| 精品少妇一区二区三区在线播放 | 91在线免费看| av电影在线观看不卡| 成人av影院在线| 成人国产精品免费观看动漫| 成人午夜又粗又硬又大| 懂色av噜噜一区二区三区av| 国产福利精品一区| 成人理论电影网| 色美美综合视频| 欧美亚洲综合另类| 在线播放91灌醉迷j高跟美女 | 综合久久综合久久| 久久9热精品视频| 亚洲国产精品精华液网站| 亚洲va天堂va国产va久| 亚洲精品国产一区二区精华液 | 五月综合激情网| 日韩成人午夜电影| 麻豆高清免费国产一区| 国产精品一区二区三区网站| 成人性生交大片免费看中文| 91小视频在线| 欧美一区二区三区色| 欧美成人精品3d动漫h| 欧美激情一区二区| 亚洲精品国产视频| 蜜臀久久久久久久| 国产成人精品免费网站| 欧美亚洲一区二区三区四区| 91精品国产综合久久香蕉麻豆| 精品欧美久久久| 综合在线观看色| 国产成人综合自拍| 国产欧美va欧美不卡在线 | 久久机这里只有精品| 国产一区二区三区在线观看免费视频| 成人在线综合网站| 欧美伦理视频网站| 久久一夜天堂av一区二区三区| 中文字幕一区二区三| 午夜欧美一区二区三区在线播放| 美女网站色91| 色999日韩国产欧美一区二区| 欧美一区二区在线视频| 亚洲视频在线一区| 精品一区二区三区免费| 91高清视频在线| 国产欧美综合色|