Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
ac730409
Commit
ac730409
authored
May 21, 2020
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added reading senspgmin bit status (0 - sensor, 1 - mux/empty) for sensor boards detection
parent
ecc6fb79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
pgm_functions.c
src/drivers/elphel/pgm_functions.c
+25
-0
No files found.
src/drivers/elphel/pgm_functions.c
View file @
ac730409
...
@@ -373,6 +373,14 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
...
@@ -373,6 +373,14 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
x393_camsync_io_t
camsync_src
=
{.
d32
=
0x00000
};
// all disabled (use internal)
x393_camsync_io_t
camsync_src
=
{.
d32
=
0x00000
};
// all disabled (use internal)
x393_camsync_io_t
camsync_dst
=
{.
d32
=
0x00000
};
// all disable - nothing to output
x393_camsync_io_t
camsync_dst
=
{.
d32
=
0x00000
};
// all disable - nothing to output
// Need to check a certain pin state, which is
// senspgmin (bit 24 of x393_status_sens_io_t)
// senspgmin = 0 - some sensor board is attached to port
// senspgmin = 1 - mux board or nothing
x393_status_ctrl_t
status_ctrl
=
{.
d32
=
0
};
x393_status_sens_io_t
status
;
int
i
;
// Setting trigger input, output and preriod to off
// Setting trigger input, output and preriod to off
int
was_sensor_freq
=
0
;
// 90000000; // getClockFreq(1);
int
was_sensor_freq
=
0
;
// 90000000; // getClockFreq(1);
...
@@ -478,6 +486,23 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
...
@@ -478,6 +486,23 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
MDP
(
DBGB_PADD
,
sensor_port
,
"Mux mode for port %d SENSOR_NONE, skipping 10359 detection
\n
"
,
sensor_port
)
MDP
(
DBGB_PADD
,
sensor_port
,
"Mux mode for port %d SENSOR_NONE, skipping 10359 detection
\n
"
,
sensor_port
)
}
}
// check senspgmin (bit 24 of x393_status_sens_io_t)
status
=
x393_sensio_status
(
sensor_port
);
status_ctrl
.
seq_num
=
status
.
seq_num
+
1
;
status_ctrl
.
mode
=
1
;
set_x393_sensio_status_cntrl
(
status_ctrl
,
sensor_port
);
for
(
i
=
0
;
i
<
10
;
i
++
){
status
=
x393_sensio_status
(
sensor_port
);
if
(
status
.
seq_num
==
status_ctrl
.
seq_num
){
break
;
}
}
// '1' - means empty port (pull up) or mux board
if
(
status
.
senspgmin
==
1
){
dev_info
(
g_dev_ptr
,
"No sensors connected to port %d
\n
"
,
sensor_port
);
return
0
;
}
//if ((thispars->pars[P_SENSOR]==0) || // multisensor not detected
//if ((thispars->pars[P_SENSOR]==0) || // multisensor not detected
// ((thispars->pars[P_SENSOR] & SENSOR_MASK) == SENSOR_MT9X001)) { // or is (from DT) SENSOR_MT9X001
// ((thispars->pars[P_SENSOR] & SENSOR_MASK) == SENSOR_MT9X001)) { // or is (from DT) SENSOR_MT9X001
if
((
fpga_interface
==
FPGA_PAR12
)
&&
if
((
fpga_interface
==
FPGA_PAR12
)
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment