OpenOCD
|
Target related functions. More...
Go to the source code of this file.
Target related functions.
Definition in file jtag/drivers/libjaylink/libjaylink/target.c.
JAYLINK_API int jaylink_clear_reset | ( | struct jaylink_device_handle * | devh | ) |
Clear the target reset signal.
[in,out] | devh | Device handle. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 406 of file jtag/drivers/libjaylink/libjaylink/target.c.
References jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_start_write(), and transport_write().
Referenced by jlink_reset().
JAYLINK_API int jaylink_get_available_interfaces | ( | struct jaylink_device_handle * | devh, |
uint32_t * | ifaces | ||
) |
Retrieve the available target interfaces.
The target interfaces are stored in a 32-bit bit field where each individual bit represents a target interface. A set bit indicates an available target interface. See jaylink_target_interface for a description of the target interfaces and their bit positions.
[in,out] | devh | Device handle. |
[out] | ifaces | Target interfaces on success, and undefined on failure. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 283 of file jtag/drivers/libjaylink/libjaylink/target.c.
References buffer_get_u32(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_write_read(), and transport_write().
Referenced by select_interface().
JAYLINK_API int jaylink_get_selected_interface | ( | struct jaylink_device_handle * | devh, |
enum jaylink_target_interface * | iface | ||
) |
Retrieve the selected target interface.
iface
which is not covered by jaylink_target_interface.[in,out] | devh | Device handle. |
[out] | iface | Selected target interface on success, and undefined on failure. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 349 of file jtag/drivers/libjaylink/libjaylink/target.c.
References buffer_get_u32(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_write_read(), and transport_write().
JAYLINK_API int jaylink_get_speeds | ( | struct jaylink_device_handle * | devh, |
struct jaylink_speed * | speed | ||
) |
Retrieve target interface speeds.
The speeds are applicable for the currently selected target interface only and calculated as follows:
speeds = freq / n
with n >= div
, where n
is an integerAssuming, for example, a base frequency freq of 4 MHz and a minimum divider div of 4 then the highest possible target interface speed is 4 MHz / 4 = 1 MHz. The next highest speed is 800 kHz for a divider of 5, and so on.
[in,out] | devh | Device handle. |
[out] | speed | Speed information on success, and undefined on failure. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_PROTO | Protocol violation. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 128 of file jtag/drivers/libjaylink/libjaylink/target.c.
References buffer_get_u16(), buffer_get_u32(), jaylink_device::ctx, jaylink_device_handle::dev, jaylink_speed::div, jaylink_speed::freq, JAYLINK_ERR_ARG, JAYLINK_ERR_PROTO, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_write_read(), and transport_write().
Referenced by jlink_speed().
JAYLINK_API int jaylink_select_interface | ( | struct jaylink_device_handle * | devh, |
enum jaylink_target_interface | iface, | ||
enum jaylink_target_interface * | prev_iface | ||
) |
Select the target interface.
prev_iface
which is not covered by jaylink_target_interface.[in,out] | devh | Device handle. |
[in] | iface | Target interface to select. |
[out] | prev_iface | Previously selected target interface on success, and undefined on failure. Can be NULL. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 203 of file jtag/drivers/libjaylink/libjaylink/target.c.
References buffer_get_u32(), jaylink_device::ctx, jaylink_device_handle::dev, iface, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), JAYLINK_TIF_2W_JTAG_PIC32, JAYLINK_TIF_BDM3, JAYLINK_TIF_FINE, JAYLINK_TIF_JTAG, JAYLINK_TIF_SWD, log_err(), transport_read(), transport_start_write_read(), and transport_write().
Referenced by select_interface().
JAYLINK_API int jaylink_set_reset | ( | struct jaylink_device_handle * | devh | ) |
Set the target reset signal.
[in,out] | devh | Device handle. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 450 of file jtag/drivers/libjaylink/libjaylink/target.c.
References jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_start_write(), and transport_write().
Referenced by jlink_reset().
JAYLINK_API int jaylink_set_speed | ( | struct jaylink_device_handle * | devh, |
uint16_t | speed | ||
) |
Set the target interface speed.
[in,out] | devh | Device handle. |
[in] | speed | Speed in kHz or JAYLINK_SPEED_ADAPTIVE_CLOCKING for adaptive clocking. Speed of 0 kHz is not allowed and adaptive clocking must only be used if the device has the JAYLINK_DEV_CAP_ADAPTIVE_CLOCKING capability. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 63 of file jtag/drivers/libjaylink/libjaylink/target.c.
References buffer_set_u16(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_start_write(), and transport_write().
Referenced by jlink_speed().
JAYLINK_API int jaylink_set_target_power | ( | struct jaylink_device_handle * | devh, |
bool | enable | ||
) |
Set the target power supply.
If enabled, the target is supplied with 5 V from pin 19 of the 20-pin JTAG / SWD connector.
[in,out] | devh | Device handle. |
[in] | enable | Determines whether to enable or disable the target power supply. |
JAYLINK_OK | Success. |
JAYLINK_ERR_ARG | Invalid arguments. |
JAYLINK_ERR_TIMEOUT | A timeout occurred. |
JAYLINK_ERR_IO | Input/output error. |
JAYLINK_ERR | Other error conditions. |
Definition at line 502 of file jtag/drivers/libjaylink/libjaylink/target.c.
References jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, jaylink_strerror(), log_err(), transport_start_write(), and transport_write().
Referenced by COMMAND_HANDLER().