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

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

?? usbdrv.h

?? USB programmer For 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一区二区三区免费野_久草精品视频
欧美精品v日韩精品v韩国精品v| 久久精品夜色噜噜亚洲aⅴ| 亚洲女与黑人做爰| 欧美亚州韩日在线看免费版国语版 | 欧美大肚乱孕交hd孕妇| 经典三级在线一区| 欧美国产禁国产网站cc| 欧美日韩三级一区| 国产中文字幕精品| 樱花影视一区二区| 久久综合丝袜日本网| 精品视频资源站| 成人丝袜视频网| 日韩高清不卡一区| 一区二区三区在线高清| 欧美zozo另类异族| 欧美午夜电影在线播放| 国产.欧美.日韩| 免费成人在线播放| 日韩成人免费看| 亚洲激情图片qvod| 亚洲欧美激情小说另类| 久久综合999| 久久网站最新地址| 欧美成人bangbros| 欧美一级搡bbbb搡bbbb| 欧美日韩的一区二区| 色999日韩国产欧美一区二区| 成人av在线资源| 成人性生交大片免费看中文网站| 国产一区二区三区四区五区入口| 日本一道高清亚洲日美韩| 亚洲国产一二三| 亚洲午夜激情av| 首页亚洲欧美制服丝腿| 偷拍一区二区三区| 看电视剧不卡顿的网站| 另类欧美日韩国产在线| 国产精品一线二线三线| 国产精品白丝jk白祙喷水网站| 国产精品一区免费视频| 成人黄色国产精品网站大全在线免费观看| 国产午夜精品久久久久久免费视| 日韩欧美一区二区在线视频| 日韩一区二区精品| 综合婷婷亚洲小说| 天天免费综合色| 国产高清不卡二三区| 在线观看亚洲精品| 欧美成人精品二区三区99精品| 国产精品国产自产拍高清av王其| 亚洲免费观看高清完整版在线观看 | 日韩极品在线观看| 成人18视频在线播放| 日韩欧美www| 一区二区三区日本| 国产一区在线不卡| 在线观看91精品国产入口| 欧美成人精品3d动漫h| 亚洲成a人v欧美综合天堂下载 | 97久久精品人人做人人爽50路 | 欧美视频完全免费看| 精品理论电影在线| 亚洲成av人**亚洲成av**| 成人中文字幕在线| 欧美激情一区三区| 懂色av中文字幕一区二区三区| 欧美性色综合网| 亚洲sss视频在线视频| 91蜜桃网址入口| 亚洲人快播电影网| 成人a级免费电影| 亚洲色图.com| 色婷婷综合久久久久中文一区二区| 国产亚洲1区2区3区| 国产尤物一区二区| 国产精品青草久久| 成人性生交大合| 一区二区三区在线观看动漫 | 欧美一区永久视频免费观看| 亚洲国产日韩av| 日韩精品中文字幕一区二区三区 | 欧美人与禽zozo性伦| 亚洲成在人线在线播放| 欧美一区二区三区播放老司机| 亚洲成人激情自拍| 久久精品日产第一区二区三区高清版 | 美日韩一区二区三区| 精品久久久久久久久久久院品网| 国产一级精品在线| 国产精品福利在线播放| 欧美高清性hdvideosex| 国产一区二区三区香蕉| 综合久久久久久久| 亚洲天堂网中文字| 欧美一区二区三区在线观看| 成人国产精品免费| 日本色综合中文字幕| 亚洲色图欧洲色图婷婷| 日韩美女天天操| 日本电影亚洲天堂一区| 国产成人av资源| 免费看日韩精品| 亚洲国产一区二区三区| 国产精品久久久久久福利一牛影视| 欧美日韩在线观看一区二区 | 日本三级亚洲精品| 亚洲国产日韩a在线播放性色| 国产精品美女久久久久久久 | 国产成人鲁色资源国产91色综| 亚洲专区一二三| 一级中文字幕一区二区| 国产精品电影一区二区三区| www成人在线观看| 欧美mv日韩mv国产网站| 91精品国模一区二区三区| 欧美三级电影精品| 欧美在线不卡视频| 在线观看视频一区二区| 91麻豆福利精品推荐| 91麻豆国产自产在线观看| 色嗨嗨av一区二区三区| 一本在线高清不卡dvd| 99久久婷婷国产综合精品电影| 成人国产亚洲欧美成人综合网| 成人一二三区视频| 91丨porny丨在线| 欧美日韩精品综合在线| 欧美一级国产精品| 2020国产精品久久精品美国| 国产亚洲精品中文字幕| 亚洲日本在线看| 五月婷婷色综合| 国产suv精品一区二区6| 欧美伊人久久久久久午夜久久久久| 欧美调教femdomvk| 亚洲精品一区二区三区精华液 | 久久精品亚洲一区二区三区浴池 | 综合色中文字幕| 色一情一伦一子一伦一区| 在线亚洲免费视频| 久久综合999| 奇米影视一区二区三区| 成人深夜视频在线观看| 制服丝袜亚洲网站| 亚洲午夜国产一区99re久久| 国产主播一区二区| 欧美精选一区二区| 一区二区三区在线观看网站| 国产一区二区在线免费观看| 欧美一区二区在线播放| 日韩毛片视频在线看| 波多野结衣中文字幕一区| 欧美哺乳videos| 精品夜夜嗨av一区二区三区| 欧美视频三区在线播放| 亚洲视频免费看| 色综合色综合色综合 | 国产三级精品视频| 国产在线精品一区在线观看麻豆| 欧美精品免费视频| 奇米影视一区二区三区| 久久久久久久久岛国免费| 国产乱国产乱300精品| 久久九九久久九九| 91看片淫黄大片一级| 亚洲成人自拍偷拍| 久久综合色婷婷| 色综合天天综合给合国产| 亚洲一区在线电影| 欧美va亚洲va在线观看蝴蝶网| 国产美女av一区二区三区| 亚洲婷婷综合久久一本伊一区| 91精品1区2区| 国产剧情一区二区| 亚洲精品国产精品乱码不99| 日韩亚洲欧美高清| 色狠狠一区二区三区香蕉| 天天综合日日夜夜精品| 国产精品免费久久久久| 这里只有精品免费| 色嗨嗨av一区二区三区| 国产成人综合视频| 奇米一区二区三区av| 中文字幕一区二区三区不卡在线| 91 com成人网| 色婷婷综合在线| 成人精品一区二区三区中文字幕| 日韩电影在线免费观看| 亚洲成人动漫精品| 一区二区三区免费网站| 亚洲国产cao| 亚洲丝袜美腿综合| 国产精品麻豆视频| 国产精品久久二区二区| 国产欧美日韩精品一区| 国产亚洲成av人在线观看导航 | 精品国内二区三区| 精品日本一线二线三线不卡| 日韩久久精品一区|