OpenOCD
swd.c File Reference

Serial Wire Debug (SWD) functions. More...

Include dependency graph for swd.c:

Go to the source code of this file.

Functions

JAYLINK_API int jaylink_swd_io (struct jaylink_device_handle *devh, const uint8_t *direction, const uint8_t *out, uint8_t *in, uint16_t length)
 Perform a SWD I/O operation. More...
 

Detailed Description

Serial Wire Debug (SWD) functions.

Definition in file swd.c.

Function Documentation

◆ jaylink_swd_io()

JAYLINK_API int jaylink_swd_io ( struct jaylink_device_handle devh,
const uint8_t *  direction,
const uint8_t *  out,
uint8_t *  in,
uint16_t  length 
)

Perform a SWD I/O operation.

Note
This function must only be used if the JAYLINK_TIF_SWD interface is available and selected.
Parameters
[in,out]devhDevice handle.
[in]directionBuffer to read the transfer direction from.
[in]outBuffer to read host-to-target data from.
[out]inBuffer to store target-to-host 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]lengthTotal number of bits to transfer from host to target and vice versa.
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

Definition at line 71 of file swd.c.

References buffer_set_u16(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_ERR_DEV, JAYLINK_ERR_DEV_NO_MEMORY, JAYLINK_OK, jaylink_strerror(), log_err(), transport_read(), transport_start_write_read(), and transport_write().

Referenced by jlink_swd_run_queue().