Struct esp_idf_hal::delay::TickType
source · #[repr(transparent)]pub struct TickType(pub TickType_t);
Expand description
Transparent wrapper around TickType_t with conversion methods.
Tuple Fields§
§0: TickType_t
Implementations§
source§impl TickType
impl TickType
sourcepub const fn new(ticks: TickType_t) -> Self
pub const fn new(ticks: TickType_t) -> Self
Construct a TickType from a number of ticks.
sourcepub const fn new_millis(ms: u64) -> Self
pub const fn new_millis(ms: u64) -> Self
Construct a TickType from a number of milliseconds. This function will round the number of ticks up, if required.
sourcepub const fn ticks(&self) -> TickType_t
pub const fn ticks(&self) -> TickType_t
Get the number of ticks.
sourcepub const fn as_millis(&self) -> u64
pub const fn as_millis(&self) -> u64
Convert the number of ticks to a number of milliseconds. This function will round the number of milliseconds up, if required.
sourcepub const fn as_millis_u32(&self) -> u32
pub const fn as_millis_u32(&self) -> u32
Convert the number of ticks to a number of milliseconds and saturate to u32. This function will round the number of milliseconds up, if required.