summaryrefslogtreecommitdiff
path: root/lib/cccp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cccp.c')
-rw-r--r--lib/cccp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/cccp.c b/lib/cccp.c
index 99a0d81f..34e866e8 100644
--- a/lib/cccp.c
+++ b/lib/cccp.c
@@ -98,3 +98,15 @@ cccp_fini(struct ccdbg *dbg)
cccp_write(dbg, 0xf, 0xf);
dbg->clock = 1;
}
+
+cccp_open()
+{
+ dbg->fd = open("/dev/ttyUSB0", 2);
+ if (dbg->fd < 0) {
+ perror(file);
+ free(dbg);
+ return NULL;
+ }
+ cccp_init(dbg);
+ cccp_write(dbg, CC_CLOCK, CC_CLOCK);
+}