Trait bxcan::Instance

source ·
pub unsafe trait Instance {
    const REGISTERS: *mut RegisterBlock;
}
Expand description

A bxCAN peripheral instance.

This trait is meant to be implemented for a HAL-specific type that represent ownership of the CAN peripheral (and any pins required by it, although that is entirely up to the HAL).

§Safety

It is only safe to implement this trait, when:

  • The implementing type has ownership of the peripheral, preventing any other accesses to the register block.
  • REGISTERS is a pointer to that peripheral’s register block and can be safely accessed for as long as ownership or a borrow of the implementing type is present.

Required Associated Constants§

source

const REGISTERS: *mut RegisterBlock

Pointer to the instance’s register block.

Object Safety§

This trait is not object safe.

Implementors§