From f3fdc154a50516dc969942594e884cd0be0b29d0 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 20 Oct 2011 13:55:27 +0200 Subject: Expose pco triggers --- src/cameras/pco.c | 11 ++++++++--- src/uca.h | 7 ++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/cameras/pco.c b/src/cameras/pco.c index 955ee6d..e7ef365 100644 --- a/src/cameras/pco.c +++ b/src/cameras/pco.c @@ -44,6 +44,7 @@ static uint32_t uca_pco_set_delay(struct uca_camera_priv *cam, uint32_t *delay) static uint32_t uca_pco_destroy(struct uca_camera_priv *cam) { + cam->grabber->stop_acquire(cam->grabber); pco_set_rec_state(GET_PCO(cam), 0); pco_destroy(GET_PCO(cam)); free(GET_PCO_DESC(cam)); @@ -89,16 +90,20 @@ static uint32_t uca_pco_set_property(struct uca_camera_priv *cam, enum uca_prope case UCA_PROP_DELAY: return uca_pco_set_delay(cam, (uint32_t *) data); + case UCA_PROP_TRIGGER_MODE: + /* XXX: We have a 1:1 mapping between UCA_TRIGGER_* and + * TRIGGER_MODE_* + */ + return pco_set_trigger_mode(GET_PCO(cam), (uint16_t) *(uint32_t *) data); + case UCA_PROP_TIMESTAMP_MODE: { uint32_t mode = *((uint32_t *) data); if (mode & UCA_TIMESTAMP_ASCII) { if (mode & UCA_TIMESTAMP_BINARY) return pco_set_timestamp_mode(GET_PCO(cam), TIMESTAMP_MODE_BINARYANDASCII); - else { - printf("hello\n"); + else return pco_set_timestamp_mode(GET_PCO(cam), TIMESTAMP_MODE_ASCII); - } } else if (mode & UCA_TIMESTAMP_BINARY) return pco_set_timestamp_mode(GET_PCO(cam), TIMESTAMP_MODE_BINARY); diff --git a/src/uca.h b/src/uca.h index b6466b5..e1e0ae1 100644 --- a/src/uca.h +++ b/src/uca.h @@ -131,9 +131,10 @@ enum uca_property_ids { #define UCA_TIMESTAMP_BINARY 0x02 /* Trigger mode for UCA_PROP_TRIGGER_MODE */ -#define UCA_TRIGGER_AUTO 1 /**< free-run mode */ -#define UCA_TRIGGER_SOFTWARE 2 /**< software trigger via uca_cam_trigger() */ -#define UCA_TRIGGER_EXTERNAL 3 /**< external hardware trigger */ +#define UCA_TRIGGER_AUTO 0 /**< free-run mode */ +#define UCA_TRIGGER_SOFTWARE 1 /**< software trigger via uca_cam_trigger() */ +#define UCA_TRIGGER_EXTERNAL 2 /**< external hardware trigger */ +#define UCA_TRIGGER_EXTERNAL_EXPOSURE 3 /**< hardware trigger controlling exposure */ #define UCA_TRIGGER_EXP_CAMERA 1 /**< camera-controlled exposure time */ #define UCA_TRIGGER_EXP_LEVEL 2 /**< level-controlled (trigger signal) exposure time */ -- cgit v1.2.3