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

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

?? usbhost.h

?? USB Host在嵌入式系統中的實現.包括所有源代碼.
?? H
字號:
/*
 *  Start of Zoran Standard Header
 *  Copyright (c) 2003 Zoran Corporation
 *  
 *  
 *  All rights reserved.  Proprietary and confidential.
 *  
 *  DESCRIPTION for usbhost.h
 *  	Include for usbhost.c
 *  
 *  NEW HISTORY COMMENT (description must be followed by a blank line)
 *  <Enter change description here>

 *  ===== HISTORY of changes in //depot/misc/projects/tps/usb/usbhost.h
 *  
 *  12/Jan/04 #35 JCogan, porting to the 4100 Reference platform.
 *                          Previous comments removed.
 *  
 *  
 *  
 *  End of Zoran Standard Header
 */
 
/*  Make sure to include the correct offset definitions
*/
#include "firereg6.h"
 
#ifndef USBHOST_INCLUDED
#define USBHOST_INCLUDED

#ifndef FALSE
#define FALSE ((Boolean)0)
#endif
#ifndef TRUE
#define TRUE ((Boolean)1)
#endif
#ifdef  NULL
#undef  NULL
#endif
#define NULL ((void *)0)

#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))      
#endif

#ifdef DEBUG
#define USBH_ASSERT(_XX_) ASSERT(_XX_)
#else
#define USBH_ASSERT(_XX_)
#endif

#ifndef ASSERT
#define ASSERT(_XX_) { if (!(_XX_)) while (1) ; }
#endif

/* Interrupt bit position in MECRA, EXCLRA registers, (i.e., 1 << 1) */
#define USB1_INTERRUPT_BIT 0

/* register/memory access */
#define READ_BYTE(p)    (*(Uint8 *)(p))
#define WRITE_BYTE(p)   (*(Uint8 *)(p))


#define BDT_IN_BIT         (0x0)
#define BDT_OUT_BIT        (0x8)
#define BDT_ODD_EVEN_BIT   (0x4)

#define USB_SETUP_DEV2HOST (0x80)

/* Interrupt Status Register Bit Masks */
#define INTR_STALL      (0x80)
#define INTR_ATTACH     (0x40)
#define INTR_RSVD       (0x20)
#define INTR_SLEEP      (0x10)
#define INTR_TOK_DNE    (0x08)
#define INTR_SOF_TOK    (0x04)
#define INTR_ERROR      (0x02)
#define INTR_USB_RST    (0x01)

/* Control Register Bit Masks */
#define CTRL_USB_EN            (0x01)
#define CTRL_ODD_RST           (0x02)
#define CTRL_RESUME            (0x04)
#define CTRL_HOST_NO_SOF       (0x08)
#define CTRL_HOST_SOF          (0x09)  /*  HOST ENABLE | USB ENABLE */
#define CTRL_RESET             (0x10)
#define CTRL_TOKEN_BUSY        (0x20)
#define CTRL_TXD_SUSPEND       (0x20)
#define CTRL_SINGLE_END0       (0x40)
#define CTRL_JSTATE            (0x80)


/* Low Speed bit */
#define VUSB_ADDR_LS_EN         (0x80)

#define BDT_PID_MASKS           (0x3C)
#define BDT_INVALID_PID1        (0x18)
#define BDT_NAK_PID             (0x28)
#define BDT_STALL_PID           (0x38)
#define BDT_PID_OWN             (0x80)
#define BDT_PID_DATA01          (0x40)

/* Also define some useful bit combinations */
#define ENDPT_DISABLE           (0x00)
#define ENDPT_CNTL_0            (0x0d) /* retry disable|CtRxTx|Handshake */
#define ENDPT_BULK_RX           (0x49) /* retry disable|  Rx  |Handshake */
#define ENDPT_BULK_TX           (0x45) /* retry disable|    Tx|Handshake */
#define ENDPT_INT_RX            (0x49) /* retry disable|  Rx  |Handshake */
#define ENDPT_INT_TX            (0x45) /* not currently used */
#define ENDPT_INT_BIDIR         (0x4d) /* not currently used */
#define ENDPT_HOST_RETRY_DIS    (0x40) /* not currently used */
#define ENDPT_HOST_WO_HUB       (0x80) /* not currently used */

