Struct esp32c6::TWAI0

source ·
pub struct TWAI0 { /* private fields */ }
Expand description

Two-Wire Automotive Interface

Implementations§

source§

impl TWAI0

source

pub const PTR: *const RegisterBlock = {0x6000b000 as *const twai0::RegisterBlock}

Pointer to the register block

source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

source

pub unsafe fn steal() -> Self

Steal an instance of this peripheral

§Safety

Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.

Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.

Methods from Deref<Target = RegisterBlock>§

source

pub fn mode(&self) -> &MODE

0x00 - TWAI mode register.

source

pub fn cmd(&self) -> &CMD

0x04 - TWAI command register.

source

pub fn status(&self) -> &STATUS

0x08 - TWAI status register.

source

pub fn interrupt(&self) -> &INTERRUPT

0x0c - Interrupt signals’ register.

source

pub fn interrupt_enable(&self) -> &INTERRUPT_ENABLE

0x10 - Interrupt enable register.

source

pub fn bus_timing_0(&self) -> &BUS_TIMING_0

0x18 - Bit timing configuration register 0.

source

pub fn bus_timing_1(&self) -> &BUS_TIMING_1

0x1c - Bit timing configuration register 1.

source

pub fn arb_lost_cap(&self) -> &ARB_LOST_CAP

0x2c - TWAI arbiter lost capture register.

source

pub fn err_code_cap(&self) -> &ERR_CODE_CAP

0x30 - TWAI error info capture register.

source

pub fn err_warning_limit(&self) -> &ERR_WARNING_LIMIT

0x34 - TWAI error threshold configuration register.

source

pub fn rx_err_cnt(&self) -> &RX_ERR_CNT

0x38 - Rx error counter register.

source

pub fn tx_err_cnt(&self) -> &TX_ERR_CNT

0x3c - Tx error counter register.

source

pub fn data_0(&self) -> &DATA_0

0x40 - Data register 0.

source

pub fn data_1(&self) -> &DATA_1

0x44 - Data register 1.

source

pub fn data_2(&self) -> &DATA_2

0x48 - Data register 2.

source

pub fn data_3(&self) -> &DATA_3

0x4c - Data register 3.

source

pub fn data_4(&self) -> &DATA_4

0x50 - Data register 4.

source

pub fn data_5(&self) -> &DATA_5

0x54 - Data register 5.

source

pub fn data_6(&self) -> &DATA_6

0x58 - Data register 6.

source

pub fn data_7(&self) -> &DATA_7

0x5c - Data register 7.

source

pub fn data_8(&self) -> &DATA_8

0x60 - Data register 8.

source

pub fn data_9(&self) -> &DATA_9

0x64 - Data register 9.

source

pub fn data_10(&self) -> &DATA_10

0x68 - Data register 10.

source

pub fn data_11(&self) -> &DATA_11

0x6c - Data register 11.

source

pub fn data_12(&self) -> &DATA_12

0x70 - Data register 12.

source

pub fn rx_message_cnt(&self) -> &RX_MESSAGE_CNT

0x74 - Received message counter register.

source

pub fn clock_divider(&self) -> &CLOCK_DIVIDER

0x7c - Clock divider register.

source

pub fn sw_standby_cfg(&self) -> &SW_STANDBY_CFG

0x80 - Software configure standby pin directly.

source

pub fn hw_cfg(&self) -> &HW_CFG

0x84 - Hardware configure standby pin.

source

pub fn hw_standby_cnt(&self) -> &HW_STANDBY_CNT

0x88 - Configure standby counter.

source

pub fn idle_intr_cnt(&self) -> &IDLE_INTR_CNT

0x8c - Configure idle interrupt counter.

source

pub fn eco_cfg(&self) -> &ECO_CFG

0x90 - ECO configuration register.

Trait Implementations§

source§

impl Debug for TWAI0

source§

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

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

impl Deref for TWAI0

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Send for TWAI0

Auto Trait Implementations§

§

impl Freeze for TWAI0

§

impl RefUnwindSafe for TWAI0

§

impl !Sync for TWAI0

§

impl Unpin for TWAI0

§

impl UnwindSafe for TWAI0

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

§

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.