Struct esp_idf_svc::hal::rmt::PulseTicks
source · pub struct PulseTicks(/* private fields */);
Expand description
Number of ticks, restricting the range to 0 to 32,767.
Implementations§
source§impl PulseTicks
impl PulseTicks
pub const fn zero() -> PulseTicks
sourcepub const fn max() -> PulseTicks
pub const fn max() -> PulseTicks
Use the maximum value of 32767.
sourcepub fn new(ticks: u16) -> Result<PulseTicks, EspError>
pub fn new(ticks: u16) -> Result<PulseTicks, EspError>
Needs to be unsigned 15 bits: 0-32767 inclusive, otherwise an ESP_ERR_INVALID_ARG is returned.
sourcepub fn new_with_duration(
ticks_hz: Hertz,
duration: &Duration,
) -> Result<PulseTicks, EspError>
pub fn new_with_duration( ticks_hz: Hertz, duration: &Duration, ) -> Result<PulseTicks, EspError>
Convert a Duration
into PulseTicks
.
See Pulse::new_with_duration()
for details.
pub fn ticks(&self) -> u16
pub fn duration(&self, ticks_hz: Hertz) -> Result<Duration, EspError>
Trait Implementations§
source§impl Clone for PulseTicks
impl Clone for PulseTicks
source§fn clone(&self) -> PulseTicks
fn clone(&self) -> PulseTicks
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PulseTicks
impl Debug for PulseTicks
source§impl Default for PulseTicks
impl Default for PulseTicks
source§fn default() -> PulseTicks
fn default() -> PulseTicks
Returns the “default value” for a type. Read more
source§impl PartialEq for PulseTicks
impl PartialEq for PulseTicks
impl Copy for PulseTicks
impl Eq for PulseTicks
impl StructuralPartialEq for PulseTicks
Auto Trait Implementations§
impl Freeze for PulseTicks
impl RefUnwindSafe for PulseTicks
impl Send for PulseTicks
impl Sync for PulseTicks
impl Unpin for PulseTicks
impl UnwindSafe for PulseTicks
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)