blob: 58c2c38af4e4a0aa3532e03cb0ebf9356364ecfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
-- | The main board, set up to be wired to either the Inkplate's top-level or
-- the simulator's. This insulates us from Bluesim's lack of Inout support.
package Numini where
import Clock
import HyperBus
import Uart
-- | The output pins.
interface NuminiOut =
ch559_uart_tx :: Bit 1
inkplate_uart_tx :: Bit 1
usb_uart_tx :: Bit 1
led_r_n :: Bit 1
led_g_n :: Bit 1
rgb_r_n :: Bit 1
rgb_g_n :: Bit 1
rgb_b_n :: Bit 1
hyperbus_ck :: Bit 1
hyperbus_ck_n :: Bit 1
hyperbus_cs0_n :: Bit 1
hyperbus_cs1_n :: Bit 1
hyperbus_cs2_n :: Bit 1
hyperbus_cs3_n :: Bit 1
hyperbus_reset_n :: Bit 1
hyperbus_rwds_out :: Maybe (Bit 1)
hyperbus_dq_out :: Maybe (Bit 8)
i2c_scl :: Bit 1
i2c_sda_out :: Maybe (Bit 1)
clockFreqHz :: Bit 24
clockFreqHz = 12_000_000
mkNumini :: Wire (Bit 1) -> Wire (Bit 1) -> Wire (Bit 1) -> Wire (Bit 1) ->
Wire (Bit 8) -> Wire (Bit 1) -> Module NuminiOut
mkNumini ch559_uart_rx inkplate_uart_rx usb_uart_rx hyperbus_rwds_in
hyperbus_dq_in i2c_sda_in = module
clk9600 <- mkClock (clockFreqHz / 9600)
clk2M <- mkClock (clockFreqHz / 2_000_000)
clk3M <- mkClock (clockFreqHz / 3_000_000)
ch559_uart <- mkUart ch559_uart_rx clk9600
inkplate_uart <- mkUart inkplate_uart_rx clk2M
usb_uart <- mkUart usb_uart_rx clk9600
hyperbus <- mkHyperBus hyperbus_rwds_in hyperbus_dq_in clk3M
interface NuminiOut
ch559_uart_tx = ch559_uart.tx
inkplate_uart_tx = inkplate_uart.tx
usb_uart_tx = usb_uart.tx
led_r_n = 1
led_g_n = 1
rgb_r_n = 1
rgb_g_n = 1
rgb_b_n = 1
hyperbus_ck = hyperbus.ck
hyperbus_ck_n = hyperbus.ck_n
hyperbus_cs0_n = hyperbus.cs0_n
hyperbus_cs1_n = hyperbus.cs1_n
hyperbus_cs2_n = hyperbus.cs2_n
hyperbus_cs3_n = hyperbus.cs3_n
hyperbus_reset_n = hyperbus.reset_n
hyperbus_rwds_out = hyperbus.rwds_out
hyperbus_dq_out = hyperbus.dq_out
i2c_scl = 1
i2c_sda_out = Nothing
-- vim: set ft=haskell :
|