pub struct Trellis { /* private fields */ }
Expand description
The Trellis device abstraction.
Implementations§
Source§impl Trellis
impl Trellis
Sourcepub fn new(dev: Box<dyn I2CMasterDevice>) -> Trellis
pub fn new(dev: Box<dyn 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.
Sourcepub fn init(&mut self)
pub fn init(&mut self)
Initialise the trellis connection. Has to be called exactly once for a trellis.
Sourcepub fn is_led_set(&mut self, col: Col, row: Row) -> bool
pub 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.
Sourcepub fn write_display(&mut self)
pub 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.
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.