mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-04 06:16:42 +00:00
Update to new error type from eh 1.0a6
This commit is contained in:
@@ -7,12 +7,15 @@ use linux_embedded_hal::{
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use linux_embedded_hal::SPIError;
|
||||
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
|
||||
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
|
||||
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
|
||||
// Configure SPI
|
||||
// SPI settings are from eink-waveshare-rs documenation
|
||||
let mut spi = Spidev::open("/dev/spidev0.0")?;
|
||||
|
||||
@@ -18,12 +18,15 @@ use linux_embedded_hal::{
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use linux_embedded_hal::SPIError;
|
||||
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
|
||||
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
|
||||
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
||||
@@ -18,6 +18,9 @@ use linux_embedded_hal::{
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use linux_embedded_hal::SPIError;
|
||||
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
|
||||
@@ -34,7 +37,7 @@ use linux_embedded_hal::{
|
||||
//
|
||||
// after finishing, put the display to sleep
|
||||
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
|
||||
let busy = Pin::new(24); // GPIO 24, board J-18
|
||||
busy.export().expect("busy export");
|
||||
while !busy.is_exported() {}
|
||||
|
||||
+3
-1
@@ -18,12 +18,14 @@ use linux_embedded_hal::{
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use linux_embedded_hal::SPIError;
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
|
||||
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
|
||||
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
||||
@@ -19,12 +19,16 @@ use linux_embedded_hal::{
|
||||
sysfs_gpio::Direction,
|
||||
Delay, Spidev, SysfsPin as Pin,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use linux_embedded_hal::SPIError;
|
||||
|
||||
|
||||
|
||||
// activate spi, gpio in raspi-config
|
||||
// needs to be run with sudo because of some sysfs_gpio permission problems and follow-up timing problems
|
||||
// see https://github.com/rust-embedded/rust-sysfs-gpio/issues/5 and follow-up issues
|
||||
|
||||
fn main() -> Result<(), linux_embedded_hal::SPIError> {
|
||||
fn main() -> Result<(), epd_waveshare::Error<SPIError, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, linux_embedded_hal::sysfs_gpio::Error, Infallible>> {
|
||||
// Configure SPI
|
||||
// Settings are taken from
|
||||
let mut spi = Spidev::open("/dev/spidev0.0").expect("spidev directory");
|
||||
|
||||
Reference in New Issue
Block a user