Go to the source code of this file.
Defines | |
| #define | TDI_PIN 27 |
| #define | TCK_PIN 30 |
| #define | TMS_PIN 29 |
| #define | TDO_PIN 28 |
| #define | TRST_PIN 21 |
| #define | TSEL0_PIN 19 |
| #define | TSEL1_PIN 20 |
| #define | TDI (1 << TDI_PIN) |
| #define | TCK (1 << TCK_PIN) |
| #define | TMS (1 << TMS_PIN) |
| #define | TDO (1 << TDO_PIN) |
| #define | TRST (1 << TRST_PIN) |
| #define | TSEL0 (1 << TSEL0_PIN) |
| #define | TSEL1 (1 << TSEL1_PIN) |
| #define | INSTR_EXTEST 0x00 |
| #define | INSTR_IDCODE 0x01 |
| #define | INSTR_SAMPLE 0x02 |
| #define | INSTR_IMPCODE 0x03 |
| #define | INSTR_ADDRESS 0x08 |
| #define | INSTR_DATA 0x09 |
| #define | INSTR_CONTROL 0x0A |
| #define | INSTR_BYPASS 0xFF |
Typedefs | |
| typedef unsigned char | SCAN_DATA_TYPE |
Enumerations | |
| enum | SHIFT_REGISTER_TYPE { INSTRUCTION_REGISTER = 0, DATA_REGISTER, MAX_SHIFT_REGISTER } |
| enum | JTAG_STATE_TYPE { TEST_LOGIC_RESET = 0, RUN_TEST_IDLE, PAUSE_DR, PAUSE_IR, SHIFT_DR, SHIFT_IR, UNDEFINED_JTAG_STATE, MAX_JTAG_STATE } |
Functions | |
| void | JTAG_Initialize (void) |
| JTAG_Initialize -Initializes the IO for the JTAG out functionality. | |
| void | JTAG_ResetJSM (int Select, Bool Reset, JTAG_STATE_TYPE state_e) |
| JTAG_ResetJSM - Brings the JTAG interface to a known state. | |
| void | JTAG_ScanIO (int Select, SHIFT_REGISTER_TYPE jtag_register_e, int length_in_bits, SCAN_DATA_TYPE *out_data, SCAN_DATA_TYPE *in_data, JTAG_STATE_TYPE state_e) |
| JTAG_ScanIO - Move the JTAG State Machine (JSM) controller to the shift state specified by register (instruction_register or data_register), clock test data pointed to by out_data out (to target's TDI pin), read data clocked in (from target's TDO pin) and store in location pointed to by in_data, and move the JSM to the state specifyed by state. | |
| unsigned char | ClockJTAG (int Select, unsigned int, unsigned int) |
| ClockJTAG - Clock out TDI data and clock in TDO data and return it. | |
| void | ScanDataInOut (int Select, unsigned char *, unsigned int, unsigned char *) |
| ScanDataInOut - Routine for shifting data in and out of shitf DR or shift IR JTAG states. | |
| void | PulseClock (int Select) |
| PulseClock - toggles the JTAG clock ONLY! | |
***************************************************************************
---------------------------------------------------------------------------
| #define INSTR_ADDRESS 0x08 |
| #define INSTR_BYPASS 0xFF |
| #define INSTR_CONTROL 0x0A |
| #define INSTR_DATA 0x09 |
| #define INSTR_EXTEST 0x00 |
| #define INSTR_IDCODE 0x01 |
| #define INSTR_IMPCODE 0x03 |
| #define INSTR_SAMPLE 0x02 |
| #define TCK (1 << TCK_PIN) |
| #define TCK_PIN 30 |
| #define TDI (1 << TDI_PIN) |
| #define TDI_PIN 27 |
| #define TDO (1 << TDO_PIN) |
| #define TDO_PIN 28 |
| #define TMS (1 << TMS_PIN) |
| #define TMS_PIN 29 |
| #define TRST (1 << TRST_PIN) |
| #define TRST_PIN 21 |
| #define TSEL0 (1 << TSEL0_PIN) |
| #define TSEL0_PIN 19 |
| #define TSEL1 (1 << TSEL1_PIN) |
| #define TSEL1_PIN 20 |
| typedef unsigned char SCAN_DATA_TYPE |
| enum JTAG_STATE_TYPE |
| enum SHIFT_REGISTER_TYPE |
| unsigned char ClockJTAG | ( | int | Select, | |
| unsigned int | tms, | |||
| unsigned int | tdi | |||
| ) |
ClockJTAG - Clock out TDI data and clock in TDO data and return it.
***************************************************************************
| Select | JTAG Bus | |
| tms | (Test Mode Select) | |
| tdi | (Test Data In) bits |
| void JTAG_Initialize | ( | void | ) |
JTAG_Initialize -Initializes the IO for the JTAG out functionality.
**************************************************************************
| void JTAG_ResetJSM | ( | int | Select, | |
| Bool | Reset, | |||
| JTAG_STATE_TYPE | state_e | |||
| ) |
JTAG_ResetJSM - Brings the JTAG interface to a known state.
***************************************************************************
| Select | JTAG Bus Number | |
| Reset | [Boolean] if True toggle the TRST pin, | |
| state_e | [JTAG_STATE_TYPE] - new jtag state upon exit state_e = state to leave in |
| void JTAG_ScanIO | ( | int | Select, | |
| SHIFT_REGISTER_TYPE | jtag_register_e, | |||
| int | length_in_bits, | |||
| SCAN_DATA_TYPE * | in_data, | |||
| SCAN_DATA_TYPE * | out_data, | |||
| JTAG_STATE_TYPE | state_e | |||
| ) |
JTAG_ScanIO - Move the JTAG State Machine (JSM) controller to the shift state specified by register (instruction_register or data_register), clock test data pointed to by out_data out (to target's TDI pin), read data clocked in (from target's TDO pin) and store in location pointed to by in_data, and move the JSM to the state specifyed by state.
**************************************************************************
| Select | JTAG Bus Number | |
| jtag_register_e | [SHIFT_REGISTER_TYPE] - target register | |
| length_in_bits | [1 - ...] - number of bits in scan chain contained in in_data and/or out_data | |
| in_data | - pointer to array of bytes containing the scan chain to be output via jtag OR NULL if no data to be scanned out | |
| out_data | - pointer to an array of bytes which will contain the scan chain to be input via jtag OR NULL of no data to be scanned in | |
| state_e | [JTAG_STATE_TYPE] - new jtag state upon exit |
| void PulseClock | ( | int | Select | ) |
PulseClock - toggles the JTAG clock ONLY!
***************************************************************************
| Select | JTAG Bus Number |
| void ScanDataInOut | ( | int | Select, | |
| unsigned char * | in_data, | |||
| unsigned int | in_length, | |||
| unsigned char * | out_data | |||
| ) |
ScanDataInOut - Routine for shifting data in and out of shitf DR or shift IR JTAG states.
***************************************************************************
| Select | JTAG Bus Number | |
| in_data | pointer to data to be shifted into the shift DR or shift IR JTAG register. | |
| in_length | = number of bits to shift | |
| out_data | = pointer to outgoing buffer |
1.5.8