Lambdaya - Haskell library

Discussions about active development projects
Post Reply
Posts: 8
Joined: Wed Jul 08, 2015 8:02 am

Lambdaya - Haskell library

Post by ralu » Tue Jan 05, 2016 6:22 pm

Instead of running only C and C++ this project enables running and controlling RP using Haskell.
It enables actually both. Trough unified interface one can control RP natively using ghc crosscopmiler or remotely over TCP/IP.

Quick start:
(should work any OS)
1. Install ghc and cabal or haskell-platform.
2. Install lambdaya using cabal

Code: Select all

cabal update
cabal install lambdaya
3. make file client.hs with such code

Code: Select all

import System.RedPitaya.Fpga
import System.RedPitaya.Tcp

rpIp = "" -- fix for ip for RP
rpPort = 4242

main = runRemoteRp rpIp rpPort (setLed 0x55)
4. Compile file using ghc

Code: Select all

ghc -O2 client.hs 
Before running client we need server to run on RP. There is pre compiled binary available if you dont have GHC crosscompiler

5. Download ... r?raw=true on RP and run.

6. Run client you have compiled on PC and stare in Leds.

There is also some notes on how to crosscompile GHC on github. ... c/ in case you want running binaries natively, or extend communication protocol for example.

Currently supported features:
  • Documentaion and tutorial available from hackage
  • Native and remote controlling.
  • Functions for acesssing Houskeeping, Oscilloscope ans ASG registers in Fpga are available and also documented. (doc can be accessed from hackage page)
  • Testing
  • PID, ASM, Daisy chain, Power test controlling functions
  • World domination
Last edited by ralu on Wed Jan 06, 2016 7:02 pm, edited 1 time in total.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Lambdaya - Haskell library

Post by Nils Roos » Wed Jan 06, 2016 12:18 pm

Wellwellwell, functional programming comes to the Red Lambdaya. Nice effort !

You should probably put a note somewhere that the pre-compiled server binary is for the 'old' ecosystems <= 0.93 and/or prepare instructions and executables for the new one (hard-float architecture), too.

I'd also like to see a roadmap for the last deliverable ... :mrgreen:

Posts: 8
Joined: Wed Jul 08, 2015 8:02 am

Re: Lambdaya - Haskell library

Post by ralu » Wed Jan 06, 2016 2:54 pm

I think that there is only issue with pre compiled server binaries for arm.

I guess I will need either different cross compiler or just link against different lib.
Can someone tells me what gcc and libraries I need for cross-compilation and I can rebuild ghc and server binary for latest platform.

Last change on ... oper_Guide seems to be from sept 2014 and I am not sure they are relevant.

Posts: 8
Joined: Wed Jul 08, 2015 8:02 am

Re: Lambdaya - Haskell library

Post by ralu » Thu Jan 07, 2016 6:07 pm

I was able to recompile ghc with gcc-arm-linux-gnueabihf toolchain and then compiled bin/server.hs with arm-unknown-linux-gnueabihf-ghc.
Now both pre-compiled binaries for RP are available in bin folder and server works with latest - red_pitaya_OS_v0.94-RC23_29-Dec-2015.img

I hope someone will have some fun with it.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 2 guests