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
b59b7efd
Commit
b59b7efd
authored
Feb 28, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. testing phase adjustment and i2c operations
2. fixed a couple typos
parent
235bc9fb
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
156 additions
and
97 deletions
+156
-97
mt9f002.c
src/drivers/elphel/mt9f002.c
+139
-90
mt9f002.h
src/drivers/elphel/mt9f002.h
+10
-0
mt9x001.c
src/drivers/elphel/mt9x001.c
+1
-1
pgm_functions.c
src/drivers/elphel/pgm_functions.c
+0
-2
sensor_common.c
src/drivers/elphel/sensor_common.c
+1
-1
sensor_common.h
src/drivers/elphel/sensor_common.h
+1
-1
sensor_i2c.c
src/drivers/elphel/sensor_i2c.c
+4
-2
No files found.
src/drivers/elphel/mt9f002.c
View file @
b59b7efd
This diff is collapsed.
Click to expand it.
src/drivers/elphel/mt9f002.h
View file @
b59b7efd
...
...
@@ -544,6 +544,16 @@
#define P_MT9F002_TEST_PATTERN 10
#define P_MT9F002_HISPI_TIMING 11
#define P_MT9F002_SMIA_PLL_MULTIPLIER 12
#define P_MT9F002_HISPI_CONTROL_STATUS 13
#define P_MT9F002_DATAPATH_SELECT 14
#define P_MT9F002_RESET_REGISTER 15
#define P_MT9F002_ANALOG_GAIN_CODE_GLOBAL 16
#define P_MT9F002_ANALOG_GAIN_CODE_RED 17
#define P_MT9F002_ANALOG_GAIN_CODE_BLUE 18
#define P_MT9F002_COARSE_INTEGRATION_TIME 19
//#define P_REG(x) x
//#define P_MT9F002_MODEL_ID 4
...
...
src/drivers/elphel/mt9x001.c
View file @
b59b7efd
...
...
@@ -1175,7 +1175,7 @@ int mt9x001_pgm_window_common (int sensor_port, ///< sensor port
dev_dbg
(
g_dev_ptr
,
"{%d} SET_SENSOR_MBPAR(0x%0x, 0x%x, 0x%x, 0x%x, 0x%x)
\n
"
,
sensor_port
,
sensor_port
,
frame16
,
(
int
)
sensor
->
i2c_addr
,
(
int
)
P_MT9X001_ROWSTART
,(
int
)
wt
);
}
///TODO:Get rid of get_sensor_i2c_regs16 !!!
// the fields that should not ch
na
ge in non-stop will not change, so it is OK to write them always
// the fields that should not ch
an
ge in non-stop will not change, so it is OK to write them always
if
((
styp
==
MT9T_TYP
)
||
(
styp
==
MT9P_TYP
))
{
// 3MPix and 5MPix sensors
v
=
(
thispars
->
pars
[
P_SENSOR_REGS
+
P_MT9X001_RAM
]
&
0xff88
)
|
((
bv
-
1
)
<<
4
)
|
(
dv
-
1
)
;
if
(
v
!=
thispars
->
pars
[
P_SENSOR_REGS
+
P_MT9X001_RAM
])
{
...
...
src/drivers/elphel/pgm_functions.c
View file @
b59b7efd
...
...
@@ -379,8 +379,6 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
int
i2cbytes
;
int
mux
,
sens
;
pr_info
(
"{%d} pgm_detectsensor
\n
"
,
sensor_port
);
dev_dbg
(
g_dev_ptr
,
"{%d} frame16=%d
\n
"
,
sensor_port
,
frame16
);
MDP
(
DBGB_PSFN
,
sensor_port
,
"frame16=%d
\n
"
,
frame16
)
...
...
src/drivers/elphel/sensor_common.c
View file @
b59b7efd
...
...
@@ -1223,7 +1223,7 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use
bool
mux
;
pr_info
(
"register_i2c_sensor()
\n
"
);
dev_dbg
(
g_dev_ptr
,
"register_i2c_sensor()
\n
"
);
for
(
port
=
0
;
port
<
SENSOR_PORTS
;
port
++
)
if
((
1
<<
port
)
&
ports_mask
)
{
...
...
src/drivers/elphel/sensor_common.h
View file @
b59b7efd
...
...
@@ -126,7 +126,7 @@ long long get_frame_pos(unsigned int chn, unsigned int pos);
#define X3X3_I2C_SEND2_ASAP(port,sa7,reg,data) {\
int _ADDR = pSensorPortConfig[(port)].par2addr[0][(reg)];\
int _PAGE = pSensorPortConfig[(port)].haddr2rec[0][(_ADDR>>8)&0xff];\
write_xi2c_reg16((port),
(sa7),(reg)
,(data));\
write_xi2c_reg16((port),
_PAGE,_ADDR&0xff
,(data));\
}
/** Perform I2C read (8 bits address, 16 bits data in "legacy" mode (sensors and 10359),
...
...
src/drivers/elphel/sensor_i2c.c
View file @
b59b7efd
...
...
@@ -328,7 +328,9 @@ int get_bit_delay(int khz)
// Modified FPGA - added extra division
// dly = (1000 * mclk_mhz / 4)/khz;
// dly = (1000 * mclk_mhz / 8 )/khz; //
dly
=
(
32000
*
mclk_mhz
/
scale_i2c_speed
)
/
khz
;
//
// WARNING: for 500KHz it is supposed to write 100, but it actually writes 50
dly
=
(
32000
*
mclk_mhz
/
scale_i2c_speed
)
/
khz
;
if
(
dly
>
255
)
dly
=
255
;
return
dly
;
...
...
@@ -1483,7 +1485,7 @@ static ssize_t get_i2c_help(struct device *dev, ///< Linux kernel b
"tbl_rd*: read - decoded table entry for current rd_page, write <page> <2-byte addr> <bytes_to_read> <dly>
\n
"
"tbl_rd*: alt: <class-name> <page> <bytes_to_read or 0 (use class)> <dly or 0 (use class)>
\n
"
"tbl_rd* and tbl_wr* return same result when read. Delay is 8 bit, 250 - 200KHz SCL
\n
"
"Read/write i2c register (for the pre-configured device classes), sa7_
a
ffset is added to class device slave address
\n
"
"Read/write i2c register (for the pre-configured device classes), sa7_
o
ffset is added to class device slave address
\n
"
"[<data>] is used for register write, without - register read. Reading i2c* returns result of last i2c read operation
\n
"
"i2c*: read - last read data, write: <class_name> <sa7_offset> <reg_addr> [<data>]
\n
"
"i2c_frame*: read - i2c sequencer frame number (4 bit), write: 0 - stop, 1 - run, 2 - reset, 3 - reset+run
\n
"
...
...
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