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.

Object Safety§

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§