Skip to main content

async_ltc681x/device/
error.rs

1use crate::driver::Driver;
2/// Combines the [`DeviceErrorKind`] with the `device_index` to identify in a daisy chain case where the Error occured
3#[derive(Debug, Copy, Clone)]
4pub struct DeviceErrorInfo {
5    pub err: DeviceErrorKind,
6    pub device_index: usize,
7}
8/// Error enumeration for the `LTC681x` failure modes
9#[derive(Debug, Copy, Clone)]
10pub enum DeviceErrorKind {
11    Overlap,
12    AccuracyFailed,
13}
14/// Combines the `LTC681x` failures with the [`Ltc681x Driver`](crate::driver::Driver) Errors
15#[derive(Debug, Copy, Clone)]
16pub enum Error<DRIVER: Driver> {
17    DeviceError(DeviceErrorInfo),
18    DriverError(DRIVER::ErrorType),
19}