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
f32a5151
Commit
f32a5151
authored
Nov 17, 2017
by
Raimundas Bastys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed sensor/sensor_i2c.v: working spi read mask 0x9100
parent
a70ccd28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
sensor_i2c.v
sensor/sensor_i2c.v
+32
-1
No files found.
sensor/sensor_i2c.v
View file @
f32a5151
...
@@ -301,7 +301,37 @@ module sensor_i2c#(
...
@@ -301,7 +301,37 @@ module sensor_i2c#(
reg
spi_wr_fifo_en
;
reg
spi_wr_fifo_en
;
reg
spi_pre_wr_fifo_en
;
reg
spi_pre_wr_fifo_en
;
`endif
always
@
(
posedge
mclk
)
begin
if
(
spi_wr_fifo_en
)
spi_wr_fifo_en
<=
1'b0
;
if
(
mrst
)
begin
spi_wr_fifo_en
<=
1'b0
;
spi_pre_wr_fifo_en
<=
1'b0
;
end
else
if
(
spi_rd_en
)
spi_pre_wr_fifo_en
<=
1'b1
;
else
if
(
spi_ready
&&
spi_pre_wr_fifo_en
)
begin
spi_pre_wr_fifo_en
<=
1'b0
;
spi_wr_fifo_en
<=
1'b1
;
end
end
fifo_same_clock
#(
.
DATA_WIDTH
(
8
)
,
.
DATA_DEPTH
(
4
)
)
fifo_same_clock_spi_rdata_i
(
.
rst
(
1'b0
)
,
// input
.
clk
(
mclk
)
,
// input
.
sync_rst
(
mrst
)
,
// input
.
we
(
spi_wr_fifo_en
)
,
// input
.
re
(
i2c_fifo_rd
)
,
// input
.
data_in
(
data_from_spi
)
,
// input[7:0]
.
data_out
(
i2c_fifo_dout
)
,
// output[7:0]
.
nempty
(
i2c_fifo_nempty
)
,
// output
.
half_full
()
// output reg
)
;
`else
fifo_same_clock
#(
fifo_same_clock
#(
.
DATA_WIDTH
(
8
)
,
.
DATA_WIDTH
(
8
)
,
...
@@ -318,6 +348,7 @@ module sensor_i2c#(
...
@@ -318,6 +348,7 @@ module sensor_i2c#(
.
half_full
()
// output reg
.
half_full
()
// output reg
)
;
)
;
`endif
always
@
(
posedge
mclk
)
begin
always
@
(
posedge
mclk
)
begin
...
...
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