aboutsummaryrefslogtreecommitdiff
path: root/src/Top.bs
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-09-23 21:46:34 -0500
committerNathan Ringo <nathan@remexre.com>2024-09-23 21:46:34 -0500
commitfc1959bd9887ecc4d4ceb62a53e87abc6f49ef00 (patch)
tree801fad484692ca226eb2dfdf792338cabe218c72 /src/Top.bs
parent777da6874bdbda1c83108024eb37dc901e04838e (diff)
Adds README, moves fpga stuff to a subdirectory.
Diffstat (limited to 'src/Top.bs')
-rw-r--r--src/Top.bs59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/Top.bs b/src/Top.bs
deleted file mode 100644
index 9afaaab..0000000
--- a/src/Top.bs
+++ /dev/null
@@ -1,59 +0,0 @@
-package Top where
-
-import App
-import Uart
-
-interface Top =
- -- RS232
- rx :: Bit 1 -> Action {-# always_enabled, always_ready, prefix = "", arg_names = [RX] #-}
- tx :: Bit 1 {-# always_ready, result = TX #-}
- -- Onboard LEDs
- ledR_N :: Bit 1 {-# always_ready, result = LEDR_N #-}
- ledG_N :: Bit 1 {-# always_ready, result = LEDG_N #-}
- -- RGB LED driver
- ledRed_N :: Bit 1 {-# always_ready, result = LED_RED_N #-}
- ledGrn_N :: Bit 1 {-# always_ready, result = LED_GRN_N #-}
- ledBlu_N :: Bit 1 {-# always_ready, result = LED_BLU_N #-}
- -- LEDs and buttons (PMOD 2)
- led1 :: Bit 1 {-# always_ready, result = LED1 #-}
- led2 :: Bit 1 {-# always_ready, result = LED2 #-}
- led3 :: Bit 1 {-# always_ready, result = LED3 #-}
- led4 :: Bit 1 {-# always_ready, result = LED4 #-}
- led5 :: Bit 1 {-# always_ready, result = LED5 #-}
- btn1 :: Bit 1 -> Action {-# always_enabled, always_ready, prefix = "", arg_names = [BTN1] #-}
- btn2 :: Bit 1 -> Action {-# always_enabled, always_ready, prefix = "", arg_names = [BTN2] #-}
- btn3 :: Bit 1 -> Action {-# always_enabled, always_ready, prefix = "", arg_names = [BTN3] #-}
-
-clockFreqHz :: Integer
-clockFreqHz = 12_000_000
-
-mkTop :: Module Top
-mkTop =
- module
- uart <- mkUart (clockFreqHz / 9600)
- app <- mkApp uart.recv uart.send
-
- interface Top
- -- RS232
- rx = uart.rxPin
- tx = uart.txPin
- -- Onboard LEDs
- ledR_N = uart.txPin
- ledG_N = 1 - app.led
- -- RGB LED driver
- ledRed_N = 1
- ledGrn_N = 1
- ledBlu_N = 1
- -- LEDs and buttons (PMOD 2)
- led1 = 0
- led2 = 0
- led3 = 0
- led4 = 0
- led5 = 0
- btn1 _ = return ()
- btn2 _ = return ()
- btn3 _ = return ()
-{-# verilog mkTop #-}
-{-# properties mkTop = { RSTN = BTN_N } #-}
-
--- vim: set ft=haskell :