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

pub struct Trellis {
    // some fields omitted
}

The Trellis device abstraction.

Methods

impl Trellis
[src]

fn new(dev: Box<I2CMasterDevice>) -> Trellis

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.

fn init(&mut self)

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

fn set_led(&mut self, col: Col, row: Row)

Turn a LED on the specified position to on.

fn clear_led(&mut self, col: Col, row: Row)

Turn a LED on the specified position to off.

fn is_led_set(&mut self, col: Col, row: Row) -> bool

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.

fn write_display(&mut self)

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

fn button_evt_loop(&mut self, hnd: EventLoopHandler)

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.