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

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

?? periph.c

?? ezUSB fireware 的固件
?? C
字號:
#pragma NOIV					// Do not generate interrupt vectors
//-----------------------------------------------------------------------------
//	File:		periph.c
//	Contents:	Hooks required to implement USB peripheral function.
//
//	Copyright (c) 1997 AnchorChips, Inc. All rights reserved
//      Adapted for use with HIDs by Jan Axelson (jan@lvr.com)
//-----------------------------------------------------------------------------
#include <ezusb.h>
#include <ezregs.h>

extern BOOL	GotSUD;			// Received setup data flag
extern BOOL	Sleep;
extern BOOL	Rwuen;
extern BOOL	Selfpwr;

BYTE	Configuration;		// Current configuration
BYTE	AlternateSetting;	// Alternate settings
BYTE  suspCount;

// HID code start
BYTE InReportBytes;
void *dscr_ptr;
// HID code end

//-----------------------------------------------------------------------------
// Task Dispatcher hooks
//	The following hooks are called by the task dispatcher.
//-----------------------------------------------------------------------------

void TD_Init(void) 				// Called once at startup
{
	// Enable endpoints 0-7 IN and OUT
	//IN07VAL |= bmEP1 + bmEP2 + bmEP3 + bmEP4 + bmEP5 + bmEP6 + bmEP7;
	//OUT07VAL |= bmEP1 + bmEP2 + bmEP3 + bmEP4 + bmEP5 + bmEP6 + bmEP7;

//HID code start
//Comment out the above two lines and enable only the endpoints used by the HID interface.
	IN07VAL |= bmEP1 ;
	OUT07VAL |= bmEP2;
//HID code end

   // Enable interrupts for the OUT endpoints
//   OUT07IEN |= bmEP1 + bmEP2 + bmEP3 + bmEP4 + bmEP5 + bmEP6 + bmEP7;

//HID code start
//Comment out the above line and enable interrupts for the endpoints used by the HID interface.
// Enable interrrupts for Endpoint 2 OUT
   OUT07IEN |= bmEP2;
// Enable interrupts for Endpoint 1 IN
   IN07IEN |= bmEP1;

//HID code end

   suspCount = 1;

   OEA = 0xFF;

   Rwuen = TRUE;				// Enable remote-wakeup
}

void TD_Poll(void) 				// Called repeatedly while the device is idle
{
}

BOOL TD_Suspend(void) 			// Called before the device goes into suspend mode
{
	return(TRUE);
}

BOOL TD_Resume(void) 			// Called after the device resumes
{
	return(TRUE);
}

//-----------------------------------------------------------------------------
// Device Request hooks
//	The following hooks are called by the end point 0 device request parser.
//-----------------------------------------------------------------------------

BOOL DR_GetDescriptor(void)
{
	return(TRUE);
}

BOOL DR_SetConfiguration(void)	// Called when a Set Configuration command is received
{
	Configuration = SETUPDAT[2];
	return(TRUE);				// Handled by user code
}

BOOL DR_GetConfiguration(void)	// Called when a Get Configuration command is received
{
	IN0BUF[0] = Configuration;
	EZUSB_SET_EP_BYTES(IN0BUF_ID,1);
	return(TRUE);				// Handled by user code
}

BOOL DR_SetInterface(void) 		// Called when a Set Interface command is received
{
	AlternateSetting = SETUPDAT[2];
	return(TRUE);				// Handled by user code
}

BOOL DR_GetInterface(void) 		// Called when a Set Interface command is received
{
	IN0BUF[0] = AlternateSetting;
	EZUSB_SET_EP_BYTES(IN0BUF_ID,1);
	return(TRUE);				// Handled by user code
}

BOOL DR_GetStatus(void)
{
	return(TRUE);
}

BOOL DR_ClearFeature(void)
{
	return(TRUE);
}

BOOL DR_SetFeature(void)
{
	return(TRUE);
}

#define EZUSB_UNARM_EP(ep_id)  			EPIO[ep_id].cntrl = bmEPBUSY

BOOL DR_VendorCmnd(void)
{
   return(TRUE);
}

//-----------------------------------------------------------------------------
// USB Interrupt Handlers
//	The following functions are called by the USB interrupt jump table.
//-----------------------------------------------------------------------------


// Setup Data Available Interrupt Handler
void ISR_Sudav(void) interrupt 0
{
	GotSUD = TRUE;				// Set flag


	EZUSB_IRQ_CLEAR();
	USBIRQ = bmSUDAV;			// Clear SUDAV IRQ
}

