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

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

?? jtag_chain.c

?? c8051F00x的pca的使用
?? C
?? 第 1 頁 / 共 3 頁
字號:
    
        retval = retval >> 1;
        if (TDO) {
            retval |= (0x01 << (num_bits - 1));
        }
        
        if ((i == (num_bits - 1)) && (num_IR_bits_after == 0)) {
            TMS = 1;                              // move to Exit1_IR state
        }        

        JTAG_StrobeTCK();                         // move to Shift_IR state
                                                  // advance
    }

    TDI = 1; 
    for (i=0; i < num_IR_bits_after; i++) {       // now process IR bits after the
                                                  // isolated device
        if (i == (num_IR_bits_after - 1)) {
            TMS = 1;                              // move to Exit1_IR state
        }  
    
    
        JTAG_StrobeTCK();                         // fill the IR of the devices
                                                  // after the isolated device
    }                                             // with all ones, the BYPASS opcode.

    // navigate back to the RTI state
   
    TMS = 1;
    JTAG_StrobeTCK ();                            // move to Update_IR
    TMS = 0;
    JTAG_StrobeTCK ();                            // move to RTI state

    return retval;
}

//------------------------------------------------------------------------------------
// JTAG_DR_Scan
//------------------------------------------------------------------------------------
// This routine shifts <num_bits> of <data> into the Data Register of the isolated 
// device in the chain, and returns up to 32-bits of data read from its Data Register.
// 
// Assumes the JTAG state machine starts in the Run_Test/Idle state.
// Leaves in the Run_Test/Idle state.
//
unsigned long JTAG_DR_Scan (unsigned long dat, char num_bits)
{

    unsigned long retval;                        // JTAG return value
    char i;                                      // JTAG DR bit counter

    retval = 0x0L;

    // navigate the JTAG State Machine in all devices to the Shift_DR state
    TMS = 1;                            
    JTAG_StrobeTCK ();                           // move to SelectDR
    TMS = 0;
    JTAG_StrobeTCK ();                           // move to Capture_DR
    TMS = 0;
    JTAG_StrobeTCK ();                           // move to Shift_DR state 
    
    
    TDI = 0;       
    for (i=0; i < num_devices_before; i++) {
                                                  
       JTAG_StrobeTCK();                         // fill the BYPASS Register 
                                                 // of the devices before the 
    }                                            // isolated device with zeros.
                                                  
                                                   

    for (i=0; i < num_bits; i++) {
   
        TDI = (dat & 0x01);                      // determine the output 
        dat = dat >> 1;
        
        retval = retval >> 1;
        if (TDO) {
            retval |= (0x01L << (num_bits - 1));
        }
        
        if ((i == (num_bits - 1)) && (num_devices_after == 0)) {
            TMS = 1;                             // move to Exit1_IR state
        }        

        JTAG_StrobeTCK();                          
                                                 //output and get input
    }
     
    TDI = 0;
    for (i=0; i < num_devices_after; i++) {
  
        if (i == (num_devices_after - 1)) {
            TMS = 1;                             // move to Exit1_IR state
        }  
         
                                                 // move to Shift_DR state,
       JTAG_StrobeTCK();                         // fill the BYPASS Register 
                                                 // of the devices after the 
    }                                            // isolated device with zeros.
                                                     
    // navigate the JTAG State Machine in all devices to the RTI state
    TMS = 1;
    JTAG_StrobeTCK ();                           // move to Update_DR
    TMS = 0;
    JTAG_StrobeTCK ();                           // move to RTI state

    return retval;                               // retval is MSB aligned
}

//------------------------------------------------------------------------------------
// JTAG_IWrite
//------------------------------------------------------------------------------------
// This routine performs an indirect write to register <ireg>, containing <dat>, of
// <num_bits> in length.  It follows the write operation with a polling operation, and
// returns when the operation is completed.  Note: the polling implemented here refers
// to the JTAG register write operation being completed, NOT the FLASH write operation.
// Polling for the FLASH write operation is handled at a higher level
// Examples of valid indirect registers are:
//  FLASHCON - FLASH Control
//  FLASHSCL - FLASH Scale
//  FLASHADR - FLASH Address
//  FLASHDAT - FLASH Data
// Leaves in the Run_Test/Idle state.
//
void JTAG_IWrite (unsigned int ireg, unsigned long dat, int num_bits)
{
   
   bit done;                              // TRUE = write complete; FALSE otherwise
   
   JTAG_IR_Scan (ireg, INST_LENGTH);      // load IR with <ireg>

   dat |= (0x03L << num_bits);            // append 'WRITE' opcode to data
   
   // load DR with <dat>
   JTAG_DR_Scan (dat, num_bits + 2);      // initiate the JTAG write

   // load DR with '0', and check for BUSY bit to go to '0'.
   do {
      done = !(JTAG_DR_Scan (0x0L, 1));   // poll for JTAG_BUSY bit
   } while (!done);
}

