ulink_calculate_delay() function
OpenULINK TCK frequency helper functions ***************** Calculate delay values for a given TCK frequency. The OpenULINK firmware uses five different speed values for different commands. These speed values are calculated in these functions. The five different commands which support variable TCK frequency are implemented twice in the firmware: 1. Maximum possible frequency without any artificial delay 2. Variable frequency with artificial linear delay loop To set the ULINK to maximum frequency, it is only necessary to use the corresponding command IDs. To set the ULINK to a lower frequency, the delay loop top values have to be calculated first. Then, a CMD_CONFIGURE_TCK_FREQ command needs to be sent to the ULINK device. The delay values are described by linear equations: t = k * x + d (t = period, k = constant, x = delay value, d = constant) Thus, the delay can be calculated as in the following equation: x = (t - d) / k The constants in these equations have been determined and validated by measuring the frequency resulting from different delay values.
Arguments
type
for which command to calculate the delay value.
f
TCK frequency for which to calculate the delay value in Hz.
delay
where to store resulting delay value.
Return value
on success: ERROR_OK on failure: ERROR_FAIL
Functions calling ulink_calculate_delay()
Functions called by ulink_calculate_delay()
ulink_calculate_delay()
ceilf() all items filtered out
Data read by ulink_calculate_delay()
Data written by ulink_calculate_delay()
ulink_calculate_delay()