Trait ltc681x::monitor::LTC681XClient
source · pub trait LTC681XClient<T: DeviceTypes, const L: usize> {
type Error;
// Required methods
fn start_conv_cells(
&mut self,
mode: ADCMode,
cells: T::CellSelection,
dcp: bool
) -> Result<CommandTime, Self::Error>;
fn start_conv_gpio(
&mut self,
mode: ADCMode,
pins: T::GPIOSelection
) -> Result<CommandTime, Self::Error>;
fn start_overlap_measurement(
&mut self,
mode: ADCMode,
dcp: bool
) -> Result<(), Self::Error>;
fn measure_internal_parameters(
&mut self,
mode: ADCMode,
group: StatusGroup
) -> Result<CommandTime, Self::Error>;
fn read_register(
&mut self,
register: T::Register
) -> Result<[[u16; 3]; L], Self::Error>;
fn write_register(
&mut self,
register: T::Register,
data: [[u8; 6]; L]
) -> Result<(), Self::Error>;
fn write_configuration(
&mut self,
config: [Configuration; L]
) -> Result<(), Self::Error>;
fn read_voltages<R: RegisterLocator<T> + 'static>(
&mut self,
locator: R
) -> Result<Vec<Vec<Voltage<T>, 18>, L>, Self::Error>
where T: 'static;
fn read_overlap_result(&mut self) -> Result<[[u16; 4]; L], Self::Error>;
fn read_internal_device_parameters(
&mut self
) -> Result<Vec<InternalDeviceParameters, L>, Self::Error>;
}
Expand description
Public LTC681X client interface
L: Number of LTC681X devices in daisy chain
Required Associated Types§
Required Methods§
sourcefn start_conv_cells(
&mut self,
mode: ADCMode,
cells: T::CellSelection,
dcp: bool
) -> Result<CommandTime, Self::Error>
fn start_conv_cells( &mut self, mode: ADCMode, cells: T::CellSelection, dcp: bool ) -> Result<CommandTime, Self::Error>
Starts ADC conversion of cell voltages
§Arguments
mode
: ADC modecells
: Measures the given cell groupdcp
: True if discharge is permitted during conversion
sourcefn start_conv_gpio(
&mut self,
mode: ADCMode,
pins: T::GPIOSelection
) -> Result<CommandTime, Self::Error>
fn start_conv_gpio( &mut self, mode: ADCMode, pins: T::GPIOSelection ) -> Result<CommandTime, Self::Error>
sourcefn start_overlap_measurement(
&mut self,
mode: ADCMode,
dcp: bool
) -> Result<(), Self::Error>
fn start_overlap_measurement( &mut self, mode: ADCMode, dcp: bool ) -> Result<(), Self::Error>
Start the Overlap Measurements (ADOL command) Note: This command is not available on LTC6810, as this device only includes one ADC
§Arguments
mode
: ADC modedcp
: True if discharge is permitted during conversion
sourcefn measure_internal_parameters(
&mut self,
mode: ADCMode,
group: StatusGroup
) -> Result<CommandTime, Self::Error>
fn measure_internal_parameters( &mut self, mode: ADCMode, group: StatusGroup ) -> Result<CommandTime, Self::Error>
Starts measuring internal device parameters (ADSTAT command)
§Arguments
mode
: ADC modegroup
: Selection of status parameter to measure
sourcefn read_register(
&mut self,
register: T::Register
) -> Result<[[u16; 3]; L], Self::Error>
fn read_register( &mut self, register: T::Register ) -> Result<[[u16; 3]; L], Self::Error>
Reads the values of the given register Returns one array for each device in daisy chain
sourcefn write_register(
&mut self,
register: T::Register,
data: [[u8; 6]; L]
) -> Result<(), Self::Error>
fn write_register( &mut self, register: T::Register, data: [[u8; 6]; L] ) -> Result<(), Self::Error>
Writes the values of the given register One 3-bytes array per device in daisy chain
sourcefn write_configuration(
&mut self,
config: [Configuration; L]
) -> Result<(), Self::Error>
fn write_configuration( &mut self, config: [Configuration; L] ) -> Result<(), Self::Error>
Writes the configuration, one array item per device in daisy chain
sourcefn read_voltages<R: RegisterLocator<T> + 'static>(
&mut self,
locator: R
) -> Result<Vec<Vec<Voltage<T>, 18>, L>, Self::Error>where
T: 'static,
fn read_voltages<R: RegisterLocator<T> + 'static>(
&mut self,
locator: R
) -> Result<Vec<Vec<Voltage<T>, 18>, L>, Self::Error>where
T: 'static,
Reads and returns the conversion result (voltages) of Cell or GPIO group Returns one vector for each device in daisy chain
Vector needs to have a fixed capacity until feature generic_const_exprs is stable
sourcefn read_overlap_result(&mut self) -> Result<[[u16; 4]; L], Self::Error>
fn read_overlap_result(&mut self) -> Result<[[u16; 4]; L], Self::Error>
Reads and returns the results of the overlap measurement
Index 0: Result of ADC A of first cell* Index 1: Result of ADC B of first cell* Index 2: Result of ADC A of second cell* Index 3: Result of ADC B of second cell*
- Number of cells depends on the device type, otherwise 0 value is used
sourcefn read_internal_device_parameters(
&mut self
) -> Result<Vec<InternalDeviceParameters, L>, Self::Error>
fn read_internal_device_parameters( &mut self ) -> Result<Vec<InternalDeviceParameters, L>, Self::Error>
Reads internal device parameters measured by ATOL command Returns one array item for each device in daisy chain