Skip to content

Commit

Permalink
use add_spi_master()
Browse files Browse the repository at this point in the history
use the new existing function from litex to add the spi master.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Jun 19, 2024
1 parent aa807e2 commit db2db86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def main():
if args.with_pwm:
soc.add_rgb_led()
if args.with_spi:
soc.add_spi(args.spi_data_width, args.spi_clk_freq)
soc.add_spi_master(name="spi", data_width=args.spi_data_width, spi_clk_freq=args.spi_clk_freq)
if args.with_spi_flash:
from litespi.modules import S25FL128L
from litespi.opcodes import SpiNorFlashOpCodes as Codes
Expand Down
4 changes: 0 additions & 4 deletions soc_zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ def __init__(self, cpu_variant="standard", **kwargs):
**kwargs)
soc_cls.mem_map.update(self.mem_map_zephyr)

def add_spi(self, data_width, spi_clk_freq):
spi_pads = self.platform.request("spi", 0)
self.submodules.spi = SPIMaster(spi_pads, data_width, self.clk_freq, spi_clk_freq)

def add_rgb_led(self):
rgb_led_pads = self.platform.request("rgb_led", 0)
setattr(self.submodules, "rgb_led_r0", PWM(getattr(rgb_led_pads, 'r')))
Expand Down

0 comments on commit db2db86

Please sign in to comment.