- // Turn field on to read the response
- // 137*8 seems to get to the start of data pretty well...
- // but we want to go past the start and let the repeating data settle in...
- TurnReadLFOn(210*8);
-
- // Acquisition
- // Now do the acquisition
- DoPartialAcquisition(0, true, 12000, 0);
-
- // Turn the field off
- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); // field off
-// cmd_send(CMD_ACK,0,0,0,0,0);
- LED_A_OFF();
-}
-
-void T55xxReadBlockExt_Leading0 (uint16_t arg0, uint8_t Block, uint32_t Pwd) {
- LED_A_ON();
- bool PwdMode = arg0 & 0x1;
- uint8_t Page = (arg0 & 0x2) >> 1;
- uint32_t i = 0;
- bool RegReadMode = (Block == 0xFF);//regular read mode
-
- //clear buffer now so it does not interfere with timing later
- BigBuf_Clear_ext(false);
-
- //make sure block is at max 7
- Block &= 0x7;
-
- // Set up FPGA, 125kHz to power up the tag
- LFSetupFPGAForADC(95, true);
- StartTicks();
- // make sure tag is fully powered up...
- WaitMS(5);
- // Trigger T55x7 Direct Access Mode with start gap
- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
- WaitUS(START_GAPlz);
-
- T55xxWriteBit_Leading0 (0);
-
- // Opcode 1[page]
- T55xxWriteBit_Leading0 (1);
- T55xxWriteBit_Leading0 (Page); //Page 0
-
- if (PwdMode){
- // Send Pwd
- T55xxWriteBit_Leading0 (0);
- T55xxWriteBit_Leading0 (0);
-
- for (i = 0x80000000; i != 0; i >>= 1)
- T55xxWriteBit_Leading0 (Pwd & i);
- }
- // Send a zero bit separation
- T55xxWriteBit_Leading0(0);
-
- // Send Block number (if direct access mode)
- if (!RegReadMode)
- for (i = 0x04; i != 0; i >>= 1)
- T55xxWriteBit_Leading0(Block & i);