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: ForceOldImage
Configuration for the old image trap, typically used to control whether an old image is forced into memory.
spi_cfg: SpiConfig
Configuration of the SPI interface, including IO mode and speed.
flash_info: FlashInfo
Information 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
: TheSystemDataCfg
instance 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();