|
libjaylink
0.2.0
Library to access J-Link devices
|
Serial Wire Output (SWO) functions. More...
Functions | |
| int | jaylink_swo_start (struct jaylink_device_handle *devh, enum jaylink_swo_mode mode, uint32_t baudrate, uint32_t size) |
| Start SWO capture. More... | |
| int | jaylink_swo_stop (struct jaylink_device_handle *devh) |
| Stop SWO capture. More... | |
| int | jaylink_swo_read (struct jaylink_device_handle *devh, uint8_t *buffer, uint32_t *length) |
| Read SWO trace data. More... | |
| int | jaylink_swo_get_speeds (struct jaylink_device_handle *devh, enum jaylink_swo_mode mode, struct jaylink_swo_speed *speed) |
| Retrieve SWO speeds. More... | |
Serial Wire Output (SWO) functions.
| int jaylink_swo_get_speeds | ( | struct jaylink_device_handle * | devh, |
| enum jaylink_swo_mode | mode, | ||
| struct jaylink_swo_speed * | speed | ||
| ) |
Retrieve SWO speeds.
The speeds are calculated as follows:
speeds = freq / n with n >= min_div and n <= max_div, where n is an integerAssuming, for example, a base frequency freq of 4500 kHz, a minimum divider min_div of 1 and a maximum divider max_div of 8 then the highest possible SWO speed is 4500 kHz / 1 = 4500 kHz. The next highest speed is 2250 kHz for a divider of 2, and so on. Accordingly, the lowest possible speed is 4500 kHz / 8 = 562.5 kHz.
| [in,out] | devh | Device handle. |
| [in] | mode | Capture mode to retrieve speeds for. |
| [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_DEV | Unspecified device error. |
| JAYLINK_ERR | Other error conditions. |
| int jaylink_swo_read | ( | struct jaylink_device_handle * | devh, |
| uint8_t * | buffer, | ||
| uint32_t * | length | ||
| ) |
Read SWO trace data.
| [in,out] | devh | Device handle. |
| [out] | buffer | Buffer to store trace data on success. Its content is undefined on failure. |
| [in,out] | length | Maximum number of bytes to read. On success, the value gets updated with the actual number of bytes read. The value is 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_DEV | Unspecified device error. |
| JAYLINK_ERR | Other error conditions. |
| int jaylink_swo_start | ( | struct jaylink_device_handle * | devh, |
| enum jaylink_swo_mode | mode, | ||
| uint32_t | baudrate, | ||
| uint32_t | size | ||
| ) |
Start SWO capture.
| [in,out] | devh | Device handle. |
| [in] | mode | Mode to capture data with. |
| [in] | baudrate | Baudrate to capture data in bit per second. |
| [in] | size | Device internal buffer size in bytes to use for capturing. |
| JAYLINK_OK | Success. |
| JAYLINK_ERR_ARG | Invalid arguments. |
| JAYLINK_ERR_TIMEOUT | A timeout occurred. |
| JAYLINK_ERR_IO | Input/output error. |
| JAYLINK_ERR_DEV | Unspecified device error. |
| JAYLINK_ERR | Other error conditions. |
| int jaylink_swo_stop | ( | struct jaylink_device_handle * | devh | ) |
Stop SWO capture.
| [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_DEV | Unspecified device error. |
| JAYLINK_ERR | Other error conditions. |
1.8.10