Struct bluerobotics_ping::bluebps::Device
source · pub struct Device {
pub common: Common,
}Fields§
§common: CommonImplementations§
source§impl Device
impl Device
pub fn new<T>(io: T) -> Self
sourcepub async fn current_max(&self) -> Result<CurrentMaxStruct, PingError>
pub async fn current_max(&self) -> Result<CurrentMaxStruct, PingError>
get the maximum allowed battery current
sourcepub async fn set_temperature_max(&self, limit: u16) -> Result<(), PingError>
pub async fn set_temperature_max(&self, limit: u16) -> Result<(), PingError>
Set the maximum allowed battery temperature
§Arguments
limit[centidegrees Centigrade] - The maximum temperature allowed at the thermistor probe installed on the battery. 0~5000: 0~5V
sourcepub async fn temperature_max(&self) -> Result<TemperatureMaxStruct, PingError>
pub async fn temperature_max(&self) -> Result<TemperatureMaxStruct, PingError>
Get the maximum allowed battery temperature
sourcepub async fn set_current_max(&self, limit: u16) -> Result<(), PingError>
pub async fn set_current_max(&self, limit: u16) -> Result<(), PingError>
Set the maximum allowed battery current
§Arguments
limit[centiampere] - The maximum allowed battery current 0~20000 = 0~200A
sourcepub async fn cell_voltage_min(&self) -> Result<CellVoltageMinStruct, PingError>
pub async fn cell_voltage_min(&self) -> Result<CellVoltageMinStruct, PingError>
Get the minimum allowed cell voltage
sourcepub async fn events(&self) -> Result<EventsStruct, PingError>
pub async fn events(&self) -> Result<EventsStruct, PingError>
A record of events causing a power lock-out. These numbers are non-volatile and reset only with the erase_flash control message.
sourcepub async fn set_lpf_sample_frequency(
&self,
sample_frequency: u32
) -> Result<(), PingError>
pub async fn set_lpf_sample_frequency( &self, sample_frequency: u32 ) -> Result<(), PingError>
the frequency to take adc samples and run the filter.
§Arguments
sample_frequency- sample frequency in Hz. 1~100000
sourcepub async fn set_stream_rate(&self, rate: u32) -> Result<(), PingError>
pub async fn set_stream_rate(&self, rate: u32) -> Result<(), PingError>
Set the frequency to automatically output state messages.
§Arguments
rate[Hz] - Rate to streamstatemessages. 0~100000Hz
sourcepub async fn state(&self) -> Result<StateStruct, PingError>
pub async fn state(&self) -> Result<StateStruct, PingError>
Get the current state of the device
sourcepub async fn cell_timeout(&self) -> Result<CellTimeoutStruct, PingError>
pub async fn cell_timeout(&self) -> Result<CellTimeoutStruct, PingError>
Get the undervoltage timeout
sourcepub async fn current_timeout(&self) -> Result<CurrentTimeoutStruct, PingError>
pub async fn current_timeout(&self) -> Result<CurrentTimeoutStruct, PingError>
Get the over-current timeout
sourcepub async fn temperature_timeout(
&self
) -> Result<TemperatureTimeoutStruct, PingError>
pub async fn temperature_timeout( &self ) -> Result<TemperatureTimeoutStruct, PingError>
Get the over-temperature timeout
sourcepub async fn reset_defaults(&self) -> Result<(), PingError>
pub async fn reset_defaults(&self) -> Result<(), PingError>
Reset parameter configuration to default values.
§Arguments
sourcepub async fn erase_flash(&self) -> Result<(), PingError>
pub async fn erase_flash(&self) -> Result<(), PingError>
Erase flash, including parameter configuration and event counters. The mcu has a limited number of write/erase cycles (1k)!
§Arguments
sourcepub async fn set_temperature_timeout(
&self,
timeout: u16
) -> Result<(), PingError>
pub async fn set_temperature_timeout( &self, timeout: u16 ) -> Result<(), PingError>
Set the over-temperature timeout
§Arguments
timeout[millisecond] - If the battery temperature exceeds the configured limit for this duration of time, the power will be locked-out
sourcepub async fn reboot(&self, goto_bootloader: u8) -> Result<(), PingError>
pub async fn reboot(&self, goto_bootloader: u8) -> Result<(), PingError>
reboot the system
§Arguments
goto_bootloader- 0 = normal reboot, run main application after reboot 1 = hold the device in bootloader after reboot
sourcepub async fn set_lpf_setting(&self, setting: u16) -> Result<(), PingError>
pub async fn set_lpf_setting(&self, setting: u16) -> Result<(), PingError>
Low pass filter setting. This value represents x in the equation value = value * x + sample * (1-x). 0.0 = no filtering, 0.99 = heavy filtering.
§Arguments
setting- 0~999: x = 0~0.999
sourcepub async fn set_cell_voltage_timeout(
&self,
timeout: u16
) -> Result<(), PingError>
pub async fn set_cell_voltage_timeout( &self, timeout: u16 ) -> Result<(), PingError>
Set the under-voltage timeout
§Arguments
timeout[millisecond] - If an individual cell exceeds the configured limit for this duration of time, the power will be locked-out