From 28619821bc90ed4c15844b2e6b6a5a2971ef5f2e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 21 Feb 2011 15:06:42 +0100 Subject: Initial commit --- src/cameras/uca_pco.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/cameras/uca_pco.c (limited to 'src/cameras/uca_pco.c') diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c new file mode 100644 index 0000000..daba6f6 --- /dev/null +++ b/src/cameras/uca_pco.c @@ -0,0 +1,30 @@ + +#include +#include +#include "uca.h" +#include "uca_pco.h" + +struct pco_edge_t *pco; + +static void uca_pco_destroy(struct uca_t *uca) +{ + pco_destroy(pco); +} + +uint8_t uca_pco_init(struct uca_t *uca) +{ + pco = pco_init(); + if (!pco_active(pco)) { + pco_destroy(pco); + return 0; + } + + pco_scan_and_set_baud_rate(pco); + + /* Camera found, set function pointers... */ + uca->cam_destroy = &uca_pco_destroy; + + /* ... and some properties */ + pco_get_actual_size(pco, &uca->image_width, &uca->image_height); + return 1; +} -- cgit v1.2.3