pub fn new(spi_path: &str) -> Result<UnicornHatHd, Error> {
        let mut spidev = try!(Spidev::open(spi_path));
        let options = SpidevOptions::new()
            .bits_per_word(8)
            .max_speed_hz(9_000_000)
            .mode(SPI_MODE_0)
            .build();
        try!(spidev.configure(&options));
        Ok(UnicornHatHd {
            leds: [BLACK; 256],
            spi: spidev,
            rotation: Rotate::RotNone,
        })
    }
/// 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.
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.
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 .
pub fn new(spi_path: &str) -> Result<UnicornHatHd, Error> {
        let mut spidev = try!(Spidev::open(spi_path));
        let options = SpidevOptions::new()
            .bits_per_word(8)
            .max_speed_hz(9_000_000)
            .mode(SPI_MODE_0)
            .build();
        try!(spidev.configure(&options));
        Ok(UnicornHatHd {
            leds: [BLACK; 256],
            spi: spidev,
            rotation: Rotate::RotNone,
        })
    }
pub fn new ( spi_path : & str ) -> Result < UnicornHatHd , Error > { let mut spidev = try ! ( Spidev open ( spi_path ) ) ; let options = SpidevOptions :: new ( ) . bits_per_word ( 8 ) . max_speed_hz ( 9_000_000 ) . mode ( SPI_MODE_0 ) . build ( ) ; try ! ( spidev configure ( options ) ) ; Ok ( UnicornHatHd { leds : [ BLACK ; 256 ] , spi : spidev , rotation : Rotate :: RotNone , } ) }
Create a new `UnicornHatHd` with the provided path
The Unicorn HAT HD should be addressable using the spidev
device with the provided path
Create a new ` UnicornHatHd ` with the provided path The Unicorn HAT HD should be addressable using the spidev device with the provided path
spi_path
&str
spi_path
&str