/* BYTE USB REGISTERS - base address: 0xE0480000 */
#define regINT_STAT ((volatile Uint8 *)USB10INTSTAT)  /* 00 Interrupt status  */
#define regINT_ENB  ((volatile Uint8 *)USB10INTENB)   /* 01 Interrupt enable  */
#define regERR_STAT ((volatile Uint8 *)USB10ERRSTAT)  /* 02 Error Int status  */
#define regERR_ENB  ((volatile Uint8 *)USB10ERRENB)   /* 03 Error int enable  */
#define regSTATUS   ((volatile Uint8 *)USB10STAT)     /* 04 Status            */
#define regCTL      ((volatile Uint8 *)USB10CTL)      /* 05 Control           */
#define regADDR     ((volatile Uint8 *)USB10ADDR)     /* 06 USB address       */
#define regFRM_NUML ((volatile Uint8 *)USB10FRMNUML)  /* 08 Frame no. - low   */
#define regFRM_NUMH ((volatile Uint8 *)USB10FRMNUMH)  /* 09 Frame no. - high  */
#define regTOKEN    ((volatile Uint8 *)USB10TOKEN)    /* 0A Token             */
#define regSOF_THLD ((volatile Uint8 *)USB10SOFTHLD)  /* 0B SOF threshold     */
#define regEP0CTL   ((volatile Uint8 *)USB10EP0CTL)   /* 10 EndPoint 0 cntrl  */
#define regBUFBASEL ((volatile Uint8 *)USB10BUFBASEL) /* 20 Buff base (23:16) */
#define regBUFBASEH ((volatile Uint8 *)(USB10BUFBASEL+1)) /* 21 Buff base (31:24) */

/* BOARD CONTROL REGISTER - Firestarter base address: 0xEE001002 */
#define regBCTRL_W  ((volatile Uint8 *)0xEE001002)
#define ENABLE_USB_PWR   *regBCTRL_W = *regBCTRL_W | 0x40;


/* USB CHAPTER 9 */

/* SETUP offsets */
#define bmRequestType   0
#define bRequest        1
#define wValue_low      2
#define wValue_high     3
#define wIndex_low      4
#define wIndex_high     5
#define wLength_low     6
#define wLength_high    7

/* bmRequestType */
#define DEVICE_TO_HOST        0x80
#define DEVICE_TO_HOST_IFACE  0x81
#define DEVICE_TO_HOST_EP     0x82

#define HOST_TO_DEVICE           0
#define HOST_TO_DEVICE_IFACE     1
#define HOST_TO_DEVICE_EP        2

/* bRequest types                 ReqType  wValue  wIndex  wLength   Data   */
#define GET_STATUS          0   /* dv/ep      0    0/if/ep    2      2bytes */
#define CLEAR_FEATURE       1   /* 02-ep   0-HALT     0       0      none   */
#define SET_FEATURE         3   /* 02-ep   feature 0/if/ep    0      none   */
#define SET_ADDRESS         5   /* 00        addr     0       0      none   */
#define GET_DESCRIPTOR      6   /* 80      type-inx langID   len     desc   */
#define SET_DESCRIPTOR      7   /* 00      type-inx langID   len     desc   */
#define GET_CONFIGURATION   8   /* 80         0       0       0      cnfg#  */
#define SET_CONFIGURATION   9   /* 00       cnfg#     0       0      none   */
#define GET_INTERFACE      10   /* 81         0      iface    1      altset */
#define SET_INTERFACE      11   /* 01       altset   iface    0      none   */

/* Descriptor types */
#define DEVICE_TYPE         1
#define CONFIGURATION_TYPE  2
#define STRING_TYPE         3
#define INTERFACE_TYPE      4
#define ENDPOINT_TYPE       5
#define HID_TYPE           33


/* Standard Device decriptors */

