powermate-1.0: bindings for Griffin PowerMate USB

Copyright(C) 2006 Evan Martin <martine@danga.com>
(C) 2017 Patrick Pelletier <code@funwithsoftware.org>
LicenseMIT
MaintainerPatrick Pelletier <code@funwithsoftware.org>
Stabilityexperimental
PortabilityLinux
Safe HaskellNone
LanguageHaskell2010

PowerMate

Contents

Description

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.

Synopsis

Types

data PowerMate Source #

Represents a PowerMate USB controller.

data Event Source #

An event returned by the PowerMate USB.

Constructors

Button Bool

True = press, False = release

Rotate Int

Positive is clockwise, negative is counterclockwise

StatusChange Status

When you change the LED status, it is echoed back to you for some reason

data Status Source #

Represents the status of the blue LED.

Constructors

Status 

Fields

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.

readEvent :: PowerMate -> IO Event Source #

Block until the PowerMate USB controller generates an event, and then return that event.

writeStatus :: PowerMate -> Status -> IO () Source #

Control the blue LED on the PowerMate USB.