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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? usbdrvasm.s

?? 可用來(lái)自做的AVR-USB-ISP的源碼,內(nèi)符電路圖,用AVR M8來(lái)模擬USB接口
?? S
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* Name: usbdrvasm.S * Project: AVR USB driver * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) * This Revision: $Id: usbdrvasm.S 275 2007-03-20 09:58:28Z cs $ *//*General Description:This module implements the assembler part of the USB driver. See usbdrv.hfor 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!Timing constraints according to spec (in bit times):timing subject                                      min max    CPUcycles---------------------------------------------------------------------------EOP of OUT/SETUP to sync pattern of DATA0 (both rx) 2   16     16-128EOP of IN to sync pattern of DATA0 (rx, then tx)    2   7.5    16-60DATAx (rx) to ACK/NAK/STALL (tx)                    2   7.5    16-60*/#include "iarcompat.h"#ifndef __IAR_SYSTEMS_ASM__    /* configs for io.h */#   define __SFR_OFFSET 0#   define _VECTOR(N)   __vector_ ## N   /* io.h does not define this for asm */#   include <avr/io.h> /* for CPU I/O register definitions and vectors */#endif  /* __IAR_SYSTEMS_ASM__ */#include "usbdrv.h" /* for common defs *//* register names */#define x1      r16#define x2      r17#define shift   r18#define cnt     r19#define x3      r20#define x4      r21/* Some assembler dependent definitions and declarations: */#ifdef __IAR_SYSTEMS_ASM__#   define nop2     rjmp    $+2 /* jump to next instruction */#   define XL       r26#   define XH       r27#   define YL       r28#   define YH       r29#   define ZL       r30#   define ZH       r31#   define lo8(x)   LOW(x)#   define hi8(x)   ((x)>>8)    /* not HIGH to allow XLINK to make a proper range check */    extern  usbRxBuf, usbDeviceAddr, usbNewDeviceAddr, usbInputBufOffset    extern  usbCurrentTok, usbRxLen, usbRxToken, usbTxLen    extern  usbTxBuf, usbMsgLen, usbTxLen1, usbTxBuf1, usbTxLen3, usbTxBuf3    public  usbCrc16    public  usbCrc16Append    COMMON  INTVEC    ORG     INT0_vect    rjmp    SIG_INTERRUPT0    RSEG    CODE#else /* __IAR_SYSTEMS_ASM__ */#   define nop2     rjmp    .+0 /* jump to next instruction */    .text    .global SIG_INTERRUPT0    .type   SIG_INTERRUPT0, @function    .global usbCrc16    .global usbCrc16Append#endif /* __IAR_SYSTEMS_ASM__ */;Software-receiver engine. Strict timing! Don't change unless you can preserve timing!;interrupt response time: 4 cycles + insn running = 7 max if interrupts always enabled;max allowable interrupt latency: 34 cycles -> max 25 cycles interrupt disable;max stack usage: [ret(2), YL, SREG, YH, shift, x1, x2, x3, cnt, x4] = 11 bytes;Numbers in brackets are maximum cycles since SOF.SIG_INTERRUPT0:;order of registers pushed: YL, SREG [sofError], YH, shift, x1, x2, x3, cnt    push    YL              ;2 [35] push only what is necessary to sync with edge ASAP    in      YL, SREG        ;1 [37]    push    YL              ;2 [39];----------------------------------------------------------------------------; 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 ;1 [40] wait for D- == 1    rjmp    waitForJ        ;2waitForK:;The following code results in a sampling window of 1/4 bit which meets the spec.    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:;{3, 5} after falling D- edge, average delay: 4 cycles [we want 4 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    YH                  ;2 [2]    lds     YL, usbInputBufOffset;2 [4]    clr     YH                  ;1 [5]    subi    YL, lo8(-(usbRxBuf));1 [6]    sbci    YH, hi8(-(usbRxBuf));1 [7]    sbis    USBIN, USBMINUS ;1 [8] we want two bits K [sample 1 cycle too early]    rjmp    haveTwoBitsK    ;2 [10]    pop     YH              ; undo the push from before    rjmp    waitForK        ; this was not the end of sync, retryhaveTwoBitsK:;----------------------------------------------------------------------------; push more registers and initialize values while we sample the first bits:;----------------------------------------------------------------------------    push    shift           ;2 [16]    push    x1              ;2 [12]    push    x2              ;2 [14]    in      x1, USBIN       ;1 [17] <-- sample bit 0    ldi     shift, 0xff     ;1 [18]    bst     x1, USBMINUS    ;1 [19]    bld     shift, 0        ;1 [20]    push    x3              ;2 [22]    push    cnt             ;2 [24]        in      x2, USBIN       ;1 [25] <-- sample bit 1    ser     x3              ;1 [26] [inserted init instruction]    eor     x1, x2          ;1 [27]    bst     x1, USBMINUS    ;1 [28]    bld     shift, 1        ;1 [29]    ldi     cnt, USB_BUFSIZE;1 [30] [inserted init instruction]    rjmp    rxbit2          ;2 [32];----------------------------------------------------------------------------; Receiver loop (numbers in brackets are cycles within byte after instr);----------------------------------------------------------------------------unstuff0:               ;1 (branch taken)    andi    x3, ~0x01   ;1 [15]    mov     x1, x2      ;1 [16] x2 contains last sampled (stuffed) bit    in      x2, USBIN   ;1 [17] <-- sample bit 1 again    ori     shift, 0x01 ;1 [18]    rjmp    didUnstuff0 ;2 [20]unstuff1:               ;1 (branch taken)    mov     x2, x1      ;1 [21] x1 contains last sampled (stuffed) bit    andi    x3, ~0x02   ;1 [22]    ori     shift, 0x02 ;1 [23]    nop                 ;1 [24]    in      x1, USBIN   ;1 [25] <-- sample bit 2 again    rjmp    didUnstuff1 ;2 [27]unstuff2:               ;1 (branch taken)    andi    x3, ~0x04   ;1 [29]    ori     shift, 0x04 ;1 [30]    mov     x1, x2      ;1 [31] x2 contains last sampled (stuffed) bit    nop                 ;1 [32]    in      x2, USBIN   ;1 [33] <-- sample bit 3    rjmp    didUnstuff2 ;2 [35]unstuff3:               ;1 (branch taken)    in      x2, USBIN   ;1 [34] <-- sample stuffed bit 3 [one cycle too late]    andi    x3, ~0x08   ;1 [35]    ori     shift, 0x08 ;1 [36]    rjmp    didUnstuff3 ;2 [38]unstuff4:               ;1 (branch taken)    andi    x3, ~0x10   ;1 [40]    in      x1, USBIN   ;1 [41] <-- sample stuffed bit 4    ori     shift, 0x10 ;1 [42]    rjmp    didUnstuff4 ;2 [44]unstuff5:               ;1 (branch taken)    andi    x3, ~0x20   ;1 [48]    in      x2, USBIN   ;1 [49] <-- sample stuffed bit 5    ori     shift, 0x20 ;1 [50]    rjmp    didUnstuff5 ;2 [52]unstuff6:               ;1 (branch taken)    andi    x3, ~0x40   ;1 [56]    in      x1, USBIN   ;1 [57] <-- sample stuffed bit 6    ori     shift, 0x40 ;1 [58]    rjmp    didUnstuff6 ;2 [60]; extra jobs done during bit interval:; bit 0:    store, clear [SE0 is unreliable here due to bit dribbling in hubs]; bit 1:    se0 check; bit 2:    overflow check; bit 3:    recovery from delay [bit 0 tasks took too long]; bit 4:    none; bit 5:    none; bit 6:    none; bit 7:    jump, eorrxLoop:    eor     x3, shift   ;1 [0] reconstruct: x3 is 0 at bit locations we changed, 1 at others    in      x1, USBIN   ;1 [1] <-- sample bit 0    st      y+, x3      ;2 [3] store data    ser     x3          ;1 [4]    nop                 ;1 [5]    eor     x2, x1      ;1 [6]    bst     x2, USBMINUS;1 [7]    bld     shift, 0    ;1 [8]    in      x2, USBIN   ;1 [9] <-- sample bit 1 (or possibly bit 0 stuffed)    andi    x2, USBMASK ;1 [10]    breq    se0         ;1 [11] SE0 check for bit 1    andi    shift, 0xf9 ;1 [12]didUnstuff0:    breq    unstuff0    ;1 [13]    eor     x1, x2      ;1 [14]    bst     x1, USBMINUS;1 [15]    bld     shift, 1    ;1 [16]rxbit2:    in      x1, USBIN   ;1 [17] <-- sample bit 2 (or possibly bit 1 stuffed)    andi    shift, 0xf3 ;1 [18]    breq    unstuff1    ;1 [19] do remaining work for bit 1didUnstuff1:    subi    cnt, 1      ;1 [20]    brcs    overflow    ;1 [21] loop control    eor     x2, x1      ;1 [22]    bst     x2, USBMINUS;1 [23]    bld     shift, 2    ;1 [24]    in      x2, USBIN   ;1 [25] <-- sample bit 3 (or possibly bit 2 stuffed)    andi    shift, 0xe7 ;1 [26]    breq    unstuff2    ;1 [27]didUnstuff2:    eor     x1, x2      ;1 [28]    bst     x1, USBMINUS;1 [29]    bld     shift, 3    ;1 [30]didUnstuff3:    andi    shift, 0xcf ;1 [31]    breq    unstuff3    ;1 [32]    in      x1, USBIN   ;1 [33] <-- sample bit 4    eor     x2, x1      ;1 [34]    bst     x2, USBMINUS;1 [35]    bld     shift, 4    ;1 [36]didUnstuff4:    andi    shift, 0x9f ;1 [37]    breq    unstuff4    ;1 [38]    nop2                ;2 [40]    in      x2, USBIN   ;1 [41] <-- sample bit 5    eor     x1, x2      ;1 [42]    bst     x1, USBMINUS;1 [43]    bld     shift, 5    ;1 [44]didUnstuff5:    andi    shift, 0x3f ;1 [45]    breq    unstuff5    ;1 [46]    nop2                ;2 [48]    in      x1, USBIN   ;1 [49] <-- sample bit 6    eor     x2, x1      ;1 [50]    bst     x2, USBMINUS;1 [51]    bld     shift, 6    ;1 [52]didUnstuff6:    cpi     shift, 0x02 ;1 [53]    brlo    unstuff6    ;1 [54]    nop2                ;2 [56]    in      x2, USBIN   ;1 [57] <-- sample bit 7    eor     x1, x2      ;1 [58]    bst     x1, USBMINUS;1 [59]    bld     shift, 7    ;1 [60]didUnstuff7:    cpi     shift, 0x04 ;1 [61]    brsh    rxLoop      ;2 [63] loop controlunstuff7:    andi    x3, ~0x80   ;1 [63]    ori     shift, 0x80 ;1 [64]    in      x2, USBIN   ;1 [65] <-- sample stuffed bit 7    nop                 ;1 [66]    rjmp    didUnstuff7 ;2 [68];----------------------------------------------------------------------------; Processing of received packet (numbers in brackets are cycles after end 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:                            ;  [0]    subi    cnt, USB_BUFSIZE    ;1 [1]    neg     cnt                 ;1 [2]    cpi     cnt, 3              ;1 [3]    ldi     x2, 1<<USB_INTR_PENDING_BIT ;1 [4]    out     USB_INTR_PENDING, x2;1 [5] clear pending intr and check flag later. SE0 should be over.    brlo    doReturn            ;1 [6] this is probably an ACK, NAK or similar packet    sub     YL, cnt             ;1 [7]    sbci    YH, 0               ;1 [8]    ld      token, y            ;2 [10]    cpi     token, USBPID_DATA0 ;1 [11]    breq    handleData          ;1 [12]    cpi     token, USBPID_DATA1 ;1 [13]    breq    handleData          ;1 [14]    ldd     x2, y+1             ;2 [16] ADDR and 1 bit endpoint number    mov     x3, x2              ;1 [17] store for endpoint number    andi    x2, 0x7f            ;1 [18] x2 is now ADDR    lds     shift, usbDeviceAddr;2 [20]    cp      x2, shift           ;1 [21]overflow:                       ; This is a hack: brcs overflow will never have Z flag set    brne    ignorePacket        ;1 [22] packet for different address    cpi     token, USBPID_IN    ;1 [23]    breq    handleIn            ;1 [24]    cpi     token, USBPID_SETUP ;1 [25]    breq    handleSetupOrOut    ;1 [26]    cpi     token, USBPID_OUT   ;1 [27]    breq    handleSetupOrOut    ;1 [28];   rjmp    ignorePacket        ;fallthrough, should not happen anyway.ignorePacket:    clr     shift    sts     usbCurrentTok, shiftdoReturn:    pop     cnt    pop     x3    pop     x2    pop     x1    pop     shift    pop     YHsofError:    pop     YL    out     SREG, YL    pop     YL    reti#if USB_CFG_HAVE_INTRIN_ENDPOINT && USB_CFG_HAVE_INTRIN_ENDPOINT3handleIn3:                      ;1 [38] (branch taken)    lds     cnt, usbTxLen3      ;2 [40]    sbrc    cnt, 4              ;2 [42]    rjmp    sendCntAndReti      ;0 43 + 17 = 60 until SOP    sts     usbTxLen3, x1       ;2 [44] x1 == USBPID_NAK from above    ldi     YL, lo8(usbTxBuf3)  ;1 [45]    ldi     YH, hi8(usbTxBuf3)  ;1 [46]    rjmp    usbSendAndReti      ;2 [48] + 13 = 61 until SOP (violates the spec by 1 cycle)#endif;Setup and Out are followed by a data packet two bit times (16 cycles) after;the end of SE0. The sync code allows up to 40 cycles delay from the start of;the sync pattern until the first bit is sampled. That's a total of 56 cycles.handleSetupOrOut:               ;1 [29] (branch taken)#if USB_CFG_IMPLEMENT_FN_WRITEOUT   /* if we have data for second OUT endpoint, set usbCurrentTok to -1 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩精品a在线观看| 美女视频网站久久| 国产精品盗摄一区二区三区| 国产欧美一区二区精品性| 欧美tickling网站挠脚心| 91精品国产综合久久香蕉麻豆 | 国产一区二区在线看| 久久99九九99精品| 精品影院一区二区久久久| 久久成人免费网| 韩国精品一区二区| 国产99久久久国产精品潘金网站| 国产美女精品在线| 丁香婷婷深情五月亚洲| 成a人片亚洲日本久久| bt欧美亚洲午夜电影天堂| 91蜜桃网址入口| 在线看国产一区| 欧美日本视频在线| 日韩视频一区二区三区| 精品久久久久99| 国产精品久久久久久妇女6080| 国产精品久久久久久久久久久免费看| 成人免费在线观看入口| 亚洲综合在线视频| 日韩高清国产一区在线| 国产麻豆成人精品| eeuss影院一区二区三区| 欧美在线一区二区| 日韩写真欧美这视频| 国产性色一区二区| 亚洲三级在线免费观看| 五月天婷婷综合| 国内外成人在线| 色综合天天性综合| 欧美精品九九99久久| 精品福利视频一区二区三区| 国产精品欧美久久久久无广告 | 国产精品毛片大码女人| 一区二区成人在线视频| 奇米一区二区三区| 成人h动漫精品一区二| 欧美精品欧美精品系列| 国产嫩草影院久久久久| 亚洲成人av免费| 国产精品资源在线看| 欧美性色黄大片| 国产亚洲一二三区| 亚洲一卡二卡三卡四卡无卡久久| 狠狠色2019综合网| 欧美综合视频在线观看| 精品久久人人做人人爽| 亚洲精品视频免费观看| 黄色资源网久久资源365| 色婷婷香蕉在线一区二区| 精品成人一区二区三区| 一区二区三区资源| 国产大陆亚洲精品国产| 91超碰这里只有精品国产| 国产精品毛片久久久久久| 久久国产视频网| 欧美午夜一区二区三区 | 婷婷综合五月天| 成人网页在线观看| 日韩一区二区三区四区| 国产精品理论在线观看| 久久99精品国产麻豆婷婷 | 亚洲精品国产无天堂网2021 | 日本精品一区二区三区四区的功能| 日韩欧美精品三级| 亚洲地区一二三色| 成人国产精品视频| 精品区一区二区| 亚瑟在线精品视频| 91视频免费看| 中文字幕乱码久久午夜不卡| 琪琪久久久久日韩精品| 欧美日韩综合色| 亚洲视频免费观看| 成人精品免费视频| 久久婷婷综合激情| 久久91精品久久久久久秒播| 欧美日韩久久久一区| 亚洲精品大片www| 99久久久久免费精品国产| 国产欧美精品一区| 国产一区二区伦理| 欧美成人一区二区三区| 日韩电影一区二区三区四区| 欧美亚日韩国产aⅴ精品中极品| 国产免费观看久久| 国产精品一卡二| 国产亚洲欧美激情| 国产麻豆精品久久一二三| 欧美精品一区二区蜜臀亚洲| 日本aⅴ精品一区二区三区| 4438x亚洲最大成人网| 一区2区3区在线看| 欧美手机在线视频| 亚洲综合色自拍一区| 欧美伊人久久大香线蕉综合69 | 麻豆91免费看| 欧美成人伊人久久综合网| 蜜臀精品一区二区三区在线观看 | 91激情五月电影| 亚洲图片你懂的| 91色九色蝌蚪| 一区二区三区 在线观看视频| 91在线精品一区二区三区| 亚洲日本电影在线| 色8久久精品久久久久久蜜| 亚洲精品国产精华液| 欧美在线制服丝袜| 三级亚洲高清视频| 精品日韩欧美一区二区| 黑人巨大精品欧美黑白配亚洲| 久久久精品中文字幕麻豆发布| 国产电影一区二区三区| 国产精品女人毛片| 在线看一区二区| 日本视频中文字幕一区二区三区| 欧美一级一区二区| 国产精品亚洲а∨天堂免在线| 国产精品色一区二区三区| 91在线视频在线| 亚洲aⅴ怡春院| 精品理论电影在线| 国产成人av电影免费在线观看| 亚洲女性喷水在线观看一区| 欧美中文字幕不卡| 久久99精品国产91久久来源| 久久精品一区二区三区av| 不卡的av在线| 日日骚欧美日韩| 久久综合999| 91久久线看在观草草青青| 日产国产欧美视频一区精品| 国产欧美日本一区视频| 欧美伊人久久久久久久久影院 | 日韩**一区毛片| 久久综合视频网| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 成人免费看的视频| 亚洲午夜免费电影| 26uuu亚洲综合色| 色婷婷av一区二区三区大白胸| 日一区二区三区| 中文一区二区完整视频在线观看| 在线免费观看日本一区| 久久se精品一区二区| 国产精品久久毛片av大全日韩| 欧美日韩一区久久| 国产成人精品免费视频网站| 亚洲午夜久久久久中文字幕久| 国产亚洲欧美日韩日本| 欧美日韩你懂得| www.亚洲人| 捆绑变态av一区二区三区| 国产精品久久免费看| 日韩一区二区麻豆国产| 99久久精品国产麻豆演员表| 美女视频黄免费的久久| 亚洲视频在线观看三级| 久久综合九色综合97婷婷女人| 在线看国产一区二区| 成人高清视频免费观看| 麻豆国产精品777777在线| 亚洲精品精品亚洲| 中文成人av在线| 欧美电影免费观看高清完整版在线 | 97久久精品人人做人人爽| 免费成人在线网站| 一区二区三区精密机械公司| 久久女同性恋中文字幕| 51久久夜色精品国产麻豆| 色欧美乱欧美15图片| 岛国av在线一区| 久久精品国产色蜜蜜麻豆| 一区二区理论电影在线观看| 国产精品国产三级国产普通话99 | 日本一区二区三区高清不卡 | 日韩精品成人一区二区在线| 亚洲欧美中日韩| 久久精品夜夜夜夜久久| 欧美成人伊人久久综合网| 91麻豆精品国产91久久久 | 久久久亚洲精华液精华液精华液 | 天使萌一区二区三区免费观看| 国产精品久久久久久久久免费桃花| 2020国产精品自拍| 日韩一区二区不卡| 欧美日韩国产首页在线观看| 91丨porny丨国产| 成人国产一区二区三区精品| 粉嫩高潮美女一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 韩国一区二区三区| 久久电影国产免费久久电影| 麻豆精品视频在线观看| 日韩激情在线观看|