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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? usbdrvasm16.s

?? avr單片機(jī)usb下載器的制作資料
?? S
?? 第 1 頁 / 共 2 頁
字號(hào):
/* Name: usbdrvasm16.S * Project: AVR USB driver * Author: Christian Starkjohann * Creation Date: 2007-06-15 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) * Revision: $Id$ *//* Do not link this file! Link usbdrvasm.S instead, which includes the * appropriate implementation! *//*General Description:This file is the 16 MHz version of the asssembler part of the USB driver. Itrequires a 16 MHz crystal (not a ceramic resonator and not a calibrated RCoscillator).See usbdrv.h for a description of the entire driver.Since almost all of this code is timing critical, don't change unless youreally know what you are doing! Many parts require not only a maximum numberof CPU cycles, but even an exact number of cycles!*/;max stack usage: [ret(2), YL, SREG, YH, bitcnt, shift, x1, x2, x3, x4, cnt] = 12 bytes;nominal frequency: 16 MHz -> 10.6666666 cycles per bit, 85.333333333 cycles per byte; Numbers in brackets are clocks counted from center of last sync bit; when instruction startsSIG_INTERRUPT0:;order of registers pushed: YL, SREG YH, [sofError], bitcnt, shift, x1, x2, x3, x4, cnt    push    YL                  ;[-25] push only what is necessary to sync with edge ASAP    in      YL, SREG            ;[-23]    push    YL                  ;[-22]    push    YH                  ;[-20];----------------------------------------------------------------------------; Synchronize with sync pattern:;----------------------------------------------------------------------------;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K];sync up with J to K edge during sync pattern -- use fastest possible loops;first part has no timeout because it waits for IDLE or SE1 (== disconnected)waitForJ:    sbis    USBIN, USBMINUS     ;[-18] wait for D- == 1    rjmp    waitForJwaitForK:;The following code results in a sampling window of < 1/4 bit which meets the spec.    sbis    USBIN, USBMINUS     ;[-15]    rjmp    foundK              ;[-14]    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    rjmp    sofErrorfoundK:                         ;[-12];{3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for center sampling];we have 1 bit time for setup purposes, then sample again. Numbers in brackets;are cycles from center of first sync (double K) bit after the instruction    push    bitcnt              ;[-12];   [---]                       ;[-11]    lds     YL, usbInputBufOffset;[-10];   [---]                       ;[-9]    clr     YH                  ;[-8]    subi    YL, lo8(-(usbRxBuf));[-7] [rx loop init]    sbci    YH, hi8(-(usbRxBuf));[-6] [rx loop init]    push    shift               ;[-5];   [---]                       ;[-4]    ldi     bitcnt, 0x55        ;[-3] [rx loop init]    sbis    USBIN, USBMINUS     ;[-2] we want two bits K (sample 2 cycles too early)    rjmp    haveTwoBitsK        ;[-1]    pop     shift               ;[0] undo the push from before    pop     bitcnt              ;[2] undo the push from before    rjmp    waitForK            ;[4] this was not the end of sync, retry; The entire loop from waitForK until rjmp waitForK above must not exceed two; bit times (= 21 cycles).;----------------------------------------------------------------------------; push more registers and initialize values while we sample the first bits:;----------------------------------------------------------------------------haveTwoBitsK:    push    x1              ;[1]    push    x2              ;[3]    push    x3              ;[5]    ldi     shift, 0        ;[7]    ldi     x3, 1<<4        ;[8] [rx loop init] first sample is inverse bit, compensate that    push    x4              ;[9] == leap    in      x1, USBIN       ;[11] <-- sample bit 0    andi    x1, USBMASK     ;[12]    bst     x1, USBMINUS    ;[13]    bld     shift, 7        ;[14]    push    cnt             ;[15]    ldi     leap, 0         ;[17] [rx loop init]    ldi     cnt, USB_BUFSIZE;[18] [rx loop init]    rjmp    rxbit1          ;[19] arrives at [21];----------------------------------------------------------------------------; Receiver loop (numbers in brackets are cycles within byte after instr);----------------------------------------------------------------------------unstuff6:    andi    x2, USBMASK ;[03]    ori     x3, 1<<6    ;[04] will not be shifted any more    andi    shift, ~0x80;[05]    mov     x1, x2      ;[06] sampled bit 7 is actually re-sampled bit 6    subi    leap, 3     ;[07] since this is a short (10 cycle) bit, enforce leap bit    rjmp    didUnstuff6 ;[08]unstuff7:    ori     x3, 1<<7    ;[09] will not be shifted any more    in      x2, USBIN   ;[00] [10]  re-sample bit 7    andi    x2, USBMASK ;[01]    andi    shift, ~0x80;[02]    subi    leap, 3     ;[03] since this is a short (10 cycle) bit, enforce leap bit    rjmp    didUnstuff7 ;[04]unstuffEven:    ori     x3, 1<<6    ;[09] will be shifted right 6 times for bit 0    in      x1, USBIN   ;[00] [10]    andi    shift, ~0x80;[01]    andi    x1, USBMASK ;[02]    breq    se0         ;[03]    subi    leap, 3     ;[04] since this is a short (10 cycle) bit, enforce leap bit    nop                 ;[05]    rjmp    didUnstuffE ;[06]unstuffOdd:    ori     x3, 1<<5    ;[09] will be shifted right 4 times for bit 1    in      x2, USBIN   ;[00] [10]    andi    shift, ~0x80;[01]    andi    x2, USBMASK ;[02]    breq    se0         ;[03]    subi    leap, 3     ;[04] since this is a short (10 cycle) bit, enforce leap bit    nop                 ;[05]    rjmp    didUnstuffO ;[06]rxByteLoop:    andi    x1, USBMASK ;[03]    eor     x2, x1      ;[04]    subi    leap, 1     ;[05]    brpl    skipLeap    ;[06]    subi    leap, -3    ;1 one leap cycle every 3rd byte -> 85 + 1/3 cycles per byte    nop                 ;1skipLeap:    subi    x2, 1       ;[08]    ror     shift       ;[09]didUnstuff6:    cpi     shift, 0xfc ;[10]    in      x2, USBIN   ;[00] [11] <-- sample bit 7    brcc    unstuff6    ;[01]    andi    x2, USBMASK ;[02]    eor     x1, x2      ;[03]    subi    x1, 1       ;[04]    ror     shift       ;[05]didUnstuff7:    cpi     shift, 0xfc ;[06]    brcc    unstuff7    ;[07]    eor     x3, shift   ;[08] reconstruct: x3 is 1 at bit locations we changed, 0 at others    st      y+, x3      ;[09] store datarxBitLoop:    in      x1, USBIN   ;[00] [11] <-- sample bit 0/2/4    andi    x1, USBMASK ;[01]    eor     x2, x1      ;[02]    andi    x3, 0x3f    ;[03] topmost two bits reserved for 6 and 7    subi    x2, 1       ;[04]    ror     shift       ;[05]    cpi     shift, 0xfc ;[06]    brcc    unstuffEven ;[07]didUnstuffE:    lsr     x3          ;[08]    lsr     x3          ;[09]rxbit1:    in      x2, USBIN   ;[00] [10] <-- sample bit 1/3/5    andi    x2, USBMASK ;[01]    breq    se0         ;[02]    eor     x1, x2      ;[03]    subi    x1, 1       ;[04]    ror     shift       ;[05]    cpi     shift, 0xfc ;[06]    brcc    unstuffOdd  ;[07]didUnstuffO:    subi    bitcnt, 0xab;[08] == addi 0x55, 0x55 = 0x100/3    brcs    rxBitLoop   ;[09]    subi    cnt, 1      ;[10]    in      x1, USBIN   ;[00] [11] <-- sample bit 6    brcc    rxByteLoop  ;[01]    rjmp    ignorePacket; overflow;----------------------------------------------------------------------------; Processing of received packet (numbers in brackets are cycles after center of SE0);----------------------------------------------------------------------------;This is the only non-error exit point for the software receiver loop;we don't check any CRCs here because there is no time left.#define token   x1se0:    subi    cnt, USB_BUFSIZE    ;[5]    neg     cnt                 ;[6]    cpi     cnt, 3              ;[7]    ldi     x2, 1<<USB_INTR_PENDING_BIT ;[8]    out     USB_INTR_PENDING, x2;[9] clear pending intr and check flag later. SE0 should be over.    brlo    doReturn            ;[10] this is probably an ACK, NAK or similar packet    sub     YL, cnt             ;[11]    sbci    YH, 0               ;[12]    ld      token, y            ;[13]    cpi     token, USBPID_DATA0 ;[15]    breq    handleData          ;[16]    cpi     token, USBPID_DATA1 ;[17]    breq    handleData          ;[18]    ldd     x2, y+1             ;[19] ADDR and 1 bit endpoint number    mov     x3, x2              ;[21] store for endpoint number    andi    x2, 0x7f            ;[22] x2 is now ADDR    lds     shift, usbDeviceAddr;[23]    cp      x2, shift           ;[25]overflow:                       ; This is a hack: brcs overflow will never have Z flag set    brne    ignorePacket        ;[26] packet for different address    cpi     token, USBPID_IN    ;[27]    breq    handleIn            ;[28]    cpi     token, USBPID_SETUP ;[29]    breq    handleSetupOrOut    ;[30]    cpi     token, USBPID_OUT   ;[31]    breq    handleSetupOrOut    ;[32];   rjmp    ignorePacket        ;fallthrough, should not happen anyway.ignorePacket:    clr     shift    sts     usbCurrentTok, shift

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看一区二区精品视频| 洋洋av久久久久久久一区| 精品国产一区二区国模嫣然| 国产欧美在线观看一区| 亚洲第一综合色| 白白色 亚洲乱淫| 精品国产电影一区二区| 国产精品乡下勾搭老头1| 欧美剧情电影在线观看完整版免费励志电影 | 国内外成人在线| 欧美亚洲国产一区二区三区va| 国产亚洲精品aa| 一区二区三区在线看| 93久久精品日日躁夜夜躁欧美| 久久久久久一二三区| 亚洲动漫第一页| 91麻豆精品在线观看| 久久九九影视网| 99re这里只有精品视频首页| 亚洲成人av福利| 26uuu亚洲| 国内精品国产成人| 亚洲欧洲美洲综合色网| 国产电影精品久久禁18| 精品福利一二区| 99re免费视频精品全部| 婷婷开心久久网| 欧美一区二区视频观看视频| 亚洲国产人成综合网站| 精品播放一区二区| 色婷婷久久99综合精品jk白丝| 中文字幕一区二区三区四区不卡| 欧美在线999| 国产美女精品一区二区三区| www成人在线观看| 99久久99久久久精品齐齐| 日本在线播放一区二区三区| 欧美丝袜自拍制服另类| 国产精品一线二线三线| 亚洲一区二区三区四区五区黄| 一本久久综合亚洲鲁鲁五月天| 男女男精品网站| 日韩欧美成人午夜| 精品一区二区三区在线观看| 久久午夜羞羞影院免费观看| 色偷偷88欧美精品久久久| 国精产品一区一区三区mba视频 | 韩国欧美国产1区| 悠悠色在线精品| 欧美卡1卡2卡| 91久久香蕉国产日韩欧美9色| 一个色妞综合视频在线观看| 久久久久久久久久久久久夜| 欧美日韩1234| 国产精品996| 三级亚洲高清视频| 欧美精品一区二区三区一线天视频 | 成人激情文学综合网| 亚洲精品视频自拍| 国产丝袜在线精品| 日韩欧美国产麻豆| 欧美老肥妇做.爰bbww视频| 99re成人精品视频| 不卡av在线免费观看| 国产久卡久卡久卡久卡视频精品| 蜜臀久久99精品久久久画质超高清 | 欧美videossexotv100| 国产曰批免费观看久久久| 亚洲福利视频一区| 亚洲免费资源在线播放| 日韩欧美自拍偷拍| 国产精品1024| 久久国产精品色婷婷| 亚洲人成网站精品片在线观看| 国产日韩欧美a| 久久嫩草精品久久久精品一| 欧美r级在线观看| 日韩视频一区二区三区| 日韩三级视频在线观看| 日韩一级完整毛片| 蜜臀精品久久久久久蜜臀 | 亚洲va韩国va欧美va精品| 99国产欧美另类久久久精品| 成人免费视频视频在线观看免费| 日韩午夜在线观看| 精品少妇一区二区三区日产乱码| 337p亚洲精品色噜噜噜| 成人性生交大片免费看中文网站| 国产夫妻精品视频| a在线欧美一区| 91片黄在线观看| 欧美视频日韩视频在线观看| 欧美福利一区二区| 亚洲精品在线观看网站| 国产日韩av一区二区| 国产精品久久久久精k8 | 欧美日韩国产美| 91精品国产乱| 欧美二区三区91| 亚洲美女屁股眼交| 亚洲视频一区二区在线| 国产精品一区二区黑丝| 美国毛片一区二区| 国产高清精品久久久久| 成人一区二区三区视频 | 亚洲综合区在线| 亚洲高清视频中文字幕| 蜜桃av噜噜一区二区三区小说| 黄色精品一二区| 成人av电影在线观看| 欧洲av一区二区嗯嗯嗯啊| 337p亚洲精品色噜噜| 国产人成亚洲第一网站在线播放 | 91精选在线观看| 日本一二三不卡| 精品理论电影在线观看| 国产精品传媒视频| 午夜精品久久久久久久| 国产精品正在播放| 精品视频一区二区三区免费| 色丁香久综合在线久综合在线观看| 欧美日韩精品免费| 国产精品系列在线| 中文字幕在线一区免费| 五月天久久比比资源色| 国产精品99久| 91麻豆精品国产综合久久久久久 | 久久日韩粉嫩一区二区三区 | 一道本成人在线| 欧美mv日韩mv国产网站app| 自拍偷拍欧美激情| 久久成人免费日本黄色| 在线视频亚洲一区| 国产丝袜美腿一区二区三区| 午夜精彩视频在线观看不卡| 丁香婷婷综合网| 波波电影院一区二区三区| 91精品婷婷国产综合久久性色 | 99视频在线精品| 日韩精品一区二区在线| 一区二区在线观看av| 国产激情视频一区二区在线观看| 欧美日韩成人综合| 国产精品久久久久久久裸模| 麻豆精品一区二区三区| 欧美午夜精品免费| 中文字幕中文字幕一区| 夫妻av一区二区| 精品少妇一区二区三区视频免付费| 亚洲国产精品久久人人爱蜜臀| 国产999精品久久久久久绿帽| 欧美一级黄色大片| 亚洲亚洲人成综合网络| 色婷婷av一区二区三区gif| 国产欧美日韩三级| 国产美女在线精品| 精品少妇一区二区| 婷婷综合五月天| 欧美日韩的一区二区| 亚洲与欧洲av电影| 日本国产一区二区| 日韩码欧中文字| 99精品视频在线播放观看| 中文无字幕一区二区三区| 日韩视频一区二区在线观看| 51精品秘密在线观看| 久久综合九色综合欧美就去吻| 亚洲成人黄色影院| 欧美三电影在线| 亚洲图片一区二区| 欧美午夜精品一区二区三区| 夜夜精品浪潮av一区二区三区| 99这里都是精品| 一级中文字幕一区二区| 日本高清成人免费播放| 亚洲色图一区二区| 欧美中文字幕一区| 天天av天天翘天天综合网| 精品视频一区二区三区免费| 亚洲国产视频一区二区| 欧美丝袜丝交足nylons| 日韩黄色一级片| 欧美一级搡bbbb搡bbbb| 精品亚洲免费视频| 国产三区在线成人av| av在线不卡电影| 亚洲国产一区视频| 911精品国产一区二区在线| 蜜桃视频一区二区| 精品国产亚洲一区二区三区在线观看| 韩国精品在线观看| 国产精品午夜在线| 欧美性大战久久久久久久蜜臀| 亚洲成av人片| 精品毛片乱码1区2区3区| 国产成人a级片| 一区二区三区成人| 91精品国产综合久久精品| 精品在线视频一区| 中文字幕一区二区三区在线不卡|