iowarrior_embedded_hal/digital/
pin_setup_error.rs

1use crate::iowarrior::Peripheral;
2use hidapi::HidError;
3use thiserror::Error;
4
5#[non_exhaustive]
6#[derive(Error, Debug)]
7pub enum PinSetupError {
8    #[error("USB HID error.")]
9    ErrorUSB(HidError),
10    #[error("Pin not existing.")]
11    PinNotExisting,
12    #[error("Pin already configured.")]
13    AlreadySetup,
14    #[error("Pin is blocked by peripheral {0}.")]
15    BlockedByPeripheral(Peripheral),
16    #[error("Pins are not supported by hardware.")]
17    NotSupported,
18}