pub struct SystemDataCfg {
pub ota2_addr: Option<u32>,
pub ota2_size: Option<u32>,
pub old_img_trap: ForceOldImage,
pub spi_cfg: SpiConfig,
pub flash_info: FlashInfo,
pub ulog_baud: Option<u32>,
pub spic_calibcfg: Option<DataArray<0x30>>,
pub bt_parameter_data: Option<DataArray<0x20>>,
}Expand description
Configuration for the system data, containing options for various system parameters.
Fields§
§ota2_addr: Option<u32>The address of the second OTA partition, if available.
ota2_size: Option<u32>The size of the second OTA partition, if available.
old_img_trap: ForceOldImageConfiguration for the old image trap, typically used to control whether an old image is forced into memory.
spi_cfg: SpiConfigConfiguration of the SPI interface, including IO mode and speed.
flash_info: FlashInfoInformation related to the flash memory (e.g., flash ID, size).
ulog_baud: Option<u32>Baud rate for the UART logging interface.
spic_calibcfg: Option<DataArray<0x30>>SPI calibration configuration, stored as raw data.
bt_parameter_data: Option<DataArray<0x20>>Bluetooth parameter data, stored as raw data.
Trait Implementations§
Source§impl Debug for SystemDataCfg
impl Debug for SystemDataCfg
Source§impl Default for SystemDataCfg
impl Default for SystemDataCfg
Source§impl<'de> Deserialize<'de> for SystemDataCfg
impl<'de> Deserialize<'de> for SystemDataCfg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SystemDataCfg
impl Serialize for SystemDataCfg
Source§impl TryInto<SystemData> for SystemDataCfg
impl TryInto<SystemData> for SystemDataCfg
Source§fn try_into(self) -> Result<SystemData, Self::Error>
fn try_into(self) -> Result<SystemData, Self::Error>
Tries to convert SystemDataCfg into a SystemData instance.
This method attempts to convert the configuration (SystemDataCfg) into a complete
SystemData object. It populates the SystemData fields based on the values in the
configuration struct, ensuring that required fields are filled, and default values are used
where no data is provided.
§Parameters
self: TheSystemDataCfginstance to be converted.
§Returns
A Result<SystemData, Error>:
Ok(SystemData): The conversion succeeded, and the data is populated.Err(Error): An error occurred during conversion, for example, invalid data during conversion (e.g., when trying to convert data that doesn’t fit the expected type).
§Example
let config = SystemDataCfg::default();
let sysdata: SystemData = config.try_into().unwrap();Auto Trait Implementations§
impl Freeze for SystemDataCfg
impl RefUnwindSafe for SystemDataCfg
impl Send for SystemDataCfg
impl Sync for SystemDataCfg
impl Unpin for SystemDataCfg
impl UnwindSafe for SystemDataCfg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more