Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
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
x393
Commits
a5738482
Commit
a5738482
authored
Jan 16, 2021
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
morte to the previous commit
parent
47f19c8b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
x393_sens_cmprs.py
py393/x393_sens_cmprs.py
+4
-2
x393_sensor.py
py393/x393_sensor.py
+14
-3
No files found.
py393/x393_sens_cmprs.py
View file @
a5738482
...
...
@@ -1897,8 +1897,8 @@ class X393SensCmprs(object):
num_payload_bytes
=
(
0
,
1
,
2
,
4
)[
byte_var
]
self
.
x393Sensor
.
set_sensor_i2c_table_reg_wr
(
num_sensor
=
num_sensor
,
page
=
indx
*
4
,
slave_addr
=
num_payload_bytes
,
page
=
indx
*
4
+
byte_var
,
slave_addr
=
byte_var
,
#
num_payload_bytes,
rah
=
mod_index
,
num_bytes
=
4
,
bit_delay
=
i2c_delay
,
# not used here
...
...
@@ -1916,6 +1916,8 @@ class X393SensCmprs(object):
self
.
x393Sensor
.
set_sensor_i2c_command
(
num_sensor
=
num_sensor
,
run_cmd
=
True
)
if
verbose
>
0
:
print
(
" --- Enabled i2c sequencer ---"
)
if
exit_step
==
21
:
return
False
...
...
py393/x393_sensor.py
View file @
a5738482
...
...
@@ -911,11 +911,14 @@ class X393Sensor(object):
if
payload_mode
<
0
:
raise
ValueError
(
'Payload of 3 bytes is not implemented, only 0,1,2 or 4 bytes are valid.'
)
_
,
mod_index
=
BOSON_MAP
[
mod_name
]
wdata
=
((
mod_index
*
4
+
payload_mode
)
<<
24
)
+
(
func_lsb
&
0xff
)
<<
16
+
(
data
&
0xffff
)
wdata
=
((
mod_index
*
4
+
payload_mode
)
<<
24
)
+
((
func_lsb
&
0xff
)
<<
16
)
+
(
data
&
0xffff
)
self
.
write_sensor_i2c
(
num_sensor
=
num_sensor
,
rel_addr
=
rel_addr
,
addr
=
addr
,
data
=
wdata
)
print
(
"Boson sequencer command: addr= 0x
%
x, data = 0x
%
x"
%
(
addr
,
wdata
))
def
write_sensor_reg16
(
self
,
num_sensor
,
...
...
@@ -1635,7 +1638,7 @@ class X393Sensor(object):
wait_packet
=
True
,
enable_sequencer
=
True
):
"""
Send packet to UART
Send packet to UART
(assuming sequencer is disabled if needed)
@param num_sensor - sensor port number (0..3)
@param wait packet - if False, return empty packet if none is available
@param enable_sequencer (Re)enable sequencer commands
...
...
@@ -1651,6 +1654,10 @@ class X393Sensor(object):
if
not
wait_packet
:
break
if
not
recv_pav
:
if
enable_sequencer
:
self
.
set_sensor_uart_ctl_boson
(
# next byte
num_sensor
=
num_sensor
,
uart_extif_en
=
True
)
return
packet
# empty bytearray
#read byte array. TODO: improve waiting for tghe next byte?
# packet = bytearray()
...
...
@@ -1665,6 +1672,10 @@ class X393Sensor(object):
if
not
recv_eop
:
packet
.
append
(
recv_data
)
#
if
enable_sequencer
:
self
.
set_sensor_uart_ctl_boson
(
# next byte
num_sensor
=
num_sensor
,
uart_extif_en
=
True
)
return
packet
def
jtag_get_tdo
(
self
,
chn
):
...
...
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