src/lib/jtag.c
u_long shift_33msbs(int breakpt, u_long bits)
{
    u_long mask;
    int nbits;
    
    PIO_SODR = MASK(TMS_BIT);  PULSE;           // to select-dr-scan state
    PIO_CODR = MASK(TMS_BIT);  PULSE;  PULSE;   // to shift-dr state

    (void)lsbit(breakpt);

    for (nbits=32; nbits; nbits--) {
        if (nbits == 1) {                 // to exit1-dr state
            PIO_SODR = MASK(TMS_BIT);
        }
        bits = msbit(bits);
    }
    PULSE;                               // to update-dr state
    PIO_CODR = MASK(TMS_BIT);  PULSE;    // to run-test/idle state
    return bits;
}
// Advance the JTAG state machine to the Shift-DR state.
// Shift the LSB of breakpt into the JTAG scan chain, discarding the output.
// Shift 32 bits, MSB first, of bits into the JTAG scan chain, capturing the
// output.  On the last of those bits, set TMS, and then pulse the clock
// again, thus leaving the JTAG state machine in the Update-DR state.
Advance the JTAG state machine to the Shift-DR state.
Shift the LSB of breakpt into the JTAG scan chain, discarding the output.
Shift 32 bits, MSB first, of bits into the JTAG scan chain, capturing the
output.  On the last of those bits, set TMS, and then pulse the clock
again, thus leaving the JTAG state machine in the Update-DR state.
Advance the JTAG state machine to the Shift - DR state . Shift the LSB of breakpt into the JTAG scan chain discarding the output . Shift 32 bits MSB first of bits into the JTAG scan chain capturing the output . On the last of those bits set TMS and then pulse the clock again thus leaving the JTAG state machine in the Update - DR state .
u_long shift_33msbs(int breakpt, u_long bits)
{
    u_long mask;
    int nbits;
    PIO_SODR = MASK(TMS_BIT);  PULSE;           
    PIO_CODR = MASK(TMS_BIT);  PULSE;  PULSE;   
    (void)lsbit(breakpt);
    for (nbits=32; nbits; nbits--) {
        if (nbits == 1) {                 
            PIO_SODR = MASK(TMS_BIT);
        }
        bits = msbit(bits);
    }
    PULSE;                               
    PIO_CODR = MASK(TMS_BIT);  PULSE;    
    return bits;
}
u_long shift_33msbs ( int breakpt , u_long bits ) { u_long mask ; int nbits ; PIO_SODR = MASK ( TMS_BIT ) ; PULSE ; PIO_CODR = MASK ( TMS_BIT ) ; PULSE ; PULSE ; ( void ) lsbit ( breakpt ) ; for ( nbits = 32 ; nbits ; nbits -- ) { if ( nbits == 1 ) { PIO_SODR = MASK ( TMS_BIT ) ; } bits = msbit ( bits ) ; } PULSE ; PIO_CODR = MASK ( TMS_BIT ) ; PULSE ; return bits ; }
Advance the JTAG state machine to the Shift-DR state.
Advance the JTAG state machine to the Shift - DR state .
// to select-dr-scan state // to shift-dr state // to exit1-dr state // to update-dr state // to run-test/idle state