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

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

?? main.c

?? 老外做的 AVR-Doper 很強大
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Name: main.c * Project: AVR-Doper * Author: Christian Starkjohann <cs@obdev.at> * Creation Date: 2006-06-21 * Tabsize: 4 * Copyright: (c) 2006 by Christian Starkjohann, all rights reserved. * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) * Revision: $Id: main.c 571 2008-04-27 14:39:33Z cs $ *//*General Description:This module implements hardware initialization and the USB interface*/#include "hardware.h"#include <avr/io.h>#include <avr/interrupt.h>#include <avr/pgmspace.h>#include <avr/wdt.h>#include <util/delay.h>#include <string.h>#include "utils.h"#include "usbdrv.h"#include "oddebug.h"#include "stk500protocol.h"#include "vreg.h"#include "serial.h"#include "timer.h"/* ------------------------------------------------------------------------- *//* CDC class requests: */enum {    SEND_ENCAPSULATED_COMMAND = 0,    GET_ENCAPSULATED_RESPONSE,    SET_COMM_FEATURE,    GET_COMM_FEATURE,    CLEAR_COMM_FEATURE,    SET_LINE_CODING = 0x20,    GET_LINE_CODING,    SET_CONTROL_LINE_STATE,    SEND_BREAK};/* defines for 'requestType' */#define REQUEST_TYPE_LINE_CODING    0   /* CDC GET/SET_LINE_CODING */#define REQUEST_TYPE_HID_FIRST      1   /* first block of HID reporting */#define REQUEST_TYPE_HID_SUBSEQUENT 2   /* subsequent block of HID reporting */#define REQUEST_TYPE_HID_DEBUGDATA  3   /* read/write data from/to debug interface */#define REQUEST_TYPE_VENDOR         4   /* vendor request for get/set debug data *//* ------------------------------------------------------------------------- */#if ENABLE_CDC_INTERFACEstatic uchar    modeBuffer[7] = {0x80, 0x25, 0, 0, 0, 0, 8};  /* default: 9600 bps, 8n1 */#   if USE_DCD_REPORTINGstatic uchar    intr3Status;#   endif#endif#if ENABLE_HID_INTERFACEstatic uchar    hidStatus;#endifstatic uchar    requestType;static uchar    useHIDInterface;#if ENABLE_CDC_INTERFACEstatic PROGMEM char deviceDescrCDC[] = {    /* USB device descriptor */    18,         /* sizeof(usbDescriptorDevice): length of descriptor in bytes */    USBDESCR_DEVICE,        /* descriptor type */    0x10, 0x01,             /* USB version supported */    0x02,                   /* device class: CDC */    0,                      /* subclass */    0,                      /* protocol */    8,                      /* max packet size */    USB_CFG_VENDOR_ID,      /* 2 bytes */    0xe1, 0x05,             /* 2 bytes: shared PID for CDC-ACM devices */    USB_CFG_DEVICE_VERSION, /* 2 bytes */    1,                      /* manufacturer string index */    2,                      /* product string index */    3,                      /* serial number string index */    1,                      /* number of configurations */};static PROGMEM char configDescrCDC[] = {   /* USB configuration descriptor */    9,          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */    USBDESCR_CONFIG,    /* descriptor type */    67, 0,      /* total length of data returned (including inlined descriptors) */    2,          /* number of interfaces in this configuration */    1,          /* index of this configuration */    0,          /* configuration name string index */#if USB_CFG_IS_SELF_POWERED    USBATTR_SELFPOWER,  /* attributes */#else    USBATTR_BUSPOWER,   /* attributes */#endif    USB_CFG_MAX_BUS_POWER/2,            /* max USB current in 2mA units */    /* interface descriptors follow inline: */    /* Interface Descriptor for CDC-ACM Control  */    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */    USBDESCR_INTERFACE, /* descriptor type */    0,          /* index of this interface */    0,          /* alternate setting for this interface */    1,          /* endpoints excl 0: number of endpoint descriptors to follow */    USB_CFG_INTERFACE_CLASS,    /* see usbconfig.h */    USB_CFG_INTERFACE_SUBCLASS,    USB_CFG_INTERFACE_PROTOCOL,    0,          /* string index for interface */    /* CDC Class-Specific descriptors */    5,          /* sizeof(usbDescrCDC_HeaderFn): length of descriptor in bytes */    0x24,       /* descriptor type */    0,          /* Subtype: header functional descriptor */    0x10, 0x01, /* CDC spec release number in BCD */    4,          /* sizeof(usbDescrCDC_AcmFn): length of descriptor in bytes */    0x24,       /* descriptor type */    2,          /* Subtype: abstract control management functional descriptor */    0x02,       /* capabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE */    5,          /* sizeof(usbDescrCDC_UnionFn): length of descriptor in bytes */    0x24,       /* descriptor type */    6,          /* Subtype: union functional descriptor */    0,          /* CDC_COMM_INTF_ID: master interface (control) */    1,          /* CDC_DATA_INTF_ID: slave interface (data) */    5,          /* sizeof(usbDescrCDC_CallMgtFn): length of descriptor in bytes */    0x24,       /* descriptor type */    1,          /* Subtype: call management functional descriptor */    0x03,       /* capabilities: allows management on data interface, handles call management by itself */    1,          /* CDC_DATA_INTF_ID: interface used for call management */    /* Endpoint Descriptor */    7,          /* sizeof(usbDescrEndpoint) */    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */    0x83,       /* IN endpoint number 3 */    0x03,       /* attrib: Interrupt endpoint */    8, 0,       /* maximum packet size */    100,        /* in ms */    /* Interface Descriptor for CDC-ACM Data  */    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */    USBDESCR_INTERFACE, /* descriptor type */    1,          /* index of this interface */    0,          /* alternate setting for this interface */    2,          /* endpoints excl 0: number of endpoint descriptors to follow */    0x0a,       /* Data Interface Class Codes */    0,          /* interface subclass */    0,          /* Data Interface Class Protocol Codes */    0,          /* string index for interface */    /* Endpoint Descriptor */    7,          /* sizeof(usbDescrEndpoint) */    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */    0x01,       /* OUT endpoint number 1 */    0x02,       /* attrib: Bulk endpoint */    HW_CDC_PACKET_SIZE, 0,  /* maximum packet size */    0,          /* in ms */    /* Endpoint Descriptor */    7,          /* sizeof(usbDescrEndpoint) */    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */    0x81,       /* IN endpoint number 1 */    0x02,       /* attrib: Bulk endpoint */    HW_CDC_PACKET_SIZE, 0,  /* maximum packet size */    0,          /* in ms */};#endif /* ENABLE_CDC_INTERFACE */#if ENABLE_HID_INTERFACEstatic PROGMEM char deviceDescrHID[] = {    /* USB device descriptor */    18,         /* sizeof(usbDescriptorDevice): length of descriptor in bytes */    USBDESCR_DEVICE,        /* descriptor type */    0x01, 0x01,             /* USB version supported */    0,                      /* device class: composite */    0,                      /* subclass */    0,                      /* protocol */    8,                      /* max packet size */    USB_CFG_VENDOR_ID,      /* 2 bytes */    0xdf, 0x05,             /* 2 bytes: shared PID for HIDs */    USB_CFG_DEVICE_VERSION, /* 2 bytes */    1,                      /* manufacturer string index */    2,                      /* product string index */    0,                      /* serial number string index */    1,                      /* number of configurations */};static PROGMEM char configDescrHID[] = {    /* USB configuration descriptor */    9,          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */    USBDESCR_CONFIG,/* descriptor type */    18 + 7 + 9, 0,  /* total length of data returned (including inlined descriptors) */    1,          /* number of interfaces in this configuration */    1,          /* index of this configuration */    0,          /* configuration name string index */#if USB_CFG_IS_SELF_POWERED    USBATTR_SELFPOWER,  /* attributes */#else    USBATTR_BUSPOWER,   /* attributes */#endif    USB_CFG_MAX_BUS_POWER/2,    /* max USB current in 2mA units *//* interface descriptor follows inline: */    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */    USBDESCR_INTERFACE, /* descriptor type */    0,          /* index of this interface */    0,          /* alternate setting for this interface */    USB_CFG_HAVE_INTRIN_ENDPOINT,   /* endpoints excl 0: number of endpoint descriptors to follow */    3,          /* interface class: HID */    0,          /* subclass */    0,          /* protocol */    0,          /* string index for interface */    9,          /* sizeof(usbDescrHID): length of descriptor in bytes */    USBDESCR_HID,   /* descriptor type: HID */    0x01, 0x01, /* BCD representation of HID version */    0x00,       /* target country code */    0x01,       /* number of HID Report (or other HID class) Descriptor infos to follow */    0x22,       /* descriptor type: report */    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  /* total length of report descriptor */    7,          /* sizeof(usbDescrEndpoint) */    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */    0x81,       /* IN endpoint number 1 */    0x03,       /* attrib: Interrupt endpoint */    8, 0,       /* maximum packet size */    USB_CFG_INTR_POLL_INTERVAL, /* in ms */};PROGMEM char usbDescriptorHidReport[60] = {    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)    0x09, 0x01,                    // USAGE (Vendor Usage 1)    0xa1, 0x01,                    // COLLECTION (Application)    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)    0x75, 0x08,                    //   REPORT_SIZE (8)    0x85, 0x01,                    //   REPORT_ID (1)    0x95, 0x0e,                    //   REPORT_COUNT (14)    0x09, 0x00,                    //   USAGE (Undefined)    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)    0x85, 0x02,                    //   REPORT_ID (2)    0x95, 0x1e,                    //   REPORT_COUNT (30)    0x09, 0x00,                    //   USAGE (Undefined)    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)    0x85, 0x03,                    //   REPORT_ID (3)    0x95, 0x3e,                    //   REPORT_COUNT (62)    0x09, 0x00,                    //   USAGE (Undefined)    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)    0x85, 0x04,                    //   REPORT_ID (4)    0x95, 0x7e,                    //   REPORT_COUNT (126)    0x09, 0x00,                    //   USAGE (Undefined)    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)    0x85, 0x06,                    //   REPORT_ID (5) [for debug interface]    0x95, 0x3e,                    //   REPORT_COUNT (62)    0x09, 0x00,                    //   USAGE (Undefined)    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)    0xc0                           // END_COLLECTION};/* Note: REPORT_COUNT does not include report-ID byte */#endif /* ENABLE_HID_INTERFACE *//* ------------------------------------------------------------------------- */uchar usbFunctionDescriptor(usbRequest_t *rq){uchar *p = NULL, len = 0, useHID = useHIDInterface;    if(useHID){#if ENABLE_HID_INTERFACE        if(rq->wValue.bytes[1] == USBDESCR_DEVICE){            p = (uchar *)deviceDescrHID;            len = sizeof(deviceDescrHID);        }else if(rq->wValue.bytes[1] == USBDESCR_CONFIG){            p = (uchar *)configDescrHID;            len = sizeof(configDescrHID);        }else{  /* must be HID descriptor */            p = (uchar *)(configDescrHID + 18);            len = 9;        }#endif    }else{#if ENABLE_CDC_INTERFACE        if(rq->wValue.bytes[1] == USBDESCR_DEVICE){            p = (uchar *)deviceDescrCDC;            len = sizeof(deviceDescrCDC);        }else{  /* must be config descriptor */            p = (uchar *)configDescrCDC;            len = sizeof(configDescrCDC);        }#endif    }    usbMsgPtr = p;    return len;}/* ------------------------------------------------------------------------- *//* ----------------------------- USB interface ----------------------------- *//* ------------------------------------------------------------------------- */uchar usbFunctionSetup(uchar data[8]){usbRequest_t    *rq = (void *)data;uchar           rqType = rq->bmRequestType & USBRQ_TYPE_MASK;    if(rqType == USBRQ_TYPE_CLASS){    /* class request type */        if(useHIDInterface){#if ENABLE_HID_INTERFACE            if(rq->bRequest == USBRQ_HID_GET_REPORT || rq->bRequest == USBRQ_HID_SET_REPORT){                hidStatus = rq->wValue.bytes[0];    /* store report ID */                if(rq->wValue.bytes[0] == 5){   /* report ID */                    requestType = REQUEST_TYPE_HID_DEBUGDATA;                }else{                    requestType = REQUEST_TYPE_HID_FIRST;                }                /* the driver counts the total number of bytes for us */                return 0xff;            }#endif        }else{#if ENABLE_CDC_INTERFACE            if(rq->bRequest == GET_LINE_CODING || rq->bRequest == SET_LINE_CODING){                requestType = REQUEST_TYPE_LINE_CODING;                return 0xff;            }#   if USE_DCD_REPORTING            if(rq->bRequest == SET_CONTROL_LINE_STATE){                /* Report serial state (carrier detect). On several Unix platforms,                 * tty devices can only be opened when carrier detect is set.                 */                intr3Status = 2;            }#   endif#endif        }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利一区二区三区在线视频| 亚洲丰满少妇videoshd| 国产欧美一区视频| 亚洲视频免费在线观看| 日韩二区三区在线观看| 国产精品一二三区| 老司机一区二区| 豆国产96在线|亚洲| 99天天综合性| 国产在线国偷精品免费看| 成人avav影音| 日韩欧美一区中文| 亚洲天堂免费看| 亚洲成人精品影院| 国产精品2024| 欧美r级电影在线观看| 国产精品视频线看| 亚洲国产精品一区二区久久恐怖片 | 亚洲精品一二三四区| 免费成人在线播放| 99久久精品免费| 欧美国产一区二区| 日日骚欧美日韩| 成人免费视频免费观看| 久久精品亚洲精品国产欧美| 亚洲国产成人va在线观看天堂| 久久国产精品色婷婷| 日韩一区二区在线免费观看| 久久久久久99久久久精品网站| 亚洲欧美日韩久久| 色综合中文字幕国产| 欧美v国产在线一区二区三区| 亚洲日本在线天堂| 在线观看视频一区二区| 国产亚洲精品7777| 亚洲1区2区3区4区| 4438成人网| 亚洲精品美国一| 日本韩国一区二区| 亚洲国产精品一区二区久久恐怖片| 国产精品一区2区| 欧美日本视频在线| 亚洲精品国产a| av福利精品导航| 自拍视频在线观看一区二区| 国产福利视频一区二区三区| 欧美精品在线观看播放| 久久成人综合网| 欧美美女bb生活片| 亚洲影院久久精品| 精品国产制服丝袜高跟| 亚洲r级在线视频| 91在线云播放| 日韩国产在线观看一区| 欧美日韩一区三区| 亚洲永久精品大片| 国产乱码字幕精品高清av| 欧美第一区第二区| 成人av网站大全| 中文字幕av免费专区久久| 丁香一区二区三区| 亚洲摸摸操操av| 9久草视频在线视频精品| 精品国产露脸精彩对白 | 色婷婷久久久久swag精品 | 精品国精品国产尤物美女| 日本女优在线视频一区二区| 日本一区二区三区久久久久久久久不 | 午夜av区久久| 51精品视频一区二区三区| 蜜桃av一区二区| 亚洲三级久久久| 欧美精品乱码久久久久久| 一区二区三区不卡在线观看 | 偷拍日韩校园综合在线| 久久精品一区二区三区不卡 | 午夜视频在线观看一区| 一本在线高清不卡dvd| 自拍偷拍欧美精品| 久久综合久久综合久久综合| 日韩国产精品91| 亚洲精品午夜久久久| 91精品国产综合久久久久久| 男女性色大片免费观看一区二区| 欧美色手机在线观看| 国产宾馆实践打屁股91| 自拍偷拍亚洲综合| 色天天综合色天天久久| 国内久久精品视频| 国产精品福利电影一区二区三区四区| 色爱区综合激月婷婷| 五月婷婷激情综合网| 精品日韩一区二区三区免费视频| 高清国产一区二区三区| 综合电影一区二区三区| 欧美一区二区三区在线看| 国产不卡免费视频| 天天综合网 天天综合色| 中文字幕精品一区| 在线播放中文字幕一区| 国产一区二区主播在线| 久久精品国产99久久6| 中文字幕一区二区5566日韩| 在线视频你懂得一区| 色先锋aa成人| 蜜臀久久久久久久| 欧美在线free| 欧美主播一区二区三区美女| 久久国产成人午夜av影院| 亚洲免费观看视频| 中文字幕精品三区| 精品久久一区二区| 精品国产网站在线观看| 欧美日韩在线播放三区四区| 久久久久久9999| 精品国产一区二区三区四区四| 91色九色蝌蚪| 欧美日韩中文另类| 99国产精品视频免费观看| 日本三级韩国三级欧美三级| 亚洲h精品动漫在线观看| 成人欧美一区二区三区黑人麻豆| 性欧美疯狂xxxxbbbb| 日韩av二区在线播放| 成人免费一区二区三区视频| 亚洲欧美激情视频在线观看一区二区三区| 欧美不卡一区二区| 欧美日韩的一区二区| 日韩精品一区二区三区老鸭窝 | 中日韩av电影| 亚洲欧美一区二区在线观看| 日韩小视频在线观看专区| 精品一区免费av| 国产一区二区在线电影| 日韩精品午夜视频| 狠狠色丁香婷婷综合久久片| 日本一道高清亚洲日美韩| 亚洲韩国精品一区| 激情深爱一区二区| 奇米色一区二区| 五月天中文字幕一区二区| 毛片不卡一区二区| 老司机一区二区| 91免费看片在线观看| 色婷婷av久久久久久久| 色婷婷久久一区二区三区麻豆| 色94色欧美sute亚洲线路一ni| 成人app网站| 91精品国产高清一区二区三区蜜臀 | 91精品国产综合久久香蕉麻豆 | 激情五月婷婷综合网| 美日韩黄色大片| 91免费版在线| 色哟哟国产精品免费观看| 欧美老人xxxx18| 欧美精品国产精品| 欧美大白屁股肥臀xxxxxx| 国产精品国产自产拍高清av王其| 91精品国产综合久久精品麻豆| 在线91免费看| 欧美精品一区二区三区蜜桃视频| 亚洲欧美日韩精品久久久久| 亚洲精品写真福利| 亚洲成人免费影院| 一本久道中文字幕精品亚洲嫩| 在线观看成人免费视频| 中文成人av在线| 亚洲午夜一区二区三区| 亚洲线精品一区二区三区| 国产99久久久久久免费看农村| 成人性生交大片免费看视频在线| 4438x成人网最大色成网站| 精品国产乱码久久久久久久久 | 精品国产91乱码一区二区三区| 日韩免费观看高清完整版在线观看| 亚洲男同1069视频| 免费观看成人av| 欧美日韩卡一卡二| 欧美精品一区二区三区蜜臀| 国产精品午夜免费| 国产福利一区二区三区视频 | 国产一区二区三区av电影| 99精品黄色片免费大全| 亚洲国产精品精华液2区45| 亚洲免费大片在线观看| 国产一区二区三区免费在线观看| 99久久国产综合精品麻豆| 69堂亚洲精品首页| 中文字幕一区视频| 亚洲图片欧美激情| 亚洲国产精品久久不卡毛片 | 亚洲综合成人在线| 免费成人av在线| 欧美一级一区二区| 亚洲精品一二三四区| 国产偷国产偷亚洲高清人白洁| 久草精品在线观看| 91福利小视频| 亚洲一区二区免费视频| 国产综合色在线视频区|