// Setup Token Interrupt Handler
void ISR_Sutok(void) interrupt 0
{
	EZUSB_IRQ_CLEAR();
	USBIRQ = bmSUTOK;			// Clear SUTOK IRQ
}

void ISR_Sof(void) interrupt 0
{
	EZUSB_IRQ_CLEAR();
	USBIRQ = bmSOF;				// Clear SOF IRQ
}

void ISR_Ures(void) interrupt 0
{
   // Arm all of the OUT endpoints so they can accept data
   //   EPIO[OUT1BUF_ID].bytes = 0;

// HID code start
   // Arm the HID endpoints by loading the byte count registers.
   // Get the number of bytes the In report will send.
   // This information is in Report Count in the report descriptor,
   // and in Report_Count_In_Value in the REPORTDSCR structure.
   // (Assumes that ReportSize (specified in the report descriptor) = 8).
   // To do: calculate the number of bytes to send for reports with any ReportSize.
   REPORTDSCR *rdp;
   dscr_ptr = (REPORTDSCR xdata *) pReportDscr;
   rdp = dscr_ptr;
   InReportBytes = rdp -> Report_Count_In_Value;
   EPIO[IN1BUF_ID].bytes = InReportBytes;
   // The value for Out reports can be anything.
   EPIO[OUT2BUF_ID].bytes = 64;
// HID code end

//   EPIO[OUT3BUF_ID].bytes = 0;
//   EPIO[OUT4BUF_ID].bytes = 0;
//   EPIO[OUT5BUF_ID].bytes = 0;
//   EPIO[OUT6BUF_ID].bytes = 0;
//   EPIO[OUT7BUF_ID].bytes = 0;

	EZUSB_IRQ_CLEAR();
	USBIRQ = bmURES;			// Clear URES IRQ
}

void ISR_IBN(void) interrupt 0
{
   // ISR for the IN Bulk NAK (IBN) interrupt.
}

void ISR_Susp(void) interrupt 0
{
   Sleep = TRUE;

   EZUSB_IRQ_CLEAR();
   USBIRQ = bmSUSP;
}

void ISR_Ep0in(void) interrupt 0
{
}

void ISR_Ep0out(void) interrupt 0
{
}

void ISR_Ep1in(void) interrupt 0
{
// HID code start
   //This is the only In endpoint used by the HID interface.
   // When an IN transfer completes, rearm the endpoint.
	IN1BC = InReportBytes;
   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	IN07IRQ = bmEP1;
//HID code end
}

