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

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

?? usbdrvasm16.inc

?? AVR單片機(jī)模擬USB實(shí)現(xiàn)CDC類串行口
?? INC
字號(hào):
/* Name: usbdrvasm16.inc * 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 startsUSB_INTR_VECTOR:;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#if USB_COUNT_SOF    lds     YL, usbSofCount    inc     YL    sts     usbSofCount, YL#endif  /* USB_COUNT_SOF */    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    overflowmacro POP_STANDARD ; 14 cycles    pop     cnt    pop     x4    pop     x3    pop     x2    pop     x1    pop     shift    pop     bitcntendmmacro POP_RETI     ; 7 cycles    pop     YH    pop     YL    out     SREG, YL    pop     YLendm#include "asmcommon.inc"; USB spec says:; idle = J; J = (D+ = 0), (D- = 1); K = (D+ = 1), (D- = 0); Spec allows 7.5 bit times from EOP to SOP for repliesbitstuffN:    eor     x1, x4          ;[5]    ldi     x2, 0           ;[6]    nop2                    ;[7]    nop                     ;[9]    out     USBOUT, x1      ;[10] <-- out    rjmp    didStuffN       ;[0]    bitstuff6:    eor     x1, x4          ;[5]    ldi     x2, 0           ;[6] Carry is zero due to brcc    rol     shift           ;[7] compensate for ror shift at branch destination    rjmp    didStuff6       ;[8]bitstuff7:    ldi     x2, 0           ;[2] Carry is zero due to brcc    rjmp    didStuff7       ;[3]sendNakAndReti:    ldi     x3, USBPID_NAK  ;[-18]    rjmp    sendX3AndReti   ;[-17]sendAckAndReti:    ldi     cnt, USBPID_ACK ;[-17]sendCntAndReti:    mov     x3, cnt         ;[-16]sendX3AndReti:    ldi     YL, 20          ;[-15] x3==r20 address is 20    ldi     YH, 0           ;[-14]    ldi     cnt, 2          ;[-13];   rjmp    usbSendAndReti      fallthrough;usbSend:;pointer to data in 'Y';number of bytes in 'cnt' -- including sync byte [range 2 ... 12];uses: x1...x4, btcnt, shift, cnt, Y;Numbers in brackets are time since first bit of sync pattern is sent;We don't match the transfer rate exactly (don't insert leap cycles every third;byte) because the spec demands only 1.5% precision anyway.usbSendAndReti:             ; 12 cycles until SOP    in      x2, USBDDR      ;[-12]    ori     x2, USBMASK     ;[-11]    sbi     USBOUT, USBMINUS;[-10] prepare idle state; D+ and D- must have been 0 (no pullups)    in      x1, USBOUT      ;[-8] port mirror for tx loop    out     USBDDR, x2      ;[-7] <- acquire bus; need not init x2 (bitstuff history) because sync starts with 0    ldi     x4, USBMASK     ;[-6] exor mask    ldi     shift, 0x80     ;[-5] sync byte is first byte senttxByteLoop:    ldi     bitcnt, 0x35    ;[-4] [6] binary 0011 0101txBitLoop:    sbrs    shift, 0        ;[-3] [7]    eor     x1, x4          ;[-2] [8]    out     USBOUT, x1      ;[-1] [9] <-- out N    ror     shift           ;[0] [10]    ror     x2              ;[1]didStuffN:    cpi     x2, 0xfc        ;[2]    brcc    bitstuffN       ;[3]    lsr     bitcnt          ;[4]    brcc    txBitLoop       ;[5]    brne    txBitLoop       ;[6]    sbrs    shift, 0        ;[7]    eor     x1, x4          ;[8]didStuff6:    out     USBOUT, x1      ;[-1] [9] <-- out 6    ror     shift           ;[0] [10]    ror     x2              ;[1]    cpi     x2, 0xfc        ;[2]    brcc    bitstuff6       ;[3]    ror     shift           ;[4]didStuff7:    ror     x2              ;[5]    sbrs    x2, 7           ;[6]    eor     x1, x4          ;[7]    nop                     ;[8]    cpi     x2, 0xfc        ;[9]    out     USBOUT, x1      ;[-1][10] <-- out 7    brcc    bitstuff7       ;[0] [11]    ld      shift, y+       ;[1]    dec     cnt             ;[3]    brne    txByteLoop      ;[4];make SE0:    cbr     x1, USBMASK     ;[5] prepare SE0 [spec says EOP may be 21 to 25 cycles]    lds     x2, usbNewDeviceAddr;[6]    lsl     x2              ;[8] we compare with left shifted address    subi    YL, 2           ;[9]    sbci    YH, 0           ;[10]    out     USBOUT, x1      ;[11] <-- out SE0 -- from now 2 bits = 22 cycles until bus idle;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm:;set address only after data packet was sent, not after handshake    breq    skipAddrAssign  ;[0]    sts     usbDeviceAddr, x2; if not skipped: SE0 is one cycle longerskipAddrAssign:;end of usbDeviceAddress transfer    ldi     x2, 1<<USB_INTR_PENDING_BIT;[2] int0 occurred during TX -- clear pending flag    USB_STORE_PENDING(x2)   ;[3]    ori     x1, USBIDLE     ;[4]    in      x2, USBDDR      ;[5]    cbr     x2, USBMASK     ;[6] set both pins to input    mov     x3, x1          ;[7]    cbr     x3, USBMASK     ;[8] configure no pullup on both pins    ldi     x4, 4           ;[9]se0Delay:    dec     x4              ;[10] [13] [16] [19]    brne    se0Delay        ;[11] [14] [17] [20]    out     USBOUT, x1      ;[21] <-- out J (idle) -- end of SE0 (EOP signal)    out     USBDDR, x2      ;[22] <-- release bus now    out     USBOUT, x3      ;[23] <-- ensure no pull-up resistors are active    rjmp    doReturn

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品一区| 亚洲精品一区二区三区香蕉| 制服丝袜一区二区三区| 国产视频一区二区三区在线观看| 亚洲网友自拍偷拍| av电影天堂一区二区在线观看| 日韩一区二区三区视频在线| 国产精品成人免费精品自在线观看 | 精品99一区二区| 亚洲最大的成人av| 成人av电影在线观看| 欧美刺激脚交jootjob| 亚洲国产精品人人做人人爽| 99久久久精品| 久久久久久久综合| 免费高清在线视频一区·| 欧美日韩夫妻久久| 亚洲美女视频在线观看| jizzjizzjizz欧美| 国产精品少妇自拍| 国产成人在线视频免费播放| 精品国一区二区三区| 免费久久99精品国产| 制服丝袜亚洲精品中文字幕| 亚洲一区二区三区四区在线| 91原创在线视频| 亚洲私人影院在线观看| 91看片淫黄大片一级在线观看| 国产精品日产欧美久久久久| 国产乱对白刺激视频不卡| 久久一区二区三区国产精品| 精品一区二区三区影院在线午夜 | 久久综合成人精品亚洲另类欧美| 亚洲一级二级在线| 26uuu久久天堂性欧美| 日韩高清不卡一区| 欧美一区二区视频在线观看2020| 亚洲成a人v欧美综合天堂下载| 欧美日韩美少妇| 全国精品久久少妇| 精品国产乱码久久久久久久久| 日韩av高清在线观看| 日韩色视频在线观看| 精品在线免费视频| 国产日韩精品视频一区| 高清不卡一区二区| 中文字幕欧美一| 91香蕉国产在线观看软件| 亚洲一区二区三区四区五区黄| 欧美三级韩国三级日本一级| 免费人成在线不卡| 久久精品亚洲乱码伦伦中文| av成人免费在线观看| 一区二区三区在线视频观看58| 欧美性猛交xxxx黑人交| 日本不卡免费在线视频| 久久精品亚洲麻豆av一区二区| 99视频在线精品| 天天色图综合网| xf在线a精品一区二区视频网站| 国产99久久久国产精品免费看| 亚洲精品伦理在线| 日韩一区二区在线观看视频| 高清av一区二区| 亚洲国产视频一区| 久久综合久久久久88| 日本福利一区二区| 激情伊人五月天久久综合| 国产精品久久福利| 日韩欧美激情一区| 99精品视频在线播放观看| 免费欧美日韩国产三级电影| 亚洲国产激情av| 制服丝袜成人动漫| 99久久亚洲一区二区三区青草| 香蕉久久一区二区不卡无毒影院| 久久精品亚洲麻豆av一区二区 | av在线播放一区二区三区| 舔着乳尖日韩一区| 国产精品视频一二| 欧美区视频在线观看| 成人av网址在线观看| 美日韩黄色大片| 91精品国产麻豆| 色综合咪咪久久| 国产精品人成在线观看免费| 4438成人网| 一本大道久久a久久精二百| 紧缚奴在线一区二区三区| 亚洲小说欧美激情另类| 亚洲国产高清在线| 精品国产91九色蝌蚪| 欧洲人成人精品| 97久久超碰国产精品电影| 国产一区二区美女诱惑| 秋霞电影一区二区| 亚洲小说欧美激情另类| 自拍偷拍亚洲激情| 亚洲线精品一区二区三区| 国产精品免费免费| 2020国产精品久久精品美国| 欧美一区二区福利在线| 欧美视频中文字幕| 在线观看视频91| 色综合久久88色综合天天免费| 国产传媒日韩欧美成人| 黑人巨大精品欧美一区| 日韩一区二区三区视频在线观看| 久久精品一区二区三区av| 欧美一区三区二区| 337p亚洲精品色噜噜狠狠| 欧美日韩高清一区二区不卡| 在线观看成人小视频| 色噜噜狠狠一区二区三区果冻| 成人高清视频在线观看| www.亚洲在线| 99免费精品在线观看| 成人自拍视频在线观看| 国产成人精品影视| 99在线精品一区二区三区| 成人动漫在线一区| 91麻豆产精品久久久久久 | 精品国产91洋老外米糕| 欧美日韩国产大片| 日韩一区二区三区高清免费看看| 欧美一卡二卡三卡四卡| 欧美一区二区三区视频免费播放| 69精品人人人人| 日韩丝袜美女视频| 久久久午夜精品| 国产精品全国免费观看高清| 亚洲情趣在线观看| 亚洲风情在线资源站| 日本不卡一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 成人免费av网站| 欧美日韩国产成人在线91| 精品国产伦一区二区三区观看体验| 日韩区在线观看| 国产精品美女久久久久久久网站| 亚洲美女免费在线| 美腿丝袜亚洲综合| av电影一区二区| 欧美一区二区二区| 中文字幕免费在线观看视频一区| 精品久久国产老人久久综合| 日本一区免费视频| 国产中文一区二区三区| 玉足女爽爽91| 国产麻豆精品一区二区| 在线免费观看日韩欧美| 久久蜜桃一区二区| 婷婷综合在线观看| 成人免费不卡视频| 7777精品伊人久久久大香线蕉的| 久久女同互慰一区二区三区| 日韩一区有码在线| 日本伊人色综合网| 欧美在线看片a免费观看| 欧美日韩国产一二三| 日韩一级免费观看| 亚洲乱码中文字幕综合| 国模无码大尺度一区二区三区| 色吧成人激情小说| 久久精品欧美一区二区三区不卡 | 99精品一区二区| 欧美不卡在线视频| 亚洲精品欧美专区| 成人激情动漫在线观看| 日韩一级欧美一级| 亚洲国产精品尤物yw在线观看| 国产成a人亚洲精品| 日韩精品专区在线| 日韩二区在线观看| 欧美日韩一级二级| 亚洲乱码精品一二三四区日韩在线| 国产一区二区三区四区五区美女 | 国产精品影视在线| 欧美一区在线视频| 五月激情综合色| 在线观看av一区二区| 中文字幕一区二区视频| 国产精品一区二区久久精品爱涩 | 欧美日韩二区三区| 一区二区三区在线观看动漫| www.日韩大片| 国产精品色呦呦| 国产成人精品www牛牛影视| 久久影院电视剧免费观看| 奇米精品一区二区三区在线观看一| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 久久精品国产第一区二区三区| 欧美另类变人与禽xxxxx| 亚洲综合色视频| 色噜噜狠狠色综合欧洲selulu| 亚洲欧美日韩精品久久久久| 91老师国产黑色丝袜在线| 亚洲伦理在线免费看| 欧美图片一区二区三区| 五月天亚洲婷婷|