Nut/OS  5.0.5
API Reference
jtag_tap.h File Reference

JTAG TAP controller definitions and prototypes. More...

#include <dev/jtag_cable.h>
Include dependency graph for jtag_tap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  JTAG_TAP

Defines

#define JTAG_TEST_LOGIC_RESET   0
#define JTAG_RUN_TEST_IDLE   1
#define JTAG_SELECT_DR_SCAN   2
#define JTAG_CAPTURE_DR   3
#define JTAG_SHIFT_DR   4
#define JTAG_EXIT1_DR   5
#define JTAG_PAUSE_DR   6
#define JTAG_EXIT2_DR   7
#define JTAG_UPDATE_DR   8
#define JTAG_SELECT_IR_SCAN   9
#define JTAG_CAPTURE_IR   10
#define JTAG_SHIFT_IR   11
#define JTAG_EXIT1_IR   12
#define JTAG_PAUSE_IR   13
#define JTAG_EXIT2_IR   14
#define JTAG_UPDATE_IR   15
#define JTAG_UNKNOWN_STATE   16

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 TapSetIrSize (JTAG_TAP *tap, uint_fast8_t len)
 Set instruction register size.
void TapStateWalk (JTAG_TAP *tap, int state)
 Move the TAP controller to the specified state.
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 definitions and prototypes.

 * $Id$
 * 

Define Documentation

#define JTAG_TEST_LOGIC_RESET   0

Referenced by TapStateWalk().

#define JTAG_RUN_TEST_IDLE   1
#define JTAG_SELECT_DR_SCAN   2
#define JTAG_CAPTURE_DR   3
#define JTAG_SHIFT_DR   4

Referenced by TapData().

#define JTAG_EXIT1_DR   5
#define JTAG_PAUSE_DR   6
#define JTAG_EXIT2_DR   7
#define JTAG_UPDATE_DR   8
#define JTAG_SELECT_IR_SCAN   9
#define JTAG_CAPTURE_IR   10
#define JTAG_SHIFT_IR   11

Referenced by TapInstruction().

#define JTAG_EXIT1_IR   12
#define JTAG_PAUSE_IR   13
#define JTAG_EXIT2_IR   14
#define JTAG_UPDATE_IR   15
#define JTAG_UNKNOWN_STATE   16

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.

References JTAG_CABLE::cable_open, calloc, JTAG_UNKNOWN_STATE, NULL, 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().

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

Here is the call graph for this function:

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.

References JTAG_TAP::tap_irsize.

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.

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 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.

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.

References JTAG_CABLE::cable_transfer_data, JTAG_SHIFT_IR, NULL, 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: