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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? psgdrv.c

?? SIM卡的驅(qū)動(dòng)程序,有利于開(kāi)發(fā)一些與SIM相通的一些工具,或者手機(jī)軟件SIM驅(qū)動(dòng)的開(kāi)發(fā)
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
      APDULength = PSCommandBuffer.P3;
   }

   if (PSDataCount<APDULength)
      {
      PSIntAction = PSWaitProcByte;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitProcByte;
      //End PS Debug
#endif
	  }
   else
     {
      PSIntAction = PSWaitStatus;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitStatus;
      //End PS Debug
#endif

      EnableDMAWaitStatus();
     }
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSWaitProcByte
Desc:    Interrupt action for TX interrupt when a Procedure Byte is expected
         See ISO/IEC 7816-3 8.2.2.
         This Handler Checks the value of the procedure byte and performs
         the appropriate action, depending on its value and the direction
         of the data transfer.
         The interrupt handler is changed as appropriate to the following
         action.
         The possible actions are:
             Await a single byte and return to waiting for a procedure byte.
             Send a single byte and return to waiting for a procedure byte.
             Await remaining bytes from the SIM.
             Send the remaining bytes to the SIM.
             Await the second Status byte if the Procedure Byte indicated
                   that something went wrong.
             Keep waiting for a procedure byte - the procedure byte was NULL.
Params:  None
Returns: Nothing
Caveats: Note this is the 'Critical' decision point in a SIM transfer!
         It is the only relatively complex Interrupt Action Function.
*/

