Skip to main content

Block

Trait Block 

Source
pub trait Block: Sized {
    type Interface;
    type RegisterAddressType: Address;
    type CommandAddressType: Address;
    type BufferAddressType: Address;
    type RegisterAddressMode;

    // Required method
    fn interface(&mut self) -> &mut Self::Interface;

    // Provided methods
    fn bulk_read(
        &mut self,
    ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), RO>
       where Self::Interface: RegisterInterfaceBase,
             Self::RegisterAddressMode: AddressMode { ... }
    fn bulk_write(
        &mut self,
    ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), WO>
       where Self::Interface: RegisterInterfaceBase,
             Self::RegisterAddressMode: AddressMode { ... }
    fn bulk_modify(
        &mut self,
    ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), RW>
       where Self::Interface: RegisterInterfaceBase,
             Self::RegisterAddressMode: AddressMode { ... }
}
Expand description

Trait implemented on every generated block/device.

Required Associated Types§

Source

type Interface

The interface used by the block

Source

type RegisterAddressType: Address

The register address type

Source

type CommandAddressType: Address

The command address type

Source

type BufferAddressType: Address

The buffer address type

Source

type RegisterAddressMode

The address mode of the registers in this block

Required Methods§

Source

fn interface(&mut self) -> &mut Self::Interface

Get a reference to the inner interface. With it you can do out-of-band operations that aren’t defined in the generated code.

Provided Methods§

Source

fn bulk_read( &mut self, ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), RO>
where Self::Interface: RegisterInterfaceBase, Self::RegisterAddressMode: AddressMode,

Start a bulk-read transaction

You can chain reads by calling register::BulkRegisterOperation::with. Once chained, call register::BulkRegisterOperation::execute to perform the read.

Source

fn bulk_write( &mut self, ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), WO>
where Self::Interface: RegisterInterfaceBase, Self::RegisterAddressMode: AddressMode,

Start a bulk-write transaction

You can chain writes by calling register::BulkRegisterOperation::with. Once chained, call register::BulkRegisterOperation::execute to perform the write.

Source

fn bulk_modify( &mut self, ) -> BulkRegisterOperation<'_, Self, <Self::Interface as RegisterInterfaceBase>::AddressType, (), RW>
where Self::Interface: RegisterInterfaceBase, Self::RegisterAddressMode: AddressMode,

Start a bulk-modify transaction

You can chain modifies by calling register::BulkRegisterOperation::with. Once chained, call register::BulkRegisterOperation::execute to perform the modify.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§