Nut/OS  4.10.3
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$
 * 

Definition in file jtag_tap.h.


Define Documentation

#define JTAG_TEST_LOGIC_RESET   0

Definition at line 47 of file jtag_tap.h.

Referenced by TapStateWalk().

#define JTAG_RUN_TEST_IDLE   1

Definition at line 48 of file jtag_tap.h.

#define JTAG_SELECT_DR_SCAN   2

Definition at line 49 of file jtag_tap.h.

#define JTAG_CAPTURE_DR   3

Definition at line 50 of file jtag_tap.h.

#define JTAG_SHIFT_DR   4

Definition at line 51 of file jtag_tap.h.

Referenced by TapData().

#define JTAG_EXIT1_DR   5

Definition at line 52 of file jtag_tap.h.

#define JTAG_PAUSE_DR   6

Definition at line 53 of file jtag_tap.h.

#define JTAG_EXIT2_DR   7

Definition at line 54 of file jtag_tap.h.

#define JTAG_UPDATE_DR   8

Definition at line 55 of file jtag_tap.h.

#define JTAG_SELECT_IR_SCAN   9

Definition at line 56 of file jtag_tap.h.

#define JTAG_CAPTURE_IR   10

Definition at line 57 of file jtag_tap.h.

#define JTAG_SHIFT_IR   11

Definition at line 58 of file jtag_tap.h.

Referenced by TapInstruction().

#define JTAG_EXIT1_IR   12

Definition at line 59 of file jtag_tap.h.

#define JTAG_PAUSE_IR   13

Definition at line 60 of file jtag_tap.h.

#define JTAG_EXIT2_IR   14

Definition at line 61 of file jtag_tap.h.

#define JTAG_UPDATE_IR   15

Definition at line 62 of file jtag_tap.h.

#define JTAG_UNKNOWN_STATE   16

Definition at line 63 of file jtag_tap.h.

Referenced by TapOpen(), TapStateWalk(), and TapTargetReset().


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