Struct trellis::core::Trellis [] [src]

pub struct Trellis { /* fields omitted */ }

The Trellis device abstraction.

Methods

impl Trellis
[src]

Construct a new Trellis device with a particular I2C-Device. See the devices module for a list of concrete devices that can be used. Note: object has to be initialised with a call to init before you can control the LEDs and buttons.

Initialise the trellis connection. Has to be called exactly once for a trellis.

Turn a LED on the specified position to on.

Turn a LED on the specified position to off.

Returns the LED state (on or off) from the internal display buffer. The state may not reflect the actual state on the hardware if the display buffer was not written.

Writes the internal display buffer to the hardware. You must call this function manually after updating the LED states of the trellis.

Start the button read event loop. This function does not terminate and can only be stopped by the supplied event handler returning false. The polling interval for reading the button is currently fixed to 30ms.