C:/Source/PCW/Sample Code/JTAG-Out.c File Reference

JTAG driver for Atmel ARM AT91SAM7x. More...

#include "Board.h"
#include "compiler.h"
#include "FreeRTOS.h"
#include "task.h"
#include "UTILS/tracedump.h"
#include "JTAG-Out.h"

Data Structures

struct  JTAG_GLOBALS_T

Typedefs

typedef struct JTAG_GLOBALS_T JTAG_GLOBAL
typedef struct JTAG_GLOBALS_TPJTAG_GLOBAL

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 *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.
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.
unsigned char ClockJTAG (int Select, unsigned int tms, unsigned int tdi)
 ClockJTAG - Clock out TDI data and clock in TDO data and return it.
void PulseClock (int Select)
 PulseClock - toggles the JTAG clock ONLY!

Variables

JTAG_GLOBAL JGbl


Detailed Description

JTAG driver for Atmel ARM AT91SAM7x.

***************************************************************************

Author:
Pro Code Works, LLC. - http://www.ProCodeWorks.com
Date:
June 2007
---------------------------------------------------------------------------- "THE BEER-WARE LICENSE" (Revision 42): nelson@ProCodeWorks.com wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Nelson Yaple ----------------------------------------------------------------------------

---------------------------------------------------------------------------


Typedef Documentation

typedef struct JTAG_GLOBALS_T JTAG_GLOBAL

typedef struct JTAG_GLOBALS_T * PJTAG_GLOBAL


Function Documentation

unsigned char ClockJTAG ( int  Select,
unsigned int  tms,
unsigned int  tdi 
)

ClockJTAG - Clock out TDI data and clock in TDO data and return it.

***************************************************************************

Parameters:
Select JTAG Bus
tms (Test Mode Select)
tdi (Test Data In) bits
Returns:
one bit of JTAG data

void JTAG_Initialize ( void   ) 

JTAG_Initialize -Initializes the IO for the JTAG out functionality.

**************************************************************************

Returns:
Nothing

void JTAG_ResetJSM ( int  Select,
Bool  Reset,
JTAG_STATE_TYPE  state_e 
)

JTAG_ResetJSM - Brings the JTAG interface to a known state.

***************************************************************************

Parameters:
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
Returns:
Nothing

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.

**************************************************************************

Parameters:
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
Returns:
Nothing

void PulseClock ( int  Select  ) 

PulseClock - toggles the JTAG clock ONLY!

***************************************************************************

Parameters:
Select JTAG Bus Number
Returns:
Nothing

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.

***************************************************************************

Parameters:
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
Returns:
nothing. (JTAG State machine is at exit DR/IR)


Variable Documentation


Generated on Sun Feb 15 20:19:28 2009 for JTAG by  doxygen 1.5.8