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

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

?? usbdrvasm16.s

?? avr單片機usb下載器的制作資料
?? S
?? 第 1 頁 / 共 2 頁
字號:
/* 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久成人久久爱| 日韩欧美国产一二三区| 国产精品乱码一区二区三区软件| 麻豆高清免费国产一区| 欧美一激情一区二区三区| 日本中文字幕一区| 精品乱码亚洲一区二区不卡| 国产在线精品不卡| 国产三级精品三级| 波波电影院一区二区三区| 亚洲人成网站在线| 欧美美女一区二区在线观看| 青青草97国产精品免费观看无弹窗版| 精品久久久久久久人人人人传媒| 狠狠色狠狠色综合| 成人欧美一区二区三区白人| 欧美体内she精高潮| 奇米一区二区三区| 国产精品久久久久影院| 91福利资源站| 国产麻豆精品在线| 亚洲影视在线播放| 欧美成人一区二区| 91蜜桃免费观看视频| 日本麻豆一区二区三区视频| 久久五月婷婷丁香社区| 色噜噜狠狠成人中文综合| 免费成人av在线| 国产精品久线在线观看| 在线播放中文字幕一区| 粉嫩13p一区二区三区| 亚洲综合小说图片| 久久亚洲二区三区| 欧美性色欧美a在线播放| 久久www免费人成看片高清| 日韩一区日韩二区| 久久综合九色综合久久久精品综合| www.日韩精品| 久久国内精品自在自线400部| 中文字幕一区二区三区在线观看| 欧美福利一区二区| 成a人片亚洲日本久久| 麻豆freexxxx性91精品| 亚洲精品福利视频网站| 久久人人97超碰com| 91精品啪在线观看国产60岁| 99久久久精品免费观看国产蜜| 日产国产高清一区二区三区 | 国产**成人网毛片九色| 视频在线观看一区| 亚洲欧洲成人精品av97| 精品999久久久| 欧美三级日韩三级国产三级| 成人av片在线观看| 国产剧情一区二区| 久色婷婷小香蕉久久| 亚洲一区二区精品视频| 国产欧美日韩视频一区二区| 欧美一区二区三区白人| 欧美综合一区二区三区| www.99精品| 国产成人免费视频网站高清观看视频| 日本一不卡视频| 婷婷久久综合九色国产成人 | 成人av在线播放网站| 老司机一区二区| 视频一区欧美精品| 亚洲成a人片在线观看中文| 中文字幕日韩av资源站| 国产欧美一区二区精品性色超碰| 欧美岛国在线观看| 在线播放中文字幕一区| 欧美精品色一区二区三区| 在线观看视频91| 欧美亚洲日本一区| 欧美视频一区二区| 欧美天堂一区二区三区| 欧美日韩免费在线视频| 欧美另类z0zxhd电影| 欧美亚男人的天堂| 欧美色区777第一页| 欧美中文字幕久久| 欧美日韩不卡视频| 欧美精品久久99久久在免费线 | 国产精品综合久久| 高清shemale亚洲人妖| 国产寡妇亲子伦一区二区| 国产传媒日韩欧美成人| 国产成人午夜精品5599| 国产sm精品调教视频网站| 成人免费三级在线| 99re亚洲国产精品| 欧洲另类一二三四区| 337p亚洲精品色噜噜| 精品人伦一区二区色婷婷| 国产亚洲精品中文字幕| 国产精品欧美久久久久无广告| 国产精品国产三级国产aⅴ中文| 综合色天天鬼久久鬼色| 亚洲一区成人在线| 美女一区二区视频| 成人性生交大片免费看视频在线| 不卡一卡二卡三乱码免费网站| 97精品久久久久中文字幕| 欧美三级日韩三级国产三级| 欧美哺乳videos| 久久九九全国免费| 有码一区二区三区| 久久精品国产色蜜蜜麻豆| 国产成人av一区| 欧美中文字幕一二三区视频| 欧美一二三在线| 亚洲欧洲在线观看av| 亚洲bt欧美bt精品777| 国产乱国产乱300精品| 91麻豆视频网站| 精品日韩成人av| 亚洲少妇屁股交4| 日本欧美一区二区三区| 成人免费视频免费观看| 911精品产国品一二三产区| 国产日韩欧美精品在线| 亚洲国产视频一区二区| 国产福利91精品| 欧美日韩免费观看一区二区三区 | 久久久亚洲欧洲日产国码αv| 1区2区3区精品视频| 日韩中文字幕区一区有砖一区 | 93久久精品日日躁夜夜躁欧美| 欧美人体做爰大胆视频| 欧美国产一区在线| 天天色综合成人网| 东方欧美亚洲色图在线| 4438成人网| 亚洲手机成人高清视频| 国产麻豆精品久久一二三| 欧美日韩国产免费一区二区| 国产精品欧美久久久久无广告 | 欧美日韩在线综合| 国产精品福利在线播放| 免费在线观看不卡| 欧美日韩一本到| 国产精品欧美经典| 国产一区二区免费看| 欧美一区二区不卡视频| 亚洲综合一二三区| 色综合久久99| 亚洲欧美在线视频| 成人的网站免费观看| 久久日韩粉嫩一区二区三区 | 紧缚奴在线一区二区三区| 欧美丝袜自拍制服另类| 亚洲国产成人一区二区三区| 亚洲国产一二三| 豆国产96在线|亚洲| 国产欧美日韩另类视频免费观看| 亚洲chinese男男1069| 一本色道久久加勒比精品| 国产精品美女久久久久av爽李琼 | 91在线观看成人| 欧美日韩国产精选| 国产欧美日韩中文久久| 欧美a级一区二区| 色乱码一区二区三区88| 国产精品私房写真福利视频| 麻豆国产精品777777在线| 日韩欧美在线观看一区二区三区| 亚洲乱码国产乱码精品精可以看| 国产成人免费在线视频| 91精品国产免费| 亚洲福利电影网| 91蜜桃视频在线| 亚洲成人av一区二区三区| 成人成人成人在线视频| 久久综合九色综合欧美98| 国产成人在线色| 久久久久久久久久久黄色| 久久成人免费网| 2014亚洲片线观看视频免费| 亚洲第一电影网| 在线免费观看一区| 亚洲男人电影天堂| 91久久国产综合久久| 国产精品成人一区二区三区夜夜夜| 成人午夜短视频| 国产清纯在线一区二区www| av不卡免费电影| 18涩涩午夜精品.www| 92国产精品观看| 亚洲欧美另类在线| 欧洲一区二区三区免费视频| 日韩国产成人精品| 日韩写真欧美这视频| 久久国产生活片100| 国产精品视频在线看| 99精品久久免费看蜜臀剧情介绍| 欧美极品美女视频| 93久久精品日日躁夜夜躁欧美| 一区二区在线观看免费视频播放| 欧洲一区在线电影|