JTAG TAP controller definitions and prototypes. More...
#include <dev/jtag_cable.h>
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_TAP * | TapOpen (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. |
#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().
JTAG_TAP* TapOpen | ( | JTAG_CABLE * | cable | ) |
Open a TAP controller instance and assiociate it with a given cable driver.
Cable | driver structure. |
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.
tap | Pointer 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.
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.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
len | Number 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.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
state | Requested 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.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
rbuf | Points to the buffer that receives the read data. May be NULL if the caller is not interested. |
wbuf | Points to the buffer that contains the write data. If NULL, all outgoing bits are zero. |
len | Number of bits to read and/or write. |
last | Indicates 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().
void TapInstruction | ( | JTAG_TAP * | tap, |
uint32_t | code, | ||
uint_fast8_t | last | ||
) |
Store instruction code in instruction register.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
last | Indicates 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().