Struct unicorn_hat_hd::UnicornHatHd [] [src]

pub struct UnicornHatHd { /* fields omitted */ }

Provide high-level access to the Unicorn HAT HD.

Methods

impl UnicornHatHd
[src]

[src]

Create a new UnicornHatHd with the provided path

The Unicorn HAT HD should be addressable using the spidev device with the provided path

Typically, the path will be something like "/dev/spidev0.0" where the first number if the bus and the second number is the chip select on that bus for the device being targeted.

[src]

Rotate the display buffer by Rotate degrees before sending to the Unicorn HAT HD.

This allows for different mounting orientations of the Unicorn HAT HD without having to translate the (x, y) of each pixel to account for the physical rotation of the display.

[src]

Write the display buffer to the Unicorn HAT HD.

[src]

Set an individual pixel's RGB value.

The origin ((0, 0)) is the top-left of the display, with x & y increasing to the right, and down, respectively.

[src]

Return a tuple of an individual pixel's RGB value.

The origin ((0, 0)) is the top-left of the display, with x & y increasing to the right, and down, respectively.

NOTE: This returns what's in the display buffer, not what the physical pixel is set to.

[src]

Clear the internal buffer of pixel states.

To clear the display itself, you'll still need to call display to update the Unicorn HAT HD.

Trait Implementations

impl Default for UnicornHatHd
[src]

[src]

Create a UnicornHatHd using the default path of "/dev/spidev0.0".

This will panic if the default path is not usable.