X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=lib%2Fccdbg.h;h=f6e216c41b61b71c5be2f0a5714101cf2124646f;hp=241c4eecf311b717ee4f216cd9b84edf7c492a20;hb=c8fd04e154bcfd65ae1200980bd8163caabd7fe4;hpb=6c2a65c743a4ffae96ed27dbc38c1bf9242ed1df diff --git a/lib/ccdbg.h b/lib/ccdbg.h index 241c4eec..f6e216c4 100644 --- a/lib/ccdbg.h +++ b/lib/ccdbg.h @@ -35,7 +35,13 @@ #define CC_CLOCK 0x1 #define CC_DATA 0x2 #define CC_RESET_N 0x4 -#define CC_CLOCK_US (0) +#define CC_CLOCK_US (1000) + +/* Telemetrum has a 10k pull-up to 3.3v, a 0.001uF cap to ground + * and a 2.7k resistor to the reset line. This takes about 6us + * to settle, so we'll wait longer than that after changing the reset line + */ +#define CC_RESET_US (12) /* 8051 instructions */ @@ -258,9 +264,15 @@ int ccdbg_hex_image_equal(struct hex_image *a, struct hex_image *b); /* ccdbg-io.c */ +void +ccdbg_set_clock(uint32_t us); + void ccdbg_half_clock(struct ccdbg *dbg); +void +ccdbg_wait_reset(struct ccdbg *dbg); + int ccdbg_write(struct ccdbg *dbg, uint8_t mask, uint8_t value);