//------------------------------------------------------------------------------------
// JTAG_IRead
//------------------------------------------------------------------------------------
// This routine performs an indirect read of register <ireg>, of <num_bits> in length.
// It follows the read operation with a polling operation, and returns when the 
// operation is completed.  Note: the polling implemented here refers to the JTAG 
// register read operation being completed, NOT the FLASH read operation.
// Polling for the FLASH read operation is handled at a higher level.
// Examples of valid indirect registers are:
//  FLASHCON - FLASH Control
//  FLASHSCL - FLASH Scale
//  FLASHADR - FLASH Address
//  FLASHDAT - FLASH Data
// Leaves JTAG in the Run_Test/Idle state.
//
unsigned long JTAG_IRead (unsigned int ireg, int num_bits) {
   
   unsigned long retval;                  // value returned from READ operation
   bit done;                              // TRUE = write complete; FALSE otherwise
   
   JTAG_IR_Scan (ireg, INST_LENGTH);      // load IR with <ireg>

   // load DR with read opcode (0x02)
   JTAG_DR_Scan (0x02L, 2);               // initiate the JTAG read

   do {
      done = !(JTAG_DR_Scan (0x0L, 1));   // poll for JTAG_BUSY bit
   } while (!done);
   
   retval = JTAG_DR_Scan (0x0L, num_bits + 1);  // allow poll operation to
                                                // read remainder of the bits
   retval = retval >> 1;                  // shift JTAG_BUSY bit off the end

   return retval;
}

//------------------------------------------------------------------------------------
// FLASH_ByteRead
//------------------------------------------------------------------------------------
// This routine reads the byte at <addr> and stores it at the address pointed to by
// <pdat>.
// Returns TRUE if the operation was successful; FALSE otherwise (page 
// read-protected).
//
int FLASH_ByteRead (unsigned int addr, unsigned char *pdat)
{
   unsigned long testval;                       // holds result of FLASHDAT read
   bit done;                                    // TRUE/FALSE flag
   int retval;                                  // TRUE if operation successful

   JTAG_IWrite (FLASHSCL, 0x86L, FLSC_LEN);     // set FLASHSCL based on SYSCLK 
                                                // frequency (2MHz = 0x86)

   // set FLASHADR to address to read from
   JTAG_IWrite (FLASHADR, (unsigned long) addr, FLA_LEN);

   JTAG_IWrite (FLASHCON, 0x02L, FLCN_LEN);     // set FLASHCON for FLASH Read 
                                                // operation (0x02)

   JTAG_IRead (FLASHDAT, FLD_RDLEN);            // initiate the read operation

   JTAG_IWrite (FLASHCON, 0x0L, FLCN_LEN);      // set FLASHCON for 'poll' operation

   do {
      done = !(JTAG_IRead (FLASHDAT, 1));       // poll for FLBUSY to de-assert
   } while (!done);

   testval = JTAG_IRead (FLASHDAT, FLD_RDLEN);  // read the resulting data

   retval = (testval & 0x02) ? FALSE: TRUE;     // FLFail is next to LSB

   testval = testval >> 2;                      // shift data.0 into LSB position

   *pdat = (unsigned char) testval;             // place data in return location

   return retval;                               // return FLASH Pass/Fail
}

//------------------------------------------------------------------------------------
// FLASH_ByteWrite
//------------------------------------------------------------------------------------
// This routine writes the data <dat> to FLASH at the address <addr>.
// Returns TRUE if the operation was successful; FALSE otherwise (page 
// write-protected).
//
int FLASH_ByteWrite (unsigned int addr, unsigned char dat)
{
   unsigned long testval;                       // holds result of FLASHDAT read
   int done;                                    // TRUE/FALSE flag
   int retval;                                  // TRUE if operation successful

   JTAG_IWrite (FLASHSCL, 0x86L, FLSC_LEN);     // set FLASHSCL based on SYSCLK 
                                                // frequency (2MHz = 0x86)

   // set FLASHADR to address to write to
   JTAG_IWrite (FLASHADR, (unsigned long) addr, FLA_LEN);

   JTAG_IWrite (FLASHCON, 0x10L, FLCN_LEN);     // set FLASHCON for FLASH Write 
                                                // operation (0x10)

   // initiate the write operation
   JTAG_IWrite (FLASHDAT, (unsigned long) dat, FLD_WRLEN);

   JTAG_IWrite (FLASHCON, 0x0L, FLCN_LEN);      // set FLASHCON for 'poll' operation

   do {
      done = !(JTAG_IRead (FLASHDAT, 1));       // poll for FLBusy to de-assert
   } while (!done);

   testval = JTAG_IRead (FLASHDAT, 2);          // read FLBusy and FLFail

   retval = (testval & 0x02) ? FALSE: TRUE;     // FLFail is next to LSB

   return retval;                               // return FLASH Pass/Fail
}