/* Device Descriptor */
typedef struct {
    Uint8 bLength;
    Uint8 bDescriptorType;
    Uint8 bcdUSB_low;
    Uint8 bcdUSB_high;
    Uint8 bDeviceClass;
    Uint8 bDeviceSubclass;
    Uint8 bDeviceProtocol;
    Uint8 bMaxPacketSize0;
    Uint8 idVendor_low;
    Uint8 idVendor_high;
    Uint8 idProduct_low;
    Uint8 idProduct_high;
    Uint8 bcdDevice_low;
    Uint8 bcdDevice_high;
    Uint8 bManufacturer;
    Uint8 bProduct;
    Uint8 iSerialNumber;
    Uint8 bNumConfigurations;
} DEVICE_DESC;

/* Configuration Descriptor */
typedef struct {
    Uint8 bLength;
    Uint8 bDescriptorType;
    Uint8 wTotalLength_low;
    Uint8 wTotalLength_high;
    Uint8 bNumInterfaces;
    Uint8 bConfigurationValue;
    Uint8 iConfiguration;
    Uint8 bmAttributes;
    Uint8 bMaxPower;
} CONFIG_DESC;

/* Interface Descriptor */
typedef struct {
    Uint8 bLength;
    Uint8 bDescriptorType;
    Uint8 bInterfaceNumber;
    Uint8 bAlternateSetting;
    Uint8 bNumEndpoints;
    Uint8 bInterfaceClass;
    Uint8 bInterfaceSubClass;
    Uint8 bInterfaceProtocol;
    Uint8 iInterface;
} INTERFACE_DESC;

/* Endpoint Descriptor */
typedef struct {
    Uint8 bLength;
    Uint8 bDescriptorType;
    Uint8 bEPAddress;
    Uint8 bmAttributes;
    Uint8 wMaxPacketSize_low;
    Uint8 wMaxPacketSize_high;
    Uint8 bInterval;
} ENDPOINT_DESC;

/* String[0] offsets */
#define BLENGTH             0
#define BDESCRIPTORTYPE     1
#define WLANGID0_LOW        2
#define WLANGID0_HIGH       3

/* UNICODE String offsets */
#define BLENGTH             0
#define BDESCRIPTORTYPE     1
#define BSTRING             2


/* usb_host.code values: */
#define USBH_NOCODE 0
#define USBH_ERROR  1
#define USBH_RESET  2
#define USBH_ATTACH 3
#define USBH_STALL  4
#define USBH_INTNAK 5
#define USBH_DONE   6
#define USBH_HCAN   7
#define USBH_NAK    8
#define USBH_OUT    9
#define USBH_IN    10
#define USBH_OUT0  11
#define USBH_IN0   12
#define USBH_INTR  13

#define NOT_READY 0     /* not ready */
#define MS_READY  1     /* mass storage device ready */
#define PB_READY  2     /* PictBridge device ready */


/* TD.state values: */
#define ISO_TRANSACTION 	0x10
#define INT_TRANSACTION 	0x20
#define CTRL_TRANSACTION 	0x40
#define BULK_TRANSACTION 	0x80

#define CNTRL_SETUP 1
#define PROCESS_IN  2
#define PROCESS_OUT 3
#define CNTRL_LAST  4
#define NO_REQUEST  5

#define DEVID_DEFAULT		0
#define DEVID_STILL_IMAGE	1
#define DEVID_MASS_STORAGE	2
#define DEVID_MAX			3

/* VUSB Buffer Descriptor Format */
typedef struct {
    Uint8 PID;      /* 7:own 6:data0/1 5-2:pid 1-0:bch bits */
    Uint8 BC;       /* Byte Count Low bits */
    Uint8 ADDRL;
    Uint8 ADDRH;
} BDT_STRUCT;

typedef struct {
    Uint8 pipe_type;
    Uint8 EP;
    Uint8 pksize;
    Uint8 type;
    Uint8 pid_ep;
    Uint8 DATAx;

    Uint8 *setup_bf;
    Uint8 *pipe_bf;

    Uint8 *io_bf;
    Uint32 length;
    Uint32 curr_count;
    Uint32 NAKcount;
    BDT_STRUCT *bdt;
} EP_DATA;
typedef struct {
	Uint8 ep_num;
	Uint8 addr;
	Uint32 *ep_list[16];
}DEV_INFO;

