JTAG TAP controller. More...
Data Structures | |
struct | TEST_MODE_PATH |
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 | 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. |
JTAG TAP controller.
* $Id$ *
JTAG_TAP* TapOpen | ( | JTAG_CABLE * | cable | ) |
Open a TAP controller instance and assiociate it with a given cable driver.
Cable | driver structure. |
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.
tap | Pointer 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.
Toggles the target reset line.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
us | Time to keep the reset activated, given in microseconds. |
References JTAG_CABLE::cable_reset_target, JTAG_UNKNOWN_STATE, NutMicroDelay(), JTAG_TAP::tap_cable, JTAG_TAP::tap_cib, and JTAG_TAP::tap_state.
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. |
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.
tap | Pointer to the TAP controller structure, obtained by a previous call to JtagCable0Open(). |
len | Number of bits in the instruction register. |
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.
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. |
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. |
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().