From e33e36ae11c7acef805335406c72558e595a08b4 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 29 Aug 2025 20:29:49 +0200 Subject: Cleanup imports and names --- blinky.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'blinky.py') diff --git a/blinky.py b/blinky.py index 424bf5f..d43d466 100644 --- a/blinky.py +++ b/blinky.py @@ -1,29 +1,28 @@ -#!/usr/bin/env python3 - -from amaranth import * +from amaranth import Elaboratable, Module, Signal from amaranth.build import Platform -from platform_alchitry_pt import AlchitryPtPlatform + +from platform_alchitry_pt_v2 import AlchitryPtV2Platform class Blinky(Elaboratable): def elaborate(self, platform: Platform) -> Module: m = Module() - + # Get the LED pins led = platform.request("led", 0) - + # Create a counter for timing counter = Signal(24) - + # Increment counter every clock cycle m.d.sync += counter.eq(counter + 1) - + # Connect the MSB of counter to LED (blinks at ~12Hz at 100MHz) m.d.comb += led.o.eq(counter[-1]) - + return m if __name__ == "__main__": - platform = AlchitryPtPlatform() - platform.build(Blinky(), do_program=True) \ No newline at end of file + platform = AlchitryPtV2Platform() + platform.build(Blinky(), do_program=True) -- cgit v1.3.1