zephyr-copilot-1.0.9: Embedded programming in haskell using the Copilot stream DSL and Zephyr
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Documentation

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.

newtype Pin t 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.

Constructors

Pin Zephyr 

Instances

Instances details
IsAnalogInputPin t => Input Zephyr (Pin t) ADC Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

input' :: Pin t -> [ADC] -> GenSketch Zephyr (Behavior ADC) #

IsDigitalIOPin t => Input Zephyr (Pin t) Bool Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

input' :: Pin t -> [Bool] -> GenSketch Zephyr (Behavior Bool) #

IsPWMPin t => Output Zephyr (Pin t) (Event 'PWM (Stream Word8)) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(=:) :: Pin t -> Event 'PWM (Stream Word8) -> GenSketch Zephyr () #

IsDigitalIOPin t => Output Zephyr (Pin t) (Event () (Stream Bool)) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(=:) :: Pin t -> Event () (Stream Bool) -> GenSketch Zephyr () #

Show (Pin t) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

showsPrec :: Int -> Pin t -> ShowS #

show :: Pin t -> String #

showList :: [Pin t] -> ShowS #

Eq (Pin t) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(==) :: Pin t -> Pin t -> Bool #

(/=) :: Pin t -> Pin t -> Bool #

Ord (Pin t) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

compare :: Pin t -> Pin t -> Ordering #

(<) :: Pin t -> Pin t -> Bool #

(<=) :: Pin t -> Pin t -> Bool #

(>) :: Pin t -> Pin t -> Bool #

(>=) :: Pin t -> Pin t -> Bool #

max :: Pin t -> Pin t -> Pin t #

min :: Pin t -> Pin t -> Pin t #

data Zephyr 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.

Instances

Instances details
Show Zephyr Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Eq Zephyr Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(==) :: Zephyr -> Zephyr -> Bool #

(/=) :: Zephyr -> Zephyr -> Bool #

Ord Zephyr Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Context Zephyr Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Output Zephyr Delay MicroSeconds Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Output Zephyr Delay MilliSeconds Source # 
Instance details

Defined in Copilot.Zephyr.Internals

IsAnalogInputPin t => Input Zephyr (Pin t) ADC Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

input' :: Pin t -> [ADC] -> GenSketch Zephyr (Behavior ADC) #

IsDigitalIOPin t => Input Zephyr (Pin t) Bool Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

input' :: Pin t -> [Bool] -> GenSketch Zephyr (Behavior Bool) #

IsPWMPin t => Output Zephyr (Pin t) (Event 'PWM (Stream Word8)) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(=:) :: Pin t -> Event 'PWM (Stream Word8) -> GenSketch Zephyr () #

IsDigitalIOPin t => Output Zephyr (Pin t) (Event () (Stream Bool)) Source # 
Instance details

Defined in Copilot.Zephyr.Internals

Methods

(=:) :: Pin t -> Event () (Stream Bool) -> GenSketch Zephyr () #

newtype GPIOAlias Source #

Constructors

GPIOAlias String 

data GPIOAddress Source #

Constructors

GPIOAddress String

Eg "porta 17"

GPIOAddressBuiltIn

Use when Zephyr defines the GPIO address for a GPIOAlias.

type ADC = Int16 Source #

Value read from an ADC. Ranges from 0-1023.