}
-// NOTE: important: THIS MODULE REVOLVES AROUND RETURNING TO RUNTEST/IDLE, OR THE FUNCTIONAL EQUIVALENT
-
-/*
-//! Shift N bits over TDI/TDO. May choose LSB or MSB, and select whether to terminate (TMS-high on last bit) and whether to return to RUNTEST/IDLE
-unsigned long jtagarmtransn(unsigned long word, unsigned char bitcount, unsigned char lsb, unsigned char end, unsigned char retidle){ // PROVEN
- unsigned char bit;
- unsigned long high = 1L;
- unsigned long mask;
-
- //for (bit=(bitcount-1)/8; bit>0; bit--)
- // high <<= 8;
- //high <<= ((bitcount-1)%8);
- high <<= (bitcount-1);
-
- mask = high-1;
-
- SAVETCLK;
- if (lsb) {
- for (bit = bitcount; bit > 0; bit--) {
- /* write MOSI on trailing edge of previous clock *
- if (word & 1)
- {SETMOSI;}
- else
- {CLRMOSI;}
- word >>= 1;
-
- if (bit==1 && end)
- SETTMS;//TMS high on last bit to exit.
-
- jtag_arm_tcktock();
-
- //* read MISO on trailing edge *
- if (READMISO){
- word += (high);
- }
- }
- } else {
- for (bit = bitcount; bit > 0; bit--) {
- //* write MOSI on trailing edge of previous clock *
- if (word & high)
- {SETMOSI;}
- else
- {CLRMOSI;}
- word = (word & mask) << 1;
-
- if (bit==1 && end)
- SETTMS;//TMS high on last bit to exit.
-
- jtag_arm_tcktock();
-
- //* read MISO on trailing edge *
- word |= (READMISO);
- }
- }
-
-
- RESTORETCLK;
- //SETMOSI;
-
- if (end){
- // exit state
- jtag_arm_tcktock();
- // update state
- if (retidle){
- CLRTMS;
- jtag_arm_tcktock();
- }
- }
- return word;
-}
-*/
-
/************************************************************************
* ARM7TDMI core has 6 primary registers to be connected between TDI/TDO