libjaylink 0.3.1
Library to access J-Link devices
Loading...
Searching...
No Matches
Functions
jtag.c File Reference

JTAG functions. More...

#include <stdint.h>
#include <stdbool.h>
#include "libjaylink.h"
#include "libjaylink-internal.h"

Functions

int jaylink_jtag_io (struct jaylink_device_handle *devh, const uint8_t *tms, const uint8_t *tdi, uint8_t *tdo, uint16_t length, enum jaylink_jtag_version version)
 Perform a JTAG I/O operation.
 
int jaylink_jtag_clear_trst (struct jaylink_device_handle *devh)
 Clear the JTAG test reset (TRST) signal.
 
int jaylink_jtag_set_trst (struct jaylink_device_handle *devh)
 Set the JTAG test reset (TRST) signal.
 
int jaylink_jtag_clear_tms (struct jaylink_device_handle *devh)
 Clear the JTAG test mode select (TMS) signal.
 
int jaylink_jtag_set_tms (struct jaylink_device_handle *devh)
 Set the JTAG test mode select (TMS) signal.
 
int jaylink_jtag_clear_tck (struct jaylink_device_handle *devh)
 Clear the JTAG test clock (TCK) signal.
 
int jaylink_jtag_set_tck (struct jaylink_device_handle *devh)
 Set the JTAG test clock (TCK) signal.
 

Detailed Description

JTAG functions.

Function Documentation

◆ jaylink_jtag_clear_tck()

int jaylink_jtag_clear_tck ( struct jaylink_device_handle * devh)

Clear the JTAG test clock (TCK) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_jtag_clear_tms()

int jaylink_jtag_clear_tms ( struct jaylink_device_handle * devh)

Clear the JTAG test mode select (TMS) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_jtag_clear_trst()

int jaylink_jtag_clear_trst ( struct jaylink_device_handle * devh)

Clear the JTAG test reset (TRST) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.1.0

◆ jaylink_jtag_io()

int jaylink_jtag_io ( struct jaylink_device_handle * devh,
const uint8_t * tms,
const uint8_t * tdi,
uint8_t * tdo,
uint16_t length,
enum jaylink_jtag_version version )

Perform a JTAG I/O operation.

Note
This function must only be used if the JAYLINK_TIF_JTAG interface is available and selected. Nevertheless, this function can be used if the device doesn't have the JAYLINK_DEV_CAP_SELECT_TIF capability.
Parameters
[in,out]devhDevice handle.
[in]tmsBuffer to read TMS data from.
[in]tdiBuffer to read TDI data from.
[out]tdoBuffer to store TDO data on success. Its content is undefined on failure. The buffer must be large enough to contain at least the specified number of bits to transfer.
[in]lengthNumber of bits to transfer.
[in]versionVersion of the JTAG command to use.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEV_NO_MEMORYNot enough memory on the device to perform the operation.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
See also
jaylink_select_interface()
jaylink_set_speed()
Since
0.1.0

◆ jaylink_jtag_set_tck()

int jaylink_jtag_set_tck ( struct jaylink_device_handle * devh)

Set the JTAG test clock (TCK) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_jtag_set_tms()

int jaylink_jtag_set_tms ( struct jaylink_device_handle * devh)

Set the JTAG test mode select (TMS) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_jtag_set_trst()

int jaylink_jtag_set_trst ( struct jaylink_device_handle * devh)

Set the JTAG test reset (TRST) signal.

Parameters
[in,out]devhDevice handle.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERROther error conditions.
Since
0.1.0