pub trait DeviceTypes: Send + Sync + Sized + 'static {
    type CellSelection: ToCommandBitmap + ToCommandTiming + RegisterLocator<Self> + Copy + Clone + Send + Sync;
    type GPIOSelection: ToCommandBitmap + ToCommandTiming + RegisterLocator<Self> + Copy + Clone + Send + Sync;
    type Register: ToFullCommand + GroupedRegisterIndex + Copy + Clone + Send + Sync;
    type Channel: ChannelIndex + Into<ChannelType> + Copy + Clone + Send + Sync;

    const CELL_COUNT: usize;
    const GPIO_COUNT: usize;
    const OVERLAP_TEST_REG_1: Option<Self::Register>;
    const OVERLAP_TEST_REG_2: Option<Self::Register>;
    const REG_STATUS_A: Self::Register;
    const REG_STATUS_B: Self::Register;
    const REG_CONF_A: Self::Register;
    const REG_CONF_B: Option<Self::Register>;
}
Expand description

Device specific types

Required Associated Types§

source

type CellSelection: ToCommandBitmap + ToCommandTiming + RegisterLocator<Self> + Copy + Clone + Send + Sync

Argument for the identification of cell groups, which depends on the exact device type.

source

type GPIOSelection: ToCommandBitmap + ToCommandTiming + RegisterLocator<Self> + Copy + Clone + Send + Sync

Argument for the identification of GPIO groups, which depends on the exact device type.

source

type Register: ToFullCommand + GroupedRegisterIndex + Copy + Clone + Send + Sync

Argument for register selection. The available registers depend on the device.

source

type Channel: ChannelIndex + Into<ChannelType> + Copy + Clone + Send + Sync

Available cells and GPIOs

Required Associated Constants§

source

const CELL_COUNT: usize

Number of battery cells supported by the device

source

const GPIO_COUNT: usize

Number of GPIO channels

source

const OVERLAP_TEST_REG_1: Option<Self::Register>

Defines the first register storing the results of overlap measurement. None in case overlap test is not supported.

source

const OVERLAP_TEST_REG_2: Option<Self::Register>

Defines the second register storing the results of overlap measurement. None in case just one cell is ued for overlap test or if test is no supported at all.

source

const REG_STATUS_A: Self::Register

Status group A register

source

const REG_STATUS_B: Self::Register

Status group b register

source

const REG_CONF_A: Self::Register

Configuration register A

source

const REG_CONF_B: Option<Self::Register>

Configuration register B, None in case device type has no second configuration register

Object Safety§

This trait is not object safe.

Implementors§

source§

impl DeviceTypes for LTC6810

§

type CellSelection = CellSelection

§

type GPIOSelection = GPIOSelection

§

type Register = Register

§

type Channel = Channel

source§

const CELL_COUNT: usize = 6usize

source§

const GPIO_COUNT: usize = 4usize

source§

const OVERLAP_TEST_REG_1: Option<Self::Register> = None

source§

const OVERLAP_TEST_REG_2: Option<Self::Register> = None

source§

const REG_STATUS_A: Self::Register = {transmute(0x04): <ltc6810::LTC6810 as monitor::DeviceTypes>::Register}

source§

const REG_STATUS_B: Self::Register = {transmute(0x05): <ltc6810::LTC6810 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_A: Self::Register = {transmute(0x06): <ltc6810::LTC6810 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_B: Option<Self::Register> = None

source§

impl DeviceTypes for LTC6811

§

type CellSelection = CellSelection

§

type GPIOSelection = GPIOSelection

§

type Register = Register

§

type Channel = Channel

source§

const CELL_COUNT: usize = 12usize

source§

const GPIO_COUNT: usize = 5usize

source§

const OVERLAP_TEST_REG_1: Option<Self::Register> = _

source§

const OVERLAP_TEST_REG_2: Option<Self::Register> = None

source§

const REG_STATUS_A: Self::Register = {transmute(0x06): <ltc6811::LTC6811 as monitor::DeviceTypes>::Register}

source§

const REG_STATUS_B: Self::Register = {transmute(0x07): <ltc6811::LTC6811 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_A: Self::Register = {transmute(0x08): <ltc6811::LTC6811 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_B: Option<Self::Register> = _

source§

impl DeviceTypes for LTC6812

§

type CellSelection = CellSelection

§

type GPIOSelection = GPIOSelection

§

type Register = Register

§

type Channel = Channel

source§

const CELL_COUNT: usize = 15usize

source§

const GPIO_COUNT: usize = 9usize

source§

const OVERLAP_TEST_REG_1: Option<Self::Register> = _

source§

const OVERLAP_TEST_REG_2: Option<Self::Register> = _

source§

const REG_STATUS_A: Self::Register = {transmute(0x09): <ltc6812::LTC6812 as monitor::DeviceTypes>::Register}

source§

const REG_STATUS_B: Self::Register = {transmute(0x0a): <ltc6812::LTC6812 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_A: Self::Register = {transmute(0x0b): <ltc6812::LTC6812 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_B: Option<Self::Register> = _

source§

impl DeviceTypes for LTC6813

§

type CellSelection = CellSelection

§

type GPIOSelection = GPIOSelection

§

type Register = Register

§

type Channel = Channel

source§

const CELL_COUNT: usize = 18usize

source§

const GPIO_COUNT: usize = 9usize

source§

const OVERLAP_TEST_REG_1: Option<Self::Register> = _

source§

const OVERLAP_TEST_REG_2: Option<Self::Register> = _

source§

const REG_STATUS_A: Self::Register = {transmute(0x0a): <ltc6813::LTC6813 as monitor::DeviceTypes>::Register}

source§

const REG_STATUS_B: Self::Register = {transmute(0x0b): <ltc6813::LTC6813 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_A: Self::Register = {transmute(0x0c): <ltc6813::LTC6813 as monitor::DeviceTypes>::Register}

source§

const REG_CONF_B: Option<Self::Register> = _