Copyright | (C) 2006 Evan Martin <martine@danga.com> (C) 2017 Patrick Pelletier <code@funwithsoftware.org> |
---|---|
License | MIT |
Maintainer | Patrick Pelletier <code@funwithsoftware.org> |
Stability | experimental |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
This module is for interfacing the Griffin PowerMate USB (a big silver knob you can turn and click) with Haskell. You can read events from the PowerMate, and control the brightness, pulse speed, and pulse waveform of the built-in blue LED.
- data PowerMate
- data Event
- data Status = Status {
- brightness :: Int
- pulse_speed :: Int
- pulse_mode :: Int
- pulse_asleep :: Bool
- pulse_awake :: Bool
- statusInit :: Status
- searchForDevice :: IO (Maybe FilePath)
- openDevice :: FilePath -> IO PowerMate
- readEvent :: PowerMate -> IO Event
- writeStatus :: PowerMate -> Status -> IO ()
- closeDevice :: PowerMate -> IO ()
Types
Represents a PowerMate USB controller.
An event returned by the PowerMate USB.
Represents the status of the blue LED.
Status | |
|
statusInit :: Status Source #
A Status
initialized to default values.
(Specifically, all zero.)
Using the PowerMate
searchForDevice :: IO (Maybe FilePath) Source #
Returns the name of the device file associated with the
Griffin PowerMate USB, or Nothing
if no PowerMate can be found.
openDevice :: FilePath -> IO PowerMate Source #
Given the name of the device file for the PowerMate USB,
opens it and returns a PowerMate
.