44 uint8_t scan_size_bytes, bits_last_byte;
45 uint8_t tms_count_start, tms_count_end;
46 uint8_t tms_sequence_start, tms_sequence_end;
47 uint8_t tdo_data, i, j;
52 scan_size_bytes = OUT2BUF[out_offset];
53 bits_last_byte = OUT2BUF[out_offset + 1];
54 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
55 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
56 tms_sequence_start = OUT2BUF[out_offset + 3];
57 tms_sequence_end = OUT2BUF[out_offset + 4];
59 if (tms_count_start > 0)
65 for (i = 0; i < scan_size_bytes - 1; i++) {
68 for (j = 0; j < 8; j++) {
70 tdo_data = tdo_data >> 1;
78 IN2BUF[i + in_offset] = tdo_data;
84 for (j = 0; j < bits_last_byte; j++) {
86 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
89 tms_sequence_end = tms_sequence_end >> 1;
93 tdo_data = tdo_data >> 1;
99 tdo_data = tdo_data >> (8 - bits_last_byte);
102 IN2BUF[i + in_offset] = tdo_data;
105 if (tms_count_end > 0)
122 uint8_t scan_size_bytes, bits_last_byte;
123 uint8_t tms_count_start, tms_count_end;
124 uint8_t tms_sequence_start, tms_sequence_end;
125 uint8_t tdo_data, i, j, k;
130 scan_size_bytes = OUT2BUF[out_offset];
131 bits_last_byte = OUT2BUF[out_offset + 1];
132 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
133 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
134 tms_sequence_start = OUT2BUF[out_offset + 3];
135 tms_sequence_end = OUT2BUF[out_offset + 4];
137 if (tms_count_start > 0)
143 for (i = 0; i < scan_size_bytes - 1; i++) {
146 for (j = 0; j < 8; j++) {
150 tdo_data = tdo_data >> 1;
152 OUTB = (outb_buffer |
PIN_TCK);
161 IN2BUF[i + in_offset] = tdo_data;
167 for (j = 0; j < bits_last_byte; j++) {
169 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
172 tms_sequence_end = tms_sequence_end >> 1;
178 tdo_data = tdo_data >> 1;
180 OUTB = (outb_buffer |
PIN_TCK);
187 tdo_data = tdo_data >> (8 - bits_last_byte);
190 IN2BUF[i + in_offset] = tdo_data;
193 if (tms_count_end > 0)
210 uint8_t scan_size_bytes, bits_last_byte;
211 uint8_t tms_count_start, tms_count_end;
212 uint8_t tms_sequence_start, tms_sequence_end;
213 uint8_t tdi_data, i, j;
218 scan_size_bytes = OUT2BUF[out_offset];
219 bits_last_byte = OUT2BUF[out_offset + 1];
220 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
221 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
222 tms_sequence_start = OUT2BUF[out_offset + 3];
223 tms_sequence_end = OUT2BUF[out_offset + 4];
225 if (tms_count_start > 0)
231 for (i = 0; i < scan_size_bytes - 1; i++) {
232 tdi_data = OUT2BUF[i + out_offset + 5];
234 for (j = 0; j < 8; j++) {
241 tdi_data = tdi_data >> 1;
242 OUTB = (outb_buffer |
PIN_TCK);
246 tdi_data = OUT2BUF[i + out_offset + 5];
249 for (j = 0; j < bits_last_byte; j++) {
256 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
259 tms_sequence_end = tms_sequence_end >> 1;
263 tdi_data = tdi_data >> 1;
264 OUTB = (outb_buffer |
PIN_TCK);
268 if (tms_count_end > 0)
285 uint8_t scan_size_bytes, bits_last_byte;
286 uint8_t tms_count_start, tms_count_end;
287 uint8_t tms_sequence_start, tms_sequence_end;
288 uint8_t tdi_data, i, j, k;
293 scan_size_bytes = OUT2BUF[out_offset];
294 bits_last_byte = OUT2BUF[out_offset + 1];
295 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
296 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
297 tms_sequence_start = OUT2BUF[out_offset + 3];
298 tms_sequence_end = OUT2BUF[out_offset + 4];
300 if (tms_count_start > 0)
306 for (i = 0; i < scan_size_bytes - 1; i++) {
307 tdi_data = OUT2BUF[i + out_offset + 5];
309 for (j = 0; j < 8; j++) {
318 tdi_data = tdi_data >> 1;
320 OUTB = (outb_buffer |
PIN_TCK);
326 tdi_data = OUT2BUF[i + out_offset + 5];
329 for (j = 0; j < bits_last_byte; j++) {
336 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
339 tms_sequence_end = tms_sequence_end >> 1;
345 tdi_data = tdi_data >> 1;
347 OUTB = (outb_buffer |
PIN_TCK);
353 if (tms_count_end > 0)
371 uint8_t scan_size_bytes, bits_last_byte;
372 uint8_t tms_count_start, tms_count_end;
373 uint8_t tms_sequence_start, tms_sequence_end;
374 uint8_t tdi_data, tdo_data, i, j;
379 scan_size_bytes = OUT2BUF[out_offset];
380 bits_last_byte = OUT2BUF[out_offset + 1];
381 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
382 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
383 tms_sequence_start = OUT2BUF[out_offset + 3];
384 tms_sequence_end = OUT2BUF[out_offset + 4];
386 if (tms_count_start > 0)
392 for (i = 0; i < scan_size_bytes - 1; i++) {
393 tdi_data = OUT2BUF[i + out_offset + 5];
396 for (j = 0; j < 8; j++) {
403 tdi_data = tdi_data >> 1;
404 OUTB = (outb_buffer |
PIN_TCK);
405 tdo_data = tdo_data >> 1;
412 IN2BUF[i + in_offset] = tdo_data;
415 tdi_data = OUT2BUF[i + out_offset + 5];
419 for (j = 0; j < bits_last_byte; j++) {
426 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
429 tms_sequence_end = tms_sequence_end >> 1;
433 tdi_data = tdi_data >> 1;
434 OUTB = (outb_buffer |
PIN_TCK);
435 tdo_data = tdo_data >> 1;
440 tdo_data = tdo_data >> (8 - bits_last_byte);
443 IN2BUF[i + in_offset] = tdo_data;
446 if (tms_count_end > 0)
464 uint8_t scan_size_bytes, bits_last_byte;
465 uint8_t tms_count_start, tms_count_end;
466 uint8_t tms_sequence_start, tms_sequence_end;
467 uint8_t tdi_data, tdo_data, i, j, k;
472 scan_size_bytes = OUT2BUF[out_offset];
473 bits_last_byte = OUT2BUF[out_offset + 1];
474 tms_count_start = (OUT2BUF[out_offset + 2] >> 4) & 0x0F;
475 tms_count_end = OUT2BUF[out_offset + 2] & 0x0F;
476 tms_sequence_start = OUT2BUF[out_offset + 3];
477 tms_sequence_end = OUT2BUF[out_offset + 4];
479 if (tms_count_start > 0)
485 for (i = 0; i < scan_size_bytes - 1; i++) {
486 tdi_data = OUT2BUF[i + out_offset + 5];
489 for (j = 0; j < 8; j++) {
498 tdi_data = tdi_data >> 1;
500 OUTB = (outb_buffer |
PIN_TCK);
503 tdo_data = tdo_data >> 1;
510 IN2BUF[i + in_offset] = tdo_data;
513 tdi_data = OUT2BUF[i + out_offset + 5];
517 for (j = 0; j < bits_last_byte; j++) {
524 if ((j == bits_last_byte - 1) && (tms_count_end > 0)) {
527 tms_sequence_end = tms_sequence_end >> 1;
533 tdi_data = tdi_data >> 1;
535 OUTB = (outb_buffer |
PIN_TCK);
538 tdo_data = tdo_data >> 1;
543 tdo_data = tdo_data >> (8 - bits_last_byte);
546 IN2BUF[i + in_offset] = tdo_data;
549 if (tms_count_end > 0)
563 uint8_t outb_buffer = OUTB & ~(
PIN_TCK);
565 for (i = 0; i <
count; i++) {
582 uint8_t outb_buffer = OUTB & ~(
PIN_TCK);
584 for (i = 0; i <
count; i++) {
605 uint8_t outb_buffer = OUTB & ~(
PIN_TCK);
608 for (i = 0; i <
count; i++) {
632 uint8_t outb_buffer = OUTB & ~(
PIN_TCK);
635 for (i = 0; i <
count; i++) {
661 uint8_t input_signal_state, output_signal_state;
663 input_signal_state = 0;
664 output_signal_state = 0;
682 return ((uint16_t)input_signal_state << 8) | ((uint16_t)output_signal_state);
707 uint8_t scan_io, uint8_t tck, uint8_t tms)
#define MASK_PORTB_DIRECTION_OUT
uint8_t delay_scan_in
Delay value for SCAN_IN operations with less than maximum TCK frequency.
uint16_t jtag_get_signals(void)
Get current JTAG signal states.
void jtag_scan_out(uint8_t out_offset)
Perform JTAG SCAN-OUT operation at maximum TCK frequency.
void jtag_slow_scan_io(uint8_t out_offset, uint8_t in_offset)
Perform bidirectional JTAG SCAN operation at maximum TCK frequency.
void jtag_slow_scan_in(uint8_t out_offset, uint8_t in_offset)
Perform JTAG SCAN-IN operation at variable TCK frequency.
uint8_t delay_scan_out
Delay value for SCAN_OUT operations with less than maximum TCK frequency.
void jtag_scan_io(uint8_t out_offset, uint8_t in_offset)
Perform bidirectional JTAG SCAN operation at maximum TCK frequency.
uint8_t delay_tck
Delay value for CLOCK_TCK operations with less than maximum frequency.
void jtag_clock_tck(uint16_t count)
Generate TCK clock cycles.
uint8_t delay_scan_io
Delay value for SCAN_IO operations with less than maximum TCK frequency.
void jtag_slow_scan_out(uint8_t out_offset)
Perform JTAG SCAN-OUT operation at maximum TCK frequency.
void jtag_scan_in(uint8_t out_offset, uint8_t in_offset)
Perform JTAG SCAN-IN operation at maximum TCK frequency.
void jtag_slow_clock_tms(uint8_t count, uint8_t sequence)
Perform TAP-FSM state transitions at less than maximum TCK frequency.
void jtag_configure_tck_delay(uint8_t scan_in, uint8_t scan_out, uint8_t scan_io, uint8_t tck, uint8_t tms)
Configure TCK delay parameters.
void jtag_set_signals(uint8_t low, uint8_t high)
Set state of JTAG output signals.
void jtag_slow_clock_tck(uint16_t count)
Generate TCK clock cycles at variable frequency.
uint8_t delay_tms
Delay value for CLOCK_TMS operations with less than maximum frequency.
void jtag_clock_tms(uint8_t count, uint8_t sequence)
Perform TAP FSM state transitions at maximum TCK frequency.
Definition of the commands supported by the OpenULINK firmware.
static struct ublast_lowlevel low