//------------------------------------------------------------------------------------
// FLASH_PageErase
//------------------------------------------------------------------------------------
// This routine performs an erase of the page in which <addr> is contained.
// This routine assumes that no FLASH operations are currently in progress.
// This routine exits with no FLASH operations currently in progress.
// Returns TRUE if the operation was successful; FALSE otherwise (page protected).
//
int FLASH_PageErase (unsigned int addr)
{
   unsigned long testval;                       // holds result of FLASHDAT read
   bit done;                                    // TRUE/FALSE flag
   int retval;                                  // TRUE if operation successful

   JTAG_IWrite (FLASHSCL, 0x86L, FLSC_LEN);     // set FLASHSCL based on SYSCLK 
                                                // frequency (2MHz = 0x86)

   // set FLASHADR to address within page to erase
   JTAG_IWrite (FLASHADR, (unsigned long) addr, FLA_LEN);   

   JTAG_IWrite (FLASHCON, 0x20L, FLCN_LEN);     // set FLASHCON for FLASH Erase 
                                                // operation (0x20)

   JTAG_IWrite (FLASHDAT, 0xa5L, FLD_WRLEN);    // set FLASHDAT to 0xa5 to initiate 
                                                // erase procedure

   JTAG_IWrite (FLASHCON, 0x0L, FLCN_LEN);      // set FLASHCON for 'poll' operation

   do {
      done = !(JTAG_IRead (FLASHDAT, 1));       // poll for FLBusy to de-assert
   } while (!done);

   testval = JTAG_IRead (FLASHDAT, 2);          // read FLBusy and FLFail

   retval = (testval & 0x02) ? FALSE: TRUE;     // FLFail is next to LSB

   // set return value based on FLFail bit
   return retval;                               // return FLASH Pass/Fail
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av欧美精品.com| 久久久精品一品道一区| 国产精品一区二区三区四区| 视频一区中文字幕| 亚洲成人动漫av| 自拍偷拍亚洲欧美日韩| 久久久三级国产网站| 精品精品国产高清a毛片牛牛| 欧美日韩美少妇| 欧美日韩国产天堂| 91精品国产一区二区| 日韩欧美自拍偷拍| 日韩精品专区在线| 国产丝袜在线精品| 国产精品国产三级国产普通话99 | 色先锋久久av资源部| 99视频热这里只有精品免费| 色诱视频网站一区| 777亚洲妇女| 久久亚洲影视婷婷| 国产精品麻豆久久久| 夜夜嗨av一区二区三区| 三级亚洲高清视频| 国产乱淫av一区二区三区| 成人精品高清在线| 欧美偷拍一区二区| 精品国产伦一区二区三区观看体验| 国产肉丝袜一区二区| 国产精品美女视频| 亚洲在线免费播放| 国内精品国产成人| 99综合电影在线视频| 欧美日本视频在线| 精品国产伦一区二区三区观看方式 | 午夜精彩视频在线观看不卡| 蜜桃视频在线观看一区| 久久99国产精品麻豆| 中文字幕乱码日本亚洲一区二区| 亚洲精品国产高清久久伦理二区| 日韩高清不卡一区二区| 北条麻妃国产九九精品视频| 欧美自拍偷拍一区| 欧美精品一区二区三区一线天视频| 欧美韩日一区二区三区四区| 3d动漫精品啪啪一区二区竹菊| 国产亚洲一区字幕| 一二三区精品视频| 国产91丝袜在线观看| 91精品欧美综合在线观看最新| 日韩欧美高清一区| 一区二区三区成人| 国产成人8x视频一区二区| 欧美日韩视频在线观看一区二区三区| 国产日韩欧美综合一区| 日本91福利区| 在线观看日韩毛片| 国产精品传媒在线| 国产不卡在线一区| 日韩精品一区二区三区中文不卡 | 亚洲蜜臀av乱码久久精品| 另类综合日韩欧美亚洲| 欧美婷婷六月丁香综合色| 亚洲欧美一区二区在线观看| 国产又黄又大久久| 精品国产成人系列| 婷婷成人激情在线网| 一本大道久久a久久精二百| 国产人成一区二区三区影院| 美女国产一区二区三区| 婷婷开心激情综合| 欧美日韩色一区| 亚洲免费观看高清| 91丨porny丨首页| 国产精品国产三级国产aⅴ入口 | 久久精品欧美日韩| 蜜臀精品久久久久久蜜臀| 国产精品色婷婷久久58| 岛国av在线一区| 久久久久久久精| 美女网站在线免费欧美精品| 538prom精品视频线放| 日韩电影在线观看一区| 7878成人国产在线观看| 五月天激情小说综合| 欧美日韩精品一二三区| 日韩中文字幕不卡| 欧美一级艳片视频免费观看| 日韩影视精彩在线| 欧美成人aa大片| 美日韩一级片在线观看| 欧美成人精精品一区二区频| 国产麻豆91精品| 国产精品护士白丝一区av| 91麻豆精东视频| 亚洲国产人成综合网站| 8x8x8国产精品| 国产成人免费xxxxxxxx| 亚洲桃色在线一区| 欧美顶级少妇做爰| 狠狠色丁香久久婷婷综合丁香| 欧美激情一区二区三区在线| 91蜜桃免费观看视频| 秋霞影院一区二区| 国产偷国产偷亚洲高清人白洁| 91啪在线观看| 天天色天天操综合| 精品福利二区三区| 成人黄色软件下载| 一区二区三区不卡视频| 精品国产91乱码一区二区三区| 99久久精品免费看国产| 午夜影院在线观看欧美| 久久美女艺术照精彩视频福利播放| 国精产品一区一区三区mba视频| 欧美激情在线一区二区三区| 91黄色小视频| 国产精品自拍一区| 亚洲乱码中文字幕综合| 欧美成人一区二区三区片免费| 色综合亚洲欧洲| 久久99精品国产麻豆婷婷洗澡| 国产精品白丝在线| 精品久久五月天| 欧美伊人久久大香线蕉综合69 | 99久久久精品免费观看国产蜜| 一区二区三区在线免费播放| 精品国产乱码久久久久久久| 在线看国产日韩| 粉嫩绯色av一区二区在线观看| 午夜精品aaa| 一区二区三区中文在线| 国产精品日日摸夜夜摸av| 91精品福利在线一区二区三区| 一本到三区不卡视频| 国产成人亚洲精品青草天美 | 韩国av一区二区三区四区| 亚洲高清免费一级二级三级| 国产精品电影一区二区三区| 精品国产髙清在线看国产毛片| 欧美精品九九99久久| 99精品视频在线免费观看| 国产一区二三区| 精品无人码麻豆乱码1区2区| 午夜a成v人精品| 偷拍与自拍一区| 5月丁香婷婷综合| 欧洲色大大久久| 91美女片黄在线| 91美女蜜桃在线| 在线精品视频一区二区| 色综合久久九月婷婷色综合| 99视频国产精品| 91小视频在线免费看| av不卡一区二区三区| 成人av网站在线| 不卡大黄网站免费看| 波多野结衣中文一区| av在线不卡电影| 91同城在线观看| 欧美性videosxxxxx| 欧美日韩一区视频| 日韩一区二区三区在线观看 | 国产经典欧美精品| 国产中文字幕一区| 国产一区久久久| av午夜一区麻豆| 精品视频1区2区3区| 精品视频1区2区| 欧美日韩国产a| 欧美一区二区在线免费观看| 成人毛片老司机大片| 麻豆国产精品视频| 国产中文字幕一区| 成人一区二区视频| 91啪亚洲精品| 欧美一级理论片| 国产日韩精品久久久| 国产精品二区一区二区aⅴ污介绍| 亚洲欧美另类久久久精品| 亚洲国产一区二区三区| 亚洲成人激情自拍| 久久国产精品99久久人人澡| 国产美女精品人人做人人爽| 热久久免费视频| 成人激情开心网| 欧美日韩一级大片网址| 精品国产91乱码一区二区三区| 亚洲精品中文在线影院| 久久草av在线| av在线不卡免费看| 日韩欧美亚洲国产精品字幕久久久| 国产亚洲一本大道中文在线| 亚洲乱码精品一二三四区日韩在线| 亚洲va欧美va人人爽| 国产iv一区二区三区| 91精品国产全国免费观看 | 国产电影一区在线| 色综合激情五月| 国产亚洲午夜高清国产拍精品| 午夜精品久久久久影视|