pub struct ChipFamily {
    pub name: String,
    pub manufacturer: Option<JEP106Code>,
    pub generated_from_pack: bool,
    pub pack_file_release: Option<String>,
    pub variants: Vec<Chip>,
    pub flash_algorithms: Vec<RawFlashAlgorithm>,
    pub source: TargetDescriptionSource,
}
Expand description

This describes a chip family with all its variants.

This struct is usually read from a target description file.

Fields§

§name: String

This is the name of the chip family in base form. E.g. nRF52832.

§manufacturer: Option<JEP106Code>

The JEP106 code of the manufacturer.

§generated_from_pack: bool

The target-gen process will set this to true. Please change this to false if this file is modified from the generated, or is a manually created target description.

§pack_file_release: Option<String>

The latest release of the pack file from which this was generated. Values:

  • Some("1.3.0") if the latest pack file release was for example “1.3.0”.
  • None if this was not generated from a pack file, or has been modified since it was generated.
§variants: Vec<Chip>

This vector holds all the variants of the family.

§flash_algorithms: Vec<RawFlashAlgorithm>

This vector holds all available algorithms.

§source: TargetDescriptionSource

Source of the target description, used for diagnostics

Implementations§

source§

impl ChipFamily

source

pub fn validate(&self) -> Result<(), String>

Validates the ChipFamily such that probe-rs can make assumptions about the correctness without validating thereafter.

This method should be called right after the ChipFamily is created!

source§

impl ChipFamily

source

pub fn variants(&self) -> &[Chip]

Get the different Chips which are part of this family.

source

pub fn algorithms(&self) -> &[RawFlashAlgorithm]

Get all flash algorithms for this family of chips.

source

pub fn get_algorithm(&self, name: impl AsRef<str>) -> Option<&RawFlashAlgorithm>

Try to find a RawFlashAlgorithm with a given name.

Trait Implementations§

source§

impl Clone for ChipFamily

source§

fn clone(&self) -> ChipFamily

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChipFamily

source§

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

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

impl<'de> Deserialize<'de> for ChipFamily

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 ChipFamily

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

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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>,