Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha
Commits
6c7b5427
Commit
6c7b5427
authored
Aug 29, 2011
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separated GPIO port driver from the top-level core
parent
605a1ff8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
fd_gpio.vhd
hdl/rtl/fd_gpio.vhd
+79
-0
No files found.
hdl/rtl/fd_gpio.vhd
0 → 100644
View file @
6c7b5427
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
work
.
fd_wbgen2_pkg
.
all
;
entity
fd_gpio
is
port
(
clk_sys_i
:
in
std_logic
;
rst_n_i
:
in
std_logic
;
-- chip select for VCTCXO DAC
spi_cs_dac_n_o
:
out
std_logic
;
-- chip select for AD9516 PLL
spi_cs_pll_n_o
:
out
std_logic
;
-- chip select for MCP23S17 GPIO
spi_cs_gpio_n_o
:
out
std_logic
;
-- these are obvious
spi_sclk_o
:
out
std_logic
;
spi_mosi_o
:
out
std_logic
;
spi_miso_i
:
in
std_logic
;
regs_b
:
inout
t_fd_registers
);
end
fd_gpio
;
architecture
rtl
of
fd_gpio
is
begin
-- rtl
p_gpio_loads
:
process
(
clk_sys_i
)
begin
if
rising_edge
(
clk_sys_i
)
then
if
(
rst_n_i
=
'0'
)
then
spi_cs_dac_n_o
<=
'1'
;
spi_cs_pll_n_o
<=
'1'
;
spi_cs_gpio_n_o
<=
'1'
;
spi_sclk_o
<=
'0'
;
spi_mosi_o
<=
'0'
;
regs
.
gprr_miso_i
<=
'0'
;
else
if
(
regs
.
gpsr_cs_pll_wr_o
=
'1'
and
regs
.
gpsr_cs_pll_o
=
'1'
)
then
spi_cs_pll_n_o
<=
'1'
;
elsif
(
regs
.
gpcr_cs_pll_wr_o
=
'1'
and
regs
.
gpcr_cs_pll_o
=
'1'
)
then
spi_cs_pll_n_o
<=
'0'
;
end
if
;
if
(
regs
.
gpsr_cs_gpio_wr_o
=
'1'
and
regs
.
gpsr_cs_gpio_o
=
'1'
)
then
spi_cs_gpio_n_o
<=
'1'
;
elsif
(
regs
.
gpcr_cs_gpio_wr_o
=
'1'
and
regs
.
gpcr_cs_gpio_o
=
'1'
)
then
spi_cs_gpio_n_o
<=
'0'
;
end
if
;
if
(
regs
.
gpsr_mosi_wr_o
=
'1'
and
regs
.
gpsr_mosi_o
=
'1'
)
then
spi_mosi_o
<=
'1'
;
elsif
(
regs
.
gpcr_mosi_wr_o
=
'1'
and
regs
.
gpcr_mosi_o
=
'1'
)
then
spi_mosi_o
<=
'0'
;
end
if
;
if
(
regs
.
gpsr_sclk_wr_o
=
'1'
and
regs
.
gpsr_sclk_o
=
'1'
)
then
spi_sclk_o
<=
'1'
;
elsif
(
regs
.
gpcr_sclk_wr_o
=
'1'
and
regs
.
gpcr_sclk_o
=
'1'
)
then
spi_sclk_o
<=
'0'
;
end
if
;
regs
.
gprr_miso_i
<=
spi_miso_i
;
end
if
;
end
if
;
end
process
;
end
rtl
;
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