summaryrefslogtreecommitdiff
path: root/lib/cccp.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-12-20 23:30:06 -0800
committerKeith Packard <keithp@keithp.com>2008-12-20 23:30:06 -0800
commitf7d49868aeae80d515b12a7e339628f1296754a6 (patch)
tree9c319fdf24e8f919df2b8466187f06c0ab81b76c /lib/cccp.c
parent30f23f23a6db3d12fdc9c088cf6ab47c5e5077fb (diff)
Cleanup work; separating out the cp interface to be more abstract.
Signed-off-by: Keith Packard <keithp@keithp.com>
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);
+}