amebazii::conf::sysctrl

Struct SystemDataCfg

Source
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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SystemDataCfg

Source§

fn default() -> Self

Returns the default configuration for SystemDataCfg.

§Returns

A SystemDataCfg with default values.

Source§

impl<'de> Deserialize<'de> for SystemDataCfg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SystemDataCfg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryInto<SystemData> for SystemDataCfg

Source§

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: The SystemDataCfg 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();
Source§

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,