typedef struct trnsfer_struct{
	
	Uint32 *QH;
	struct trnsfer_struct	*TD_next;
	DEV_INFO 				*curr_DEV;
	EP_DATA					*curr_EP;
	
	Uint8 state;
    Uint8 *io_bf;
    Uint32 length;
    Uint32 finish_count;
    Uint32 NAKcount;
    /*BDT Setting Data*/
    Uint8 bdt_PID;      /* 7:own 6:data0/1 5-2:pid 1-0:bch bits */
    Uint8 bdt_BC;       /* Byte Count Low bits */
    Uint8 bdt_ADDRL;
    Uint8 bdt_ADDRH;
    BDT_STRUCT *bdt;
    /*Control Register Data*/
	Uint8 BUFBASEH;
	Uint8 BUFBASEL;
	Uint8 EP0CTL;
	Uint8 ADDR;
	Uint8 TOKEN;
} TRANSACTION_STRUCT;

struct queue_head{
	Uint32	TD_num;
	struct queue_head	*QH_next;
	
	TRANSACTION_STRUCT *TD_head;
	TRANSACTION_STRUCT *TD_tail;
};

typedef struct queue_head HOST_QUEUE_HEAD;

#endif /* USBHOST_INCLUDED*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久九九久精品国产免费直播| 亚洲精品日韩综合观看成人91| 亚洲电影中文字幕在线观看| thepron国产精品| 亚洲精品国产成人久久av盗摄 | 亚洲无线码一区二区三区| 国产精品国产a级| 91福利资源站| 东方欧美亚洲色图在线| 日韩黄色免费网站| 亚洲黄色免费网站| 亚洲国产精品视频| 久久国产福利国产秒拍| 一区二区三区中文字幕在线观看| 欧美日韩精品欧美日韩精品一| 国产成人精品免费一区二区| 午夜av电影一区| 亚洲第一主播视频| 午夜精品福利久久久| 懂色av一区二区在线播放| 91视频在线观看| 国产一区二区三区免费观看| 天天影视涩香欲综合网| 成人在线一区二区三区| 国产乱码精品一区二区三区忘忧草| 青娱乐精品视频在线| 久久91精品国产91久久小草| 日本视频免费一区| 久久99深爱久久99精品| 欧美日韩免费一区二区三区视频| 色综合色综合色综合| 91啪亚洲精品| 国产欧美日产一区| 一区二区三区国产精华| a级精品国产片在线观看| 欧美一区二区三区影视| 久久女同精品一区二区| 久久久精品欧美丰满| 黑人巨大精品欧美一区| 国产不卡视频一区二区三区| 精品成人a区在线观看| 国产三区在线成人av| 韩国成人在线视频| 久久天天做天天爱综合色| 国产成都精品91一区二区三| 成人开心网精品视频| 国产精品久线在线观看| 高清av一区二区| 亚洲日本欧美天堂| 天天色综合天天| 欧美日本国产视频| 激情综合色播五月| 中文文精品字幕一区二区| 久久人人爽人人爽| 成人小视频免费观看| 一区二区三区欧美日| 538在线一区二区精品国产| 亚洲少妇中出一区| 7777精品伊人久久久大香线蕉完整版| 青青青伊人色综合久久| 欧美激情一区二区三区四区| 一本色道a无线码一区v| 蜜桃av一区二区在线观看| 欧美在线免费观看亚洲| 亚洲精品视频免费看| 久久久久久麻豆| 欧美在线观看视频一区二区三区| 青青草精品视频| 欧美日韩国产色站一区二区三区| 亚洲午夜免费电影| 国产日韩视频一区二区三区| 欧美色电影在线| 国产suv精品一区二区883| 亚洲精品一二三| 国产性色一区二区| 欧美日韩国产天堂| 99久久精品情趣| 日本一区二区三区四区在线视频| 91美女在线看| 韩国av一区二区三区在线观看| 亚洲精品自拍动漫在线| 欧美精品一区视频| 欧美肥妇毛茸茸| 亚洲成人自拍网| 久久久国产精品麻豆| 欧美一二三四在线| 亚洲自拍偷拍综合| 69久久夜色精品国产69蝌蚪网| 99在线视频精品| 日本一区二区综合亚洲| 风间由美一区二区三区在线观看 | 欧美日韩国产乱码电影| 成人福利视频在线| 国产iv一区二区三区| 国产一区二区调教| 美国三级日本三级久久99| 五月天婷婷综合| 麻豆成人久久精品二区三区红| 亚洲精品久久久久久国产精华液| 国产欧美综合色| 国产精品美女一区二区三区 | 国产精品福利一区| 国产精品成人午夜| 亚洲精品写真福利| 视频一区二区中文字幕| 狂野欧美性猛交blacked| 午夜精品久久久久影视| 国产传媒久久文化传媒| va亚洲va日韩不卡在线观看| 色综合久久综合网97色综合| 一本大道av伊人久久综合| 成人性生交大片免费看在线播放 | 色94色欧美sute亚洲13| 色综合天天做天天爱| 亚洲人成影院在线观看| 亚洲视频1区2区| 久久国产精品72免费观看| 懂色av一区二区在线播放| 午夜视频一区二区三区| 成人性色生活片| 日韩一卡二卡三卡四卡| 国产精品情趣视频| 亚洲成人精品影院| 国产成人精品亚洲日本在线桃色| 国产成人亚洲精品狼色在线| 欧美一区二区在线观看| 日韩码欧中文字| 国产a区久久久| 美女一区二区久久| 麻豆成人综合网| 欧美自拍偷拍午夜视频| 国产网站一区二区| 一区二区在线观看不卡| 99久久综合精品| 久久久亚洲综合| 六月婷婷色综合| 欧美久久高跟鞋激| 午夜久久久久久久久| 精品一区二区国语对白| 欧美精品一区二区三区蜜桃| 一区二区三区精密机械公司| 成人精品视频一区二区三区 | 欧美一级视频精品观看| 亚洲国产另类av| 不卡影院免费观看| 最近日韩中文字幕| 在线观看视频一区| 婷婷国产v国产偷v亚洲高清| 色婷婷国产精品久久包臀| 日韩主播视频在线| 欧美一级黄色录像| 国产电影一区在线| 国产精品麻豆视频| 欧美日韩免费一区二区三区视频| 国产精品久久免费看| 欧美性色黄大片| 蜜桃av一区二区| 久久久不卡影院| 91影院在线观看| 蜜臀av一区二区在线观看| 日韩一区二区免费在线观看| 国产成人午夜片在线观看高清观看| 国产精品免费网站在线观看| 欧美日韩国产一级片| 国产高清不卡一区二区| 亚洲国产精品久久艾草纯爱| 88在线观看91蜜桃国自产| www.欧美.com| 久久激情综合网| 亚洲午夜在线观看视频在线| 久久久久一区二区三区四区| 在线观看日韩av先锋影音电影院| 国产精品卡一卡二| 国产欧美一区二区精品性| 欧美日本一道本| 欧美在线一区二区三区| av毛片久久久久**hd| 国产一区二区网址| 风流少妇一区二区| 亚洲视频一区二区在线| 欧美色网站导航| 午夜精品123| 亚洲成av人片一区二区| 亚洲人123区| 亚洲男女一区二区三区| 国产精品三级久久久久三级| 国产精品毛片大码女人| 国产欧美日韩激情| 中文字幕一区二区三区四区| 久久蜜桃av一区精品变态类天堂| 欧美一区二区国产| 久久精品免视看| 国产日韩欧美亚洲| 国产精品国产馆在线真实露脸| 中文字幕精品一区二区精品绿巨人| 国产日产精品一区| 久久久久久久久久久久电影 | 一区二区三区在线免费播放| 久久美女高清视频| 亚洲不卡一区二区三区|