kansas-lava-cores-0.1.2.2: FPGA Cores Written in Kansas Lava.

Safe HaskellNone
LanguageHaskell2010

Hardware.KansasLava.Simulators.Spartan3e

Description

This API mirrors Spartan3e via a class abstaction. The other API also contains some Board specific utilties that can also be used for simulation.

Documentation

class MonadFix fabric => Spartan3e fabric where Source

Methods

board_init :: fabric () Source

board_init sets up the use of the clock. Always call board_init first. [Required].

rot_as_reset :: fabric () Source

rot_as_reset sets up the rotary dial as a reset switch.

mm_lcdP :: FabricPatch fabric (Seq (Enabled ((X2, X16), U8))) () (Seq Ack) () Source

mm_lcdP gives a memory mappped (mm) API to the LCD. Disables the StrataFlash (for now).

rs232_txP Source

Arguments

:: Serial

port

-> Integer

baud rate

-> FabricPatch fabric (Seq (Enabled U8)) () (Seq Ack) () 

rs232_txP gives a patch level API for transmission of bytes over one of the serial links.

rs232_rxP Source

Arguments

:: Serial

port

-> Integer

baud rate

-> FabricPatch fabric () (Seq (Enabled U8)) () () 

rs232_rxP gives a patch level API for reception of bytes over one of the serial links. Note there is no hand-shaking because the (implied) UART does no buffering; you better be ready.

tickTock :: Size w => Witness w -> Integer -> fabric (Seq Bool) Source

tickTock generates n pulses per second, based on the expected simulation, or clockrate on the board. The purpose is for controlling real-time sampling, or for animations.

switches :: fabric (Matrix X4 (Seq Bool)) Source

switches gives raw access to the position of the toggle switches.

buttons :: fabric (Matrix X4 (Seq Bool)) Source

buttons gives raw access to the state of the buttons.

leds :: Matrix X8 (Seq Bool) -> fabric () Source

leds drives the leds

dial_button :: fabric (Seq Bool) Source

dial_button gives raw access to the state of the dial button

dial_rot :: fabric (Seq (Enabled Bool)) Source

dial_rot gives Enabled packets when dial is rotated, and if the rotation was clockwise

Instances

Spartan3e Fabric 
Spartan3e Polyester

board_init sets up the use of the clock. Always call board_init first. Required.

class Graphic g where Source

Methods

drawGraphic :: g -> ANSI () Source

Instances

Graphic (ANSI a)

Rather than use a data-structure for each action, ANSI can be used instead. Not recommended, but harmless.