Nut/OS  4.10.3
API Reference
jtag_tap.c File Reference

JTAG TAP controller. More...

#include <sys/timer.h>
#include <stdlib.h>
#include <dev/jtag_tap.h>
Include dependency graph for jtag_tap.c:

Go to the source code of this file.

Data Structures

struct  TEST_MODE_PATH

Functions

JTAG_TAPTapOpen (JTAG_CABLE *cable)
 Open a TAP controller instance and assiociate it with a given cable driver.
void TapClose (JTAG_TAP *tap)
 Release the TAP controller.
void TapTargetReset (JTAG_TAP *tap, uint32_t us)
 Toggles the target reset line.
void TapStateWalk (JTAG_TAP *tap, int state)
 Move the TAP controller to the specified state.
void TapSetIrSize (JTAG_TAP *tap, uint_fast8_t len)
 Set instruction register size.
void TapData (JTAG_TAP *tap, uint8_t *rbuf, CONST uint8_t *wbuf, uint32_t len, uint_fast8_t last)
 Read and write data register.
void TapInstruction (JTAG_TAP *tap, uint32_t code, uint_fast8_t last)
 Store instruction code in instruction register.

Detailed Description

JTAG TAP controller.

 * $Id$
 * 

Definition in file jtag_tap.c.


Function Documentation

JTAG_TAP* TapOpen ( JTAG_CABLE cable)

Open a TAP controller instance and assiociate it with a given cable driver.

Parameters:
Cabledriver structure.
Returns:
Pointer to a TAP controller structure, which must be passed to all other routines.

Definition at line 101 of file jtag_tap.c.

References JTAG_CABLE::cable_open, calloc, JTAG_UNKNOWN_STATE, JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, JTAG_TAP::tap_irsize, and JTAG_TAP::tap_state.

void TapClose ( JTAG_TAP tap)

Release the TAP controller.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().

Definition at line 122 of file jtag_tap.c.

References JTAG_CABLE::cable_close, free(), JTAG_TAP::tap_cable, and JTAG_TAP::tap_cib.

Here is the call graph for this function:

void TapTargetReset ( JTAG_TAP tap,
uint32_t  us 
)

Toggles the target reset line.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().
usTime to keep the reset activated, given in microseconds.

Definition at line 135 of file jtag_tap.c.

References JTAG_CABLE::cable_reset_target, JTAG_UNKNOWN_STATE, NutMicroDelay(), JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, and JTAG_TAP::tap_state.

Here is the call graph for this function:

void TapStateWalk ( JTAG_TAP tap,
int  state 
)

Move the TAP controller to the specified state.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().
stateRequested state.

Definition at line 152 of file jtag_tap.c.

References JTAG_CABLE::cable_tms_put, JTAG_TEST_LOGIC_RESET, JTAG_UNKNOWN_STATE, TEST_MODE_PATH::len, TEST_MODE_PATH::seq, JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, and JTAG_TAP::tap_state.

Referenced by TapData(), and TapInstruction().

void TapSetIrSize ( JTAG_TAP tap,
uint_fast8_t  len 
)

Set instruction register size.

Actually we can determine the size automatically. For now the user must set it by calling this function.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().
lenNumber of bits in the instruction register.

Definition at line 176 of file jtag_tap.c.

References JTAG_TAP::tap_irsize.

void TapData ( JTAG_TAP tap,
uint8_t rbuf,
CONST uint8_t wbuf,
uint32_t  len,
uint_fast8_t  last 
)

Read and write data register.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().
rbufPoints to the buffer that receives the read data. May be NULL if the caller is not interested.
wbufPoints to the buffer that contains the write data. If NULL, all outgoing bits are zero.
lenNumber of bits to read and/or write.
lastIndicates the last data transfer. If set, the TAP controller will move to the Exit1-DR state on the last clock cycle.

Definition at line 195 of file jtag_tap.c.

References JTAG_CABLE::cable_transfer_data, JTAG_SHIFT_DR, JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, JTAG_TAP::tap_state, and TapStateWalk().

Here is the call graph for this function:

void TapInstruction ( JTAG_TAP tap,
uint32_t  code,
uint_fast8_t  last 
)

Store instruction code in instruction register.

Parameters:
tapPointer to the TAP controller structure, obtained by a previous call to JtagCable0Open().
lastIndicates the last data transfer. If set, the TAP controller will move to the Exit1-IR state on the last clock cycle.

Definition at line 213 of file jtag_tap.c.

References JTAG_CABLE::cable_transfer_data, JTAG_SHIFT_IR, JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, JTAG_TAP::tap_irsize, JTAG_TAP::tap_state, and TapStateWalk().

Here is the call graph for this function: