icdi: add TI icdi interface

This is the new proprietary interface replacing the older FTDI based adapters.
It is currently fitted to the ek-lm4f232 and Stellaris LaunchPad.

Change-Id: I794ad79e31ff61ec8e9f49530aca9308025c0b60
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/922
Tested-by: jenkins
This commit is contained in:
Spencer Oliver
2012-11-12 15:06:37 +00:00
parent c7a6f065d2
commit adb8ec32dc
13 changed files with 858 additions and 13 deletions

View File

@@ -370,3 +370,30 @@ void bit_copy_discard(struct bit_copy_queue *q)
free(qe);
}
}
int unhexify(char *bin, const char *hex, int count)
{
int i, tmp;
for (i = 0; i < count; i++) {
if (sscanf(hex + (2 * i), "%02x", &tmp) != 1)
return i;
bin[i] = tmp;
}
return i;
}
int hexify(char *hex, const char *bin, int count, int out_maxlen)
{
int i, cmd_len = 0;
/* May use a length, or a null-terminated string as input. */
if (count == 0)
count = strlen(bin);
for (i = 0; i < count; i++)
cmd_len += snprintf(hex + cmd_len, out_maxlen - cmd_len, "%02x", bin[i]);
return cmd_len;
}