static void PSWaitProcByte(void)
   {
   UINT8 RXByte, RXAck;
   DMA_THRESHOLD_PARAMS ThresholdParams;
   RXByte = PSGet();

   

   //GSMcprintf( MEMPutChar, "PSWaitProcByte\n" );

   if( *(UINT16 *)SIM_STAT_REG & SIM_ME_RX_FAIL )
   return;            //parity error, ignore it

   if (RXByte!=0x60)  /* Null byte... We have to be patient */
      {
      RXAck = (RXByte^PSCommandBuffer.INS)&0xFE;
      if (RXAck==0xFE) /* INS has been Acked - Transfer next byte only */
         {
         /* Note: no need to manipulate VPP on a GSM SIM
            If there is, then, check RXByte&0x01 */
         if (PSDirection==PS_WRITE)
            {
            PSChangeRXtoTX();
            // In enhanced mode, extend the guard period of Tx to avoid the SIM missing the start bit 
            // when change the direction of transmission from Rx to Tx.
            if (currentPTSState == PTS_IN_ENHANCED_MODE)
               PSSetGuardPeriod(PS_EXTENDED_GUARD_PERIOD);
            PSSend(PSDataBuffer[PSDataCount++]);
            PSIntAction = PSTXOneByte;

#if SIM_DEBUG == SIM_DEBUG_MAX
            //PS Debug...
            OldIntAction_Dbg = NewIntAction_Dbg;
            NewIntAction_Dbg = _PSTXOneByte;
            //End PS Debug
#endif
            }
         else
            {
            PSIntAction = PSRXOneByte;
#if SIM_DEBUG == SIM_DEBUG_MAX
            //PS Debug...
            OldIntAction_Dbg = NewIntAction_Dbg;
            NewIntAction_Dbg = _PSRXOneByte;
            //End PS Debug
#endif
			}
         }
      else if (RXAck==0x00) /* INS has been Acked - Transfer remaining bytes */
         {
         /* Note: no need to manipulate VPP on a GSM SIM
            If there is then, check RXByte&0x01 */
         if (PSDirection==PS_WRITE)
            {
            PSChangeRXtoTX();
            // In enhanced mode, extend the guard period of Tx to avoid the SIM missing the start bit 
            // when change the direction of transmission from Rx to Tx.
            if (currentPTSState == PTS_IN_ENHANCED_MODE)
               PSSetGuardPeriod(PS_EXTENDED_GUARD_PERIOD);
            PSSend(PSDataBuffer[PSDataCount++]);
            PSIntAction = PSTXData;
#if SIM_DEBUG == SIM_DEBUG_MAX
            //PS Debug...
            OldIntAction_Dbg = NewIntAction_Dbg;
            NewIntAction_Dbg = _PSTXData;
            //End PS Debug
#endif
            }
         else
            {
               PSIntAction = PSRXData;
#if SIM_DEBUG == SIM_DEBUG_MAX
               //PS Debug...
               OldIntAction_Dbg = NewIntAction_Dbg;
               NewIntAction_Dbg = _PSRXData;
               //End PS Debug
#endif
               
               PSTxDelayDisable();  /* CX805 we must disable Tx DMA Delay during receive DMA, GSMSW1625*/
               SetDMAController (SIMConfigDataPtr->pDMARegs, /* DMA Channel to be used */
                                 DEV_SEL_SIM,	                   /* SIM peripheral         */ 
                                (DMA_AUTO_STOP_ON | DMA_SRC_BYTE | DMA_DST_BYTE  | DMA_THR_INTEN), // DMA_AUTO_STOP and byte to byte xfer */
                                 DEV_TO_MEM,   
                                 SIMConfigDataPtr->pSIM_Src,
                                 SIMConfigDataPtr->BaseAddress,
                                 SIMConfigDataPtr->Length);

               // Check for FETCH command for which P3 is encoded as 0 for a 256 byte transfer.
               if (PSCommandBuffer.INS == 0x12) 
               {
                  SIMConfigDataPtr->EndAddress =(CHAR *)(SIMConfigDataPtr->BaseAddress + 
                                                GetAPDULength(PSCommandBuffer.P3) +1);
			   }
			   else
			   {
                  SIMConfigDataPtr->EndAddress =(CHAR *)(SIMConfigDataPtr->BaseAddress + 
                                                                 PSCommandBuffer.P3 +1);
			   }
               ThresholdParams.Threshold = (VOID *) SIMConfigDataPtr->EndAddress;
			   ThresholdParams.Mode = NON_CIRCULAR; // as non circular usage of DMA, no need to specify base and end address
													// for threshold setup
               
               SetDMAThreshold (SIMConfigDataPtr->pDMARegs, &ThresholdParams); 

               DEVICE_SPEC_EnableInterrupts(eIRQ1_NONE, eIRQ2_NONE,     // Enable nothing
                                            eIRQ1_SIM,  eIRQ2_NONE);    // Disable sim irq
               PSRxDMAEnabled=TRUE;
               DEVICE_SPEC_EnableInterrupts(SIM_DMA_IRQ, eIRQ2_NONE,     // Enable sim DMA
                                            eIRQ1_NONE,  eIRQ2_NONE);    // Disable nothing

               EnableDMA (SIMConfigDataPtr->pDMARegs);       
               DEVICE_SPEC_EnableInterrupts(eIRQ1_SIM,  eIRQ2_NONE,     // Enable sim irq
                                            eIRQ1_NONE, eIRQ2_NONE);    // Disable nothing
            }
         }
      else
         {
         RXAck = RXByte&0xF0;
         if (RXAck==0x60||RXAck==0x90) /* SIM has sent bad status - wait for
                                          second status byte */
            {
            PSStatusBuffer.SW1 = RXByte;
            PSBadSIMStatus = TRUE;
            PSIntAction = PSWaitSW2;
#if SIM_DEBUG == SIM_DEBUG_MAX
            //PS Debug...
            OldIntAction_Dbg = NewIntAction_Dbg;
            NewIntAction_Dbg = _PSWaitSW2;
            //End PS Debug
#endif
            }
         /* else it is a mystery byte - ignore it ?????? */
         }
      }
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSRXOneByte
Desc:    Interrupt action for RX interrupt following reception of a data byte
         in 'Single Shot' mode.
         See ISO/IEC 7816-3 8.2.2.
         The handler stores the byte in the data buffer.
         If there is no further data to transfer The interrupt handler is
         changed to wait for the status bytes.  If more data is to be
         transferred The interrupt handler is changed to wait for a procedure
         byte.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSRXOneByte(void)
   {
   INT16 APDULength;

   PSDataBuffer[PSDataCount++] = PSGet();

   // Check for FETCH command for which P3 is encoded as 0 for a 256 byte transfer.
   if (PSCommandBuffer.INS == 0x12) 
   {
      APDULength = (INT16)GetAPDULength(PSCommandBuffer.P3);
   }
   else
   {
      APDULength = PSCommandBuffer.P3;
   }

   if (APDULength<=PSDataCount)
      {
      PSIntAction = PSWaitStatus;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitStatus;
      //End PS Debug
#endif

      EnableDMAWaitStatus();
     }
   else
      {
      PSIntAction = PSWaitProcByte;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitProcByte;
      //End PS Debug
#endif

	  }
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSRXData
Desc:    Interrupt action for RX interrupt following reception of a data byte
         in normal mode.
         See ISO/IEC 7816-3 8.2.2.
         The handler stores the byte in the data buffer.
         If there is no further data to transfer The interrupt handler is
         changed to wait for the status bytes, otherwise it waits for the
         next byte.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSRXData(void)
  {
   INT16 APDULength;

     SIMbuffPtr = (UINT8 *)SIMBuffer;

   // Check for FETCH command for which P3 is encoded as 0 for a 256 byte transfer.
   if (PSCommandBuffer.INS == 0x12) 
   {
      APDULength = (INT16)GetAPDULength(PSCommandBuffer.P3);
   }
   else
   {
      APDULength = PSCommandBuffer.P3;
   }
     if( PSDataCount < APDULength  )    
        {
        DMABufferHasData = TRUE;
        }
     PSWaitStatus();
  }

/*------------------------------------------------------------------------*/

/*
Name:    PSTXData
Desc:    Interrupt action for TX interrupt following transmission of a data
         byte in normal mode.
         See ISO/IEC 7816-3 8.2.2.
         If there is further data to transfer, the next byte is transmitted.
         Otherwise the UART is changed to receive mode, and the interrupt
         handler changed to wait for the status bytes.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSTXData(void)
   {

   //GSMcprintf( MEMPutChar, "PSTXData\n" );

   if (PSDataCount<PSCommandBuffer.P3)
      {
      PSSend(PSDataBuffer[PSDataCount++]);
      }
   else
      {
      PSChangeTXtoRX();
      PSIntAction = PSWaitStatus;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitStatus;
      //End PS Debug
#endif

      EnableDMAWaitStatus();
      }
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSWaitStatus
Desc:    Interrupt action for RX interrupt when a Status Byte, SW1 is expected
         See ISO/IEC 7816-3 8.2.2.
         Once correctly received, the interrupt handler is changed to expect
         the second status byte.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSWaitStatus(void)
   {
   UINT8 RXByte, RXAck;
   INT16 APDULength;


   // Check for FETCH command for which P3 is encoded as 0 for a 256 byte transfer.
   if (PSCommandBuffer.INS == 0x12) 
   {
      APDULength = (INT16)GetAPDULength(PSCommandBuffer.P3);
   }
   else
   {
      APDULength = PSCommandBuffer.P3;
   }

   //GSMcprintf( MEMPutChar, "PSWaitStatus\n" );

   if( DMABufferHasData )
      {
      SIMbuffPtr += APDULength;
      }
   RXByte = *SIMbuffPtr++;    //Read status byte
   if (RXByte!=0x60) /* Its a NULL byte - must be patient */
      {                                                    
      RXAck = RXByte&0xF0;
      if (RXAck==0x60||RXAck==0x90)
         {
         PSStatusBuffer.SW1 = RXByte;
		 PSIntAction = PSWaitSW2;
#if SIM_DEBUG == SIM_DEBUG_MAX
         //PS Debug...
         OldIntAction_Dbg = NewIntAction_Dbg;
         NewIntAction_Dbg = _PSWaitSW2;
         //End PS Debug
#endif

         }
      /* else it is a mystery byte - ignore it ?????? */
      }
   else
      {
      PSIntAction =	PSWaitStatusByteByByte;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSWaitStatusByteByByte;
      //End PS Debug
#endif
	  }
   }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片久久久久久久| 日韩视频免费观看高清完整版 | 久久久久国产免费免费| 久久精品人人做| 有坂深雪av一区二区精品| 青草av.久久免费一区| 国产成人在线视频网址| 色婷婷激情一区二区三区| 91麻豆精品91久久久久同性| 国产亚洲欧美一区在线观看| 一区二区日韩av| 狠狠色丁香婷婷综合| 色婷婷av一区二区| 日韩一级欧美一级| 国产精品理伦片| 毛片基地黄久久久久久天堂| caoporn国产一区二区| 91精品在线免费| 中文字幕av不卡| 日产欧产美韩系列久久99| a在线欧美一区| 欧美电影免费观看高清完整版| 中文字幕在线视频一区| 日本sm残虐另类| 一本一道久久a久久精品| 欧美一区二区三区播放老司机| 中文字幕一区不卡| 韩日欧美一区二区三区| 欧美日韩免费一区二区三区| 欧美激情资源网| 另类调教123区| 在线观看视频一区| 国产欧美日韩另类一区| 免费成人性网站| 在线视频国内一区二区| 国产欧美日韩精品一区| 久久精品99久久久| 欧美日韩精品三区| 亚洲欧美日韩国产手机在线| 国产一本一道久久香蕉| 9191成人精品久久| 亚洲精品大片www| jvid福利写真一区二区三区| 久久久久国产精品麻豆ai换脸| 日韩中文字幕一区二区三区| 91福利区一区二区三区| 国产欧美精品在线观看| 久久不见久久见免费视频7| 在线亚洲一区观看| 中文字幕中文字幕在线一区 | 精品成人一区二区三区四区| 亚洲国产精品久久艾草纯爱| 99免费精品在线| 国产色综合久久| 精品一区二区三区的国产在线播放| 欧美自拍丝袜亚洲| 亚洲激情在线激情| 美女一区二区久久| 在线区一区二视频| 亚洲色图视频网站| 国产成人综合网| 精品99999| 国产做a爰片久久毛片| 日韩欧美一级二级三级久久久| 丝袜美腿亚洲综合| 欧美日韩综合色| 亚洲国产成人精品视频| 在线观看日韩精品| 亚洲午夜电影在线观看| 欧美日韩在线三级| 亚洲综合一区二区| 欧美视频一区在线| 亚洲欧美另类小说视频| 一本到不卡免费一区二区| 亚洲猫色日本管| 欧美色图12p| 蜜芽一区二区三区| 欧美精选在线播放| 日韩主播视频在线| 日韩美女主播在线视频一区二区三区 | 亚洲品质自拍视频网站| 91在线观看污| 一区二区三区在线视频播放| 欧美亚洲一区二区三区四区| 午夜私人影院久久久久| 欧美一区二区视频在线观看| 老司机精品视频线观看86| 亚洲精品一区在线观看| 豆国产96在线|亚洲| 一区免费观看视频| 在线观看一区二区视频| 日韩国产欧美在线视频| 精品奇米国产一区二区三区| 国产精品1区2区| 亚洲天堂av老司机| 欧美视频在线观看一区| 麻豆免费精品视频| 国产清纯白嫩初高生在线观看91| 99热精品国产| 亚洲成人激情自拍| 精品日韩av一区二区| 高清国产一区二区| 亚洲免费视频中文字幕| 666欧美在线视频| 国产老妇另类xxxxx| 综合在线观看色| 欧美日韩国产123区| 国产一区在线观看麻豆| 综合中文字幕亚洲| 69堂精品视频| 国产精品一二二区| 夜夜爽夜夜爽精品视频| 欧美mv和日韩mv国产网站| 成人爱爱电影网址| 午夜电影网亚洲视频| 国产清纯在线一区二区www| 欧美做爰猛烈大尺度电影无法无天| 美女尤物国产一区| 中文字幕视频一区| 欧美一区二区三区视频在线| 岛国精品在线观看| 日韩福利视频导航| 国产精品福利在线播放| 欧美精品一二三| 成人午夜伦理影院| 日韩高清国产一区在线| 国产精品水嫩水嫩| 欧美一区二区三区四区五区 | 亚洲欧美日韩中文播放 | 国产精品乡下勾搭老头1| 亚洲午夜精品网| 日本一区二区三区在线观看| 欧美三级欧美一级| 成人免费视频视频在线观看免费| 视频一区在线播放| 亚洲视频你懂的| 亚洲精品在线免费观看视频| 欧美午夜理伦三级在线观看| 成人免费视频一区二区| 毛片av中文字幕一区二区| 亚洲黄色av一区| 国产精品色哟哟| 欧美成人女星排名| 欧美性做爰猛烈叫床潮| 波多野结衣亚洲| 狠狠色综合播放一区二区| 午夜免费久久看| 亚洲精品国产第一综合99久久| 国产午夜精品在线观看| 日韩精品一区二区三区四区视频| 欧美午夜视频网站| 91浏览器打开| 成人免费视频视频在线观看免费| 免费观看91视频大全| 亚洲国产成人tv| 亚洲激情校园春色| 中文字幕在线视频一区| 国产亚洲欧美一区在线观看| 欧美不卡激情三级在线观看| 欧美日韩www| 欧美性受极品xxxx喷水| 一本色道久久加勒比精品 | 亚洲夂夂婷婷色拍ww47| 亚洲欧洲另类国产综合| 国产情人综合久久777777| 精品处破学生在线二十三| 欧美一区二区在线不卡| 51精品视频一区二区三区| 欧美这里有精品| 色偷偷久久人人79超碰人人澡| a美女胸又www黄视频久久| 国产成人免费网站| 国产精品原创巨作av| 国产一区二区三区av电影 | 国产精品免费看片| 国产免费观看久久| 欧美激情一二三区| 久久久精品欧美丰满| 久久久久久久网| 国产日韩精品久久久| 久久久久青草大香线综合精品| 久久夜色精品国产噜噜av| 精品国产一区二区三区久久久蜜月| 日韩欧美综合一区| 欧美大片日本大片免费观看| 制服丝袜中文字幕亚洲| 91精品免费在线观看| 日韩欧美视频在线| 精品久久一二三区| 久久蜜桃香蕉精品一区二区三区| 久久精品视频一区二区三区| 欧美极品美女视频| 国产精品传媒入口麻豆| 亚洲免费高清视频在线| 亚洲第一久久影院| 日韩av电影天堂| 国产乱码字幕精品高清av| 粉嫩欧美一区二区三区高清影视| 成人av电影免费在线播放| 91网页版在线|