void ISR_Ep1out(void) interrupt 0
{
   int i;

   //
   // workaround to cover the case where the host thinks the
   // previous IN completed but EZ-USB didn't receive a valid
   // handshake (i.e. the ACK was scrambled).  If we have
   // received new OUT data (which we have, because we're in this
   // ISR) but the corresponding IN endpoint is still busy, then
   // we know we missed the handshake.  The solution is to flip
   // the data toggle and proceed with the new data.
   //
   if (EPIO[IN1BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN1BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT1BC; i++)
   {
      IN1BUF[i] = ~OUT1BUF[i];
   }

   // Arm the IN endpoint
   IN1BC = i;

   // Arm the OUT so it can receive the next packet
   OUT1BC = 0;


   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP1;
}

void ISR_Ep2in(void) interrupt 0
{
}

void ISR_Ep2out(void) interrupt 0
//HID code start
//This is the only Out endpoint used by the HID interface.
//Changed IN2 to IN1 in this routine
{
   int i;

   if (EPIO[IN1BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN1BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT2BC; i++)
   {
   // Send the complement of the received data back to the host.
      IN1BUF[i] = ~OUT2BUF[i];
   }

   // Arm the IN endpoint
   // I commented this line out and instead re-armed endpoint 1 after each In transfer
   // in the In endpoint's ISR.
   // This enables the host software to do In transfers only if desired.
   //IN1BC = i;

   // Arm the OUT endpoint so it can receive the next packet. (Write any value.)
   OUT2BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP2;
}

void ISR_Ep3in(void) interrupt 0
{
}

void ISR_Ep3out(void) interrupt 0
{
   int i;

   if (EPIO[IN3BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN3BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else                                        
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT3BC; i++)
   {
      IN3BUF[i] = ~OUT3BUF[i];
   }

   // Arm the IN endpoint
   IN3BC = i;

   // Arm the OUT so it can receive the next packet
   OUT3BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP3;
}

void ISR_Ep4in(void) interrupt 0
{
}

void ISR_Ep4out(void) interrupt 0
{
   int i;

   if (EPIO[IN4BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN4BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT4BC; i++)
   {
      IN4BUF[i] = ~OUT4BUF[i];
   }

   // Arm the IN endpoint
   IN4BC = i;

   // Arm the OUT so it can receive the next packet
   OUT4BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP4;
}

void ISR_Ep5in(void) interrupt 0
{
}

void ISR_Ep5out(void) interrupt 0
{
   int i;

   if (EPIO[IN5BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN5BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT5BC; i++)
   {
      IN5BUF[i] = ~OUT5BUF[i];
   }

   // Arm the IN endpoint
   IN5BC = i;

   // Arm the OUT so it can receive the next packet
   OUT5BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP5;
}

void ISR_Ep6in(void) interrupt 0
{
}

void ISR_Ep6out(void) interrupt 0
{
   int i;

   if (EPIO[IN6BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN6BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT6BC; i++)
   {
      IN6BUF[i] = ~OUT6BUF[i];
   }

   // Arm the IN endpoint
   IN6BC = i;

   // Arm the OUT so it can receive the next packet
   OUT6BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP6;
}

void ISR_Ep7in(void) interrupt 0
{
}

void ISR_Ep7out(void) interrupt 0
{
   int i;

   if (EPIO[IN7BUF_ID].cntrl & bmEPBUSY)
   {
      TOGCTL = 0x08 | IN7BUF_ID;
      WRITEDELAY();
      if (TOGCTL & 0x80)
         TOGCTL |= 0x20;
      else
         TOGCTL |= 0x40;
   }

   // Loop the data to the IN endpoint
   for (i=0; i < OUT7BC; i++)
   {
      IN7BUF[i] = ~OUT7BUF[i];
   }

//   // BUGBUG If 63 bytes was written, inject an error
//   if (OUT7BC == 63)
//   {
//      IN7BUF[3] = IN7BUF[4];
//   }

   // Arm the IN endpoint
   IN7BC = i;

   // Arm the OUT so it can receive the next packet
   OUT7BC = 0;

   // clear the IRQ
	EZUSB_IRQ_CLEAR();
	OUT07IRQ = bmEP7;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产va精品久久久不卡综合| 国产黄色精品视频| 欧美午夜不卡视频| 亚洲一区二区欧美激情| 91久久线看在观草草青青| 亚洲免费观看高清在线观看| 欧美亚洲综合久久| 另类小说欧美激情| 久久综合九色综合欧美亚洲| 成人综合婷婷国产精品久久蜜臀| 精品成人佐山爱一区二区| 国产精品一二三| 国产蜜臀av在线一区二区三区| 国产成人亚洲综合a∨婷婷图片| 久久亚洲精精品中文字幕早川悠里| 一本久道中文字幕精品亚洲嫩 | 在线一区二区三区四区| 亚洲丶国产丶欧美一区二区三区| 欧美日韩小视频| 激情六月婷婷综合| 中文字幕综合网| 欧美视频一区二区| 麻豆精品一区二区三区| 国产精品视频一二| 欧美三级三级三级| 国产精品77777竹菊影视小说| 亚洲婷婷在线视频| 精品国产乱码久久久久久图片| 99久久久久久| 久久精品av麻豆的观看方式| 亚洲欧洲精品一区二区三区| 99精品视频一区二区三区| 日本sm残虐另类| 亚洲欧洲国产日韩| 日韩欧美亚洲国产另类| av成人免费在线| 久久精品国产99久久6| 亚洲欧美成人一区二区三区| www激情久久| 欧美日韩一区在线| 99精品欧美一区| 久久成人免费网站| 亚洲成人动漫在线免费观看| 国产精品久久久久久久蜜臀| 日韩精品在线网站| 国产午夜精品一区二区三区嫩草 | 精品国产乱码久久| 欧美精品丝袜久久久中文字幕| 精品一区二区综合| 暴力调教一区二区三区| 国产日韩一级二级三级| 国产在线观看免费一区| 婷婷久久综合九色综合绿巨人| 中文字幕不卡在线观看| 久久久亚洲精华液精华液精华液| 91美女在线视频| 成人免费毛片嘿嘿连载视频| 激情综合一区二区三区| 婷婷中文字幕一区三区| 亚洲午夜av在线| 1区2区3区精品视频| 久久先锋影音av| 久久综合一区二区| 久久综合成人精品亚洲另类欧美| 6080亚洲精品一区二区| 欧洲一区在线观看| 色哟哟一区二区在线观看| www.日韩在线| 成人黄色电影在线| 国产成人在线免费观看| 国产成人三级在线观看| 国产在线一区观看| 国产乱码精品一区二区三区av| 日本美女一区二区三区视频| 同产精品九九九| 亚洲精品一卡二卡| 中文字幕亚洲精品在线观看| 国产精品国产三级国产aⅴ入口 | 日韩欧美二区三区| 5566中文字幕一区二区电影| 欧美少妇性性性| 欧美日韩你懂得| 欧美一区二区三区的| 91精品国产福利| 日韩久久精品一区| 久久久亚洲欧洲日产国码αv| 精品久久久久久亚洲综合网 | 亚洲精品在线观看网站| 久久影院视频免费| 中文av一区二区| 国产日产欧美精品一区二区三区| 亚洲精品一区二区三区在线观看| 欧美一区二区三区免费视频| 精品久久久久av影院| 国产婷婷一区二区| 亚洲免费看黄网站| 日韩国产在线观看| 国产精品一区二区你懂的| 91在线视频免费观看| 国产精品无人区| 综合久久一区二区三区| 亚洲不卡在线观看| 久久精品国产秦先生| 国产成人午夜片在线观看高清观看| 国产精品123区| 色噜噜夜夜夜综合网| 欧美综合欧美视频| 制服.丝袜.亚洲.中文.综合| 欧美电视剧在线看免费| 久久综合九色综合欧美98| 亚洲精品亚洲人成人网| 婷婷成人激情在线网| 免费av成人在线| 9i看片成人免费高清| 91精品国产综合久久久久| 中文字幕不卡在线播放| 亚洲成人精品一区| 国产大片一区二区| 欧美三级乱人伦电影| 日韩你懂的在线观看| 欧美国产日产图区| 亚洲午夜激情av| 成人网在线播放| 欧美中文一区二区三区| 日韩欧美专区在线| 欧美国产乱子伦| 午夜精品一区在线观看| 精品一区二区在线看| av网站一区二区三区| 欧美日韩国产综合久久| 国产午夜精品一区二区| 亚洲一区视频在线| 国产成人亚洲综合a∨婷婷图片| 91福利社在线观看| 精品乱人伦小说| 午夜精品久久久久久久久| 成人免费电影视频| 精品久久久久99| 污片在线观看一区二区| 色欧美日韩亚洲| 中文字幕一区二区三区av| 国产精品自拍av| 精品国产91洋老外米糕| 日本成人中文字幕在线视频| 欧美午夜精品一区| 亚洲视频免费在线观看| 成人av电影在线| 久久精品视频免费| 久久成人综合网| 欧美一区二区视频在线观看| 一区二区三区精品视频在线| 99re视频精品| 国产午夜精品美女毛片视频| av中文字幕在线不卡| 国产亚洲精品免费| 秋霞电影一区二区| 色88888久久久久久影院按摩| 精品精品欲导航| 五月激情综合色| 一本色道久久加勒比精品| 国产精品久久久久久久久快鸭 | 国产精品久久免费看| 免费一级片91| 欧美精品第一页| 亚洲午夜影视影院在线观看| 狠狠色丁香婷婷综合久久片| 欧美日韩三级在线| 亚洲在线免费播放| 91首页免费视频| 欧美经典一区二区| 国产一区二区三区日韩| 欧美美女一区二区三区| 伊人一区二区三区| 91浏览器打开| 成人欧美一区二区三区在线播放| 成人自拍视频在线观看| 亚洲精品一区二区三区福利| 婷婷综合久久一区二区三区| 欧美日韩一级大片网址| 亚洲视频一区在线观看| 波多野结衣一区二区三区| 国产日产欧美一区| 成人性色生活片免费看爆迷你毛片| 精品国产一区二区精华| 久久精品国产久精国产| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲一区二区三区免费视频| 91福利在线免费观看| 亚洲男人的天堂网| 色婷婷亚洲精品| 一区二区在线观看免费| 在线观看日韩一区| 亚洲成人免费视频| 日韩一本二本av| 精品一区二区三区的国产在线播放| 欧美高清精品3d| 狠狠色综合色综合网络| 国产视频一区二区在线观看| 久久理论电影网| 国产一区二区三区蝌蚪|