Safe Haskell | None |
---|---|
Language | Haskell2010 |
Copilot.Zephyr.Internals
Description
You should not need to import this module unless you're adding support for a specific board supported by Zephyr, or a Zephyr library.
Synopsis
- type ADC = Int16
- data GPIOAddress
- newtype GPIOAlias = GPIOAlias String
- data Zephyr = Zephyr GPIOAlias GPIOAddress
- newtype Pin t = Pin Zephyr
- type Framework = GenFramework Zephyr
- type Sketch = GenSketch Zephyr
- pinDevVar :: String -> String
- pinDevDef :: String -> String
- pinDevNode :: String -> String
- module Sketch.FRP.Copilot.Internals
- module Sketch.FRP.Copilot.Types
- module Sketch.FRP.Copilot
Documentation
data GPIOAddress Source #
Constructors
GPIOAddress String | Eg "porta 17" |
GPIOAddressBuiltIn | Use when Zephyr defines the GPIO address for a GPIOAlias. |
Instances
Eq GPIOAddress Source # | |
Defined in Copilot.Zephyr.Internals | |
Ord GPIOAddress Source # | |
Defined in Copilot.Zephyr.Internals Methods compare :: GPIOAddress -> GPIOAddress -> Ordering # (<) :: GPIOAddress -> GPIOAddress -> Bool # (<=) :: GPIOAddress -> GPIOAddress -> Bool # (>) :: GPIOAddress -> GPIOAddress -> Bool # (>=) :: GPIOAddress -> GPIOAddress -> Bool # max :: GPIOAddress -> GPIOAddress -> GPIOAddress # min :: GPIOAddress -> GPIOAddress -> GPIOAddress # | |
Show GPIOAddress Source # | |
Defined in Copilot.Zephyr.Internals Methods showsPrec :: Int -> GPIOAddress -> ShowS # show :: GPIOAddress -> String # showList :: [GPIOAddress] -> ShowS # |
Instances
Eq GPIOAlias Source # | |
Ord GPIOAlias Source # | |
Show GPIOAlias Source # | |
Indicates that you're programming a board with Zephyr. The similar library arduino-copilot allows programming Arduinos in a very similar style to this one.
Constructors
Zephyr GPIOAlias GPIOAddress |
Instances
Eq Zephyr Source # | |
Ord Zephyr Source # | |
Show Zephyr Source # | |
Context Zephyr Source # | |
Defined in Copilot.Zephyr.Internals | |
Output Zephyr Delay MilliSeconds Source # | |
Defined in Copilot.Zephyr.Internals | |
Output Zephyr Delay MicroSeconds Source # | |
Defined in Copilot.Zephyr.Internals | |
IsAnalogInputPin t => Input Zephyr (Pin t) ADC Source # | |
IsDigitalIOPin t => Input Zephyr (Pin t) Bool Source # | |
IsPWMPin t => Output Zephyr (Pin t) (Event 'PWM (Stream Word8)) Source # | |
IsDigitalIOPin t => Output Zephyr (Pin t) (Event () (Stream Bool)) Source # | |
A pin on the board.
For definitions of specific pins, load a module which provides the pins of a particular board.
A type-level list indicates how a Pin can be used, so the haskell compiler will detect impossible uses of pins.
Instances
IsAnalogInputPin t => Input Zephyr (Pin t) ADC Source # | |
IsDigitalIOPin t => Input Zephyr (Pin t) Bool Source # | |
IsPWMPin t => Output Zephyr (Pin t) (Event 'PWM (Stream Word8)) Source # | |
IsDigitalIOPin t => Output Zephyr (Pin t) (Event () (Stream Bool)) Source # | |
Eq (Pin t) Source # | |
Ord (Pin t) Source # | |
Show (Pin t) Source # | |
type Framework = GenFramework Zephyr Source #
The framework of a sketch.
type Sketch = GenSketch Zephyr Source #
A sketch, implemented using Copilot.
It's best to think of the Sketch
as a description of the state of the
board at any point in time.
Under the hood, the Sketch
is run in a loop. On each iteration, it first
reads inputs and then updates outputs as needed.
While it is a monad, a Sketch's outputs are not updated in any particular order, because Copilot does not guarantee any order.
pinDevNode :: String -> String Source #
module Sketch.FRP.Copilot.Internals
module Sketch.FRP.Copilot.Types
module Sketch.FRP.Copilot