-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTest.hs
47 lines (42 loc) · 772 Bytes
/
Test.hs
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
----------------------------------------------------------------------------
-- |
-- Module : Test
-- Copyright : (c) Marc Fontaine 2016-2018
-- License : BSD3
--
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : GHC-only
--
module Test
where
import TRX
import IA4420
-- | Reset and turn on the transmitter.
test :: IO ()
test = runReset $ do
initIA4420
initIA4420 :: TRX ()
initIA4420 = do
set FrequencyBand433
set $ frequencyMHz 433.400
set $ OutputPower 7
set EnableTransmisson
initRFM12B :: TRX()
initRFM12B = liftSTL $ do
mapM_ sendSPI [
0x80D8
,0x8239
,0xA640
,0xC647
,0x94A0
,0xC2AC
,0xCA81
,0xCED4
,0xC483
,0x9850
,0xCC77
,0xE000
,0xC800
,0xC040
]