1
1
/**********************************************************************
2
2
** snap.c
3
3
** Control Image Capture and Data Dump
4
- ** Version 1.11
4
+ ** Version 1.12
5
5
**
6
6
** SPDX-FileCopyrightText: © 2013 Herbert Poetzl <herbert@13thfloor.at>
7
7
** SPDX-License-Identifier: GPL-2.0-or-later
26
26
#include "cmv_reg.h"
27
27
#include "scn_reg.h"
28
28
29
- #define VERSION "cmv_snap3 V1.11 "
29
+ #define VERSION "cmv_snap3 V1.12 "
30
30
31
31
static char * cmd_name = NULL ;
32
32
@@ -69,17 +69,19 @@ static bool out_12 = false;
69
69
static bool out_16 = true;
70
70
static bool out_buf = false;
71
71
72
- // static bool opt_bcols = false;
72
+ static bool opt_bcols = false;
73
73
static bool opt_tpat = false;
74
74
static bool opt_dumpr = false;
75
75
static bool opt_prime = false;
76
76
static bool opt_zero = false;
77
+ static bool opt_keep = false;
77
78
78
79
static uint16_t reg82 ;
79
80
// static uint16_t reg83;
80
81
// static uint16_t reg84;
81
82
static uint16_t reg85 ;
82
83
// static uint16_t reg86;
84
+ static uint16_t reg89 ;
83
85
84
86
85
87
double lvds = 250e6 ;
@@ -566,7 +568,7 @@ static void cmv_sem_init_and_lock()
566
568
atexit (cmv_sem_unlock_and_cleanup );
567
569
}
568
570
569
- #define OPTIONS "h82dbprtze :v:s:S:P:R:"
571
+ #define OPTIONS "h82dbprtzEe :v:s:S:P:R:"
570
572
571
573
int main (int argc , char * argv [])
572
574
{
@@ -594,6 +596,7 @@ int main(int argc, char *argv[])
594
596
"-r dump sensor registers\n"
595
597
"-t enable cmv test pattern\n"
596
598
"-z produce no data output\n"
599
+ "-E keep current exposure\n"
597
600
// "-n <num> number of frames\n"
598
601
"-e <exp> exposure times\n"
599
602
"-v <exp> exposure voltages\n"
@@ -617,7 +620,7 @@ int main(int argc, char *argv[])
617
620
out_buf = true;
618
621
break ;
619
622
case 'b' :
620
- // opt_bcols = true;
623
+ opt_bcols = true;
621
624
break ;
622
625
case 'p' :
623
626
opt_prime = true;
@@ -631,6 +634,9 @@ int main(int argc, char *argv[])
631
634
case 'z' :
632
635
opt_zero = true;
633
636
break ;
637
+ case 'E' :
638
+ opt_keep = true;
639
+ break ;
634
640
/* case 'n':
635
641
num_frames = argtoll(optarg, NULL, NULL);
636
642
break; */
@@ -749,7 +755,7 @@ int main(int argc, char *argv[])
749
755
}
750
756
751
757
752
- if (num_times == 0 )
758
+ if (( num_times == 0 ) && ! opt_keep )
753
759
goto regs ;
754
760
755
761
if (opt_prime ) {
@@ -765,6 +771,12 @@ int main(int argc, char *argv[])
765
771
766
772
reg82 = get_cmv_reg (82 );
767
773
reg85 = get_cmv_reg (85 );
774
+ reg89 = get_cmv_reg (89 );
775
+
776
+ if (opt_bcols && ((reg89 & 0x8000 ) == 0 ))
777
+ set_cmv_reg (89 , reg89 | 0x8000 );
778
+ if (!opt_bcols && ((reg89 & 0x8000 ) != 0 ))
779
+ set_cmv_reg (89 , reg89 & ~0x8000 );
768
780
769
781
770
782
if (num_times > 2 ) {
@@ -828,7 +840,7 @@ int main(int argc, char *argv[])
828
840
reg82 = get_cmv_reg (82 );
829
841
reg85 = get_cmv_reg (85 );
830
842
831
- if (num_times == 0 )
843
+ if (( num_times == 0 ) && ! opt_keep )
832
844
goto skip ;
833
845
834
846
exp_time [0 ] = get_cmv_reg (72 ) << 16 | get_cmv_reg (71 );
0 commit comments