rtic_time::half_period_counter

Trait TimerOps

Source
pub trait TimerOps: Copy {
    const MAX: Self;
    const ONE: Self;

    // Required methods
    fn xor(self, other: Self) -> Self;
    fn and(self, other: Self) -> Self;
    fn add(self, other: Self) -> Self;
    fn left_shift(self, amount: u32) -> Self;
}
Expand description

Operations a type has to support in order to be used as the return value of calculate_now.

Required Associated Constants§

Source

const MAX: Self

All bits set to 1.

Source

const ONE: Self

The lowest bit set to 1.

Required Methods§

Source

fn xor(self, other: Self) -> Self

The ^ operation.

Source

fn and(self, other: Self) -> Self

The & operation.

Source

fn add(self, other: Self) -> Self

The + operation.

Source

fn left_shift(self, amount: u32) -> Self

The << operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TimerOps for u16

Source§

const MAX: Self = 65_535u16

Source§

const ONE: Self = 1u16

Source§

fn xor(self, other: Self) -> Self

Source§

fn and(self, other: Self) -> Self

Source§

fn add(self, other: Self) -> Self

Source§

fn left_shift(self, amount: u32) -> Self

Source§

impl TimerOps for u32

Source§

const MAX: Self = 4_294_967_295u32

Source§

const ONE: Self = 1u32

Source§

fn xor(self, other: Self) -> Self

Source§

fn and(self, other: Self) -> Self

Source§

fn add(self, other: Self) -> Self

Source§

fn left_shift(self, amount: u32) -> Self

Source§

impl TimerOps for u64

Source§

const MAX: Self = 18_446_744_073_709_551_615u64

Source§

const ONE: Self = 1u64

Source§

fn xor(self, other: Self) -> Self

Source§

fn and(self, other: Self) -> Self

Source§

fn add(self, other: Self) -> Self

Source§

fn left_shift(self, amount: u32) -> Self

Source§

impl TimerOps for u128

Source§

const MAX: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

const ONE: Self = 1u128

Source§

fn xor(self, other: Self) -> Self

Source§

fn and(self, other: Self) -> Self

Source§

fn add(self, other: Self) -> Self

Source§

fn left_shift(self, amount: u32) -> Self

Implementors§