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
2ddc7805
Commit
2ddc7805
authored
Oct 23, 2017
by
Raimundas Bastys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added write_sensor_spi_reg in file py393/x393_sensor.py
parent
8a4bdc26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
x393_sensor.py
py393/x393_sensor.py
+15
-0
No files found.
py393/x393_sensor.py
View file @
2ddc7805
...
@@ -678,6 +678,21 @@ class X393Sensor(object):
...
@@ -678,6 +678,21 @@ class X393Sensor(object):
addr
=
0
,
addr
=
0
,
data
=
((
reg_addr16
&
0xffff
)
<<
16
)
|
(
reg_data16
&
0xffff
)
)
data
=
((
reg_addr16
&
0xffff
)
<<
16
)
|
(
reg_data16
&
0xffff
)
)
def
write_sensor_spi_reg
(
self
,
num_sensor
,
reg_addr7
,
reg_data8
):
"""
Write spi register in immediate mode
@param num_sensor - sensor port number (0..3), or "all" - same to all sensors
@param reg_addr7 - 7-bit register address
@param reg_data8 - 8-bit data to write to sensor register
"""
self
.
write_sensor_i2c
(
num_sensor
=
num_sensor
,
rel_addr
=
True
,
addr
=
0
,
data
=
(
((
0x9000
)
<<
16
)
|
(
(
reg_addr7
&
0x7f
)
<<
8
)
|
(
reg_data8
&
0xff
)
)
)
def
write_sensor_i2c
(
self
,
def
write_sensor_i2c
(
self
,
num_sensor
,
num_sensor
,
rel_addr
,
rel_addr
,
...
...
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