summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-14 11:57:55 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-14 11:57:55 +0100
commit0e40d8791f5fa2081a76fa9a03bef6e189dbec0e (patch)
treeac4c079dd772ff4669562a6f6853bc5f4fda5391
parentb1b747d9f0f1065a6078dfc788fff60109fc007e (diff)
downloaduca-0e40d8791f5fa2081a76fa9a03bef6e189dbec0e.tar.gz
uca-0e40d8791f5fa2081a76fa9a03bef6e189dbec0e.tar.bz2
uca-0e40d8791f5fa2081a76fa9a03bef6e189dbec0e.tar.xz
uca-0e40d8791f5fa2081a76fa9a03bef6e189dbec0e.zip
Add gain modes
-rw-r--r--src/cameras/ipe.c26
-rw-r--r--src/uca.c8
-rw-r--r--src/uca.h9
3 files changed, 43 insertions, 0 deletions
diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c
index a2308ad..193091a 100644
--- a/src/cameras/ipe.c
+++ b/src/cameras/ipe.c
@@ -46,6 +46,32 @@ static uint32_t uca_ipe_get_property(struct uca_camera_t *cam, enum uca_property
set_void(data, uint32_t, (uint32_t) value);
break;
+ case UCA_PROP_PGA_GAIN:
+ pcilib_read_register(handle, NULL, "pga", &value);
+ set_void(data, uint32_t, (uint32_t) value);
+ break;
+
+ case UCA_PROP_PGA_GAIN_MIN:
+ set_void(data, uint32_t, 0);
+ break;
+
+ case UCA_PROP_PGA_GAIN_MAX:
+ set_void(data, uint32_t, 3);
+ break;
+
+ case UCA_PROP_ADC_GAIN:
+ pcilib_read_register(handle, NULL, "adc_gain", &value);
+ set_void(data, uint32_t, (uint32_t) value);
+ break;
+
+ case UCA_PROP_ADC_GAIN_MIN:
+ set_void(data, uint32_t, 32);
+ break;
+
+ case UCA_PROP_ADC_GAIN_MAX:
+ set_void(data, uint32_t, 55);
+ break;
+
default:
return UCA_ERR_PROP_INVALID;
}
diff --git a/src/uca.c b/src/uca.c
index fc36f2e..6662f3d 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -66,6 +66,14 @@ static struct uca_property_t property_map[UCA_PROP_LAST+1] = {
{ "Temperature.Camera", uca_dc, uca_uint32t, uca_read },
{ "Trigger.Mode", uca_na, uca_uint32t, uca_readwrite },
{ "Trigger.Exposure", uca_na, uca_uint32t, uca_readwrite },
+ { "Gain.PGA", uca_na, uca_uint32t, uca_readwrite },
+ { "Gain.PGA.Min", uca_na, uca_uint32t, uca_read },
+ { "Gain.PGA.Max", uca_na, uca_uint32t, uca_read },
+ { "Gain.PGA.Step", uca_na, uca_uint32t, uca_read },
+ { "Gain.ADC", uca_na, uca_uint32t, uca_readwrite },
+ { "Gain.ADC.Min", uca_na, uca_uint32t, uca_read },
+ { "Gain.ADC.Max", uca_na, uca_uint32t, uca_read },
+ { "Gain.ADC.Step", uca_na, uca_uint32t, uca_read },
{ "Mode.Timestamp", uca_na, uca_uint32t, uca_readwrite },
{ "Mode.Scan", uca_na, uca_uint32t, uca_readwrite },
{ "Interlace.Samplerate", uca_na, uca_uint32t, uca_readwrite },
diff --git a/src/uca.h b/src/uca.h
index e206ad0..fd7c079 100644
--- a/src/uca.h
+++ b/src/uca.h
@@ -48,6 +48,15 @@ enum uca_property_ids {
UCA_PROP_TRIGGER_MODE,
UCA_PROP_TRIGGER_EXPOSURE,
+ UCA_PROP_PGA_GAIN,
+ UCA_PROP_PGA_GAIN_MIN,
+ UCA_PROP_PGA_GAIN_MAX,
+ UCA_PROP_PGA_GAIN_STEPS,
+ UCA_PROP_ADC_GAIN,
+ UCA_PROP_ADC_GAIN_MIN,
+ UCA_PROP_ADC_GAIN_MAX,
+ UCA_PROP_ADC_GAIN_STEPS,
+
/* pco.edge specific */
UCA_PROP_TIMESTAMP_MODE,
UCA_PROP_SCAN_MODE,