Address

Enum Address 

Source
#[repr(u8)]
pub enum Address {
Show 24 variants Gconf = 0, Gstat = 1, Ifcnt = 2, Slaveconf = 3, OtpProg = 4, OtpRead = 5, Ioin = 6, FactoryConf = 7, IholdIrun = 16, Tpowerdown = 17, Tstep = 18, Tpwmthrs = 19, Tcoolthrs = 20, Vactual = 34, Sgthrs = 64, SgResult = 65, Coolconf = 66, Mscnt = 106, Mscuract = 107, Chopconf = 108, DrvStatus = 111, Pwmconf = 112, PwmScale = 113, PwmAuto = 114,
}
Expand description

TMC2209 register addresses.

All registers in the TMC2209 and their 7-bit addresses.

Variants§

§

Gconf = 0

Global configuration (0x00) - RW

§

Gstat = 1

Global status flags (0x01) - R+WC

§

Ifcnt = 2

Interface transmission counter (0x02) - R

§

Slaveconf = 3

UART slave configuration (0x03) - W

§

OtpProg = 4

OTP programming (0x04) - W

§

OtpRead = 5

OTP memory read (0x05) - R

§

Ioin = 6

Input pin states (0x06) - R

§

FactoryConf = 7

Factory configuration (0x07) - RW

§

IholdIrun = 16

Hold/run current (0x10) - W

§

Tpowerdown = 17

Power down delay (0x11) - W

§

Tstep = 18

Measured step time (0x12) - R

§

Tpwmthrs = 19

StealthChop threshold (0x13) - W

§

Tcoolthrs = 20

CoolStep threshold (0x14) - W

§

Vactual = 34

UART velocity control (0x22) - W

§

Sgthrs = 64

StallGuard threshold (0x40) - W

§

SgResult = 65

StallGuard result (0x41) - R

§

Coolconf = 66

CoolStep configuration (0x42) - W

§

Mscnt = 106

Microstep counter (0x6A) - R

§

Mscuract = 107

Microstep current (0x6B) - R

§

Chopconf = 108

Chopper configuration (0x6C) - RW

§

DrvStatus = 111

Driver status (0x6F) - R

§

Pwmconf = 112

StealthChop PWM configuration (0x70) - RW

§

PwmScale = 113

PWM scaling result (0x71) - R

§

PwmAuto = 114

Automatic PWM values (0x72) - R

Implementations§

Source§

impl Address

Source

pub fn from_u8(value: u8) -> Option<Self>

Convert a u8 to an Address if it’s a known register.

Source

pub fn is_readable(self) -> bool

Check if this register is readable.

Source

pub fn is_writable(self) -> bool

Check if this register is writable.

Source

pub fn as_u8(self) -> u8

Get the raw address value.

Trait Implementations§

Source§

impl Clone for Address

Source§

fn clone(&self) -> Address

Returns a duplicate 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 Address

Source§

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

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

impl Format for Address

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<Address> for u8

Source§

fn from(addr: Address) -> u8

Converts to this type from the input type.
Source§

impl Hash for Address

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Address

Source§

fn eq(&self, other: &Address) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Address

Source§

impl Eq for Address

Source§

impl StructuralPartialEq for Address

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.