Struct esp_idf_sys::pcnt_config_t

source ·
#[repr(C)]
pub struct pcnt_config_t { pub pulse_gpio_num: c_int, pub ctrl_gpio_num: c_int, pub lctrl_mode: pcnt_ctrl_mode_t, pub hctrl_mode: pcnt_ctrl_mode_t, pub pos_mode: pcnt_count_mode_t, pub neg_mode: pcnt_count_mode_t, pub counter_h_lim: i16, pub counter_l_lim: i16, pub unit: pcnt_unit_t, pub channel: pcnt_channel_t, }
Expand description

@brief Pulse Counter configuration for a single channel

Fields§

§pulse_gpio_num: c_int

< Pulse input GPIO number, if you want to use GPIO16, enter pulse_gpio_num = 16, a negative value will be ignored

§ctrl_gpio_num: c_int

< Control signal input GPIO number, a negative value will be ignored

§lctrl_mode: pcnt_ctrl_mode_t

< PCNT low control mode

§hctrl_mode: pcnt_ctrl_mode_t

< PCNT high control mode

§pos_mode: pcnt_count_mode_t

< PCNT positive edge count mode

§neg_mode: pcnt_count_mode_t

< PCNT negative edge count mode

§counter_h_lim: i16

< Maximum counter value

§counter_l_lim: i16

< Minimum counter value

§unit: pcnt_unit_t

< PCNT unit number

§channel: pcnt_channel_t

< the PCNT channel

Trait Implementations§

source§

impl Default for pcnt_config_t

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for pcnt_config_t

§

impl RefUnwindSafe for pcnt_config_t

§

impl Send for pcnt_config_t

§

impl Sync for pcnt_config_t

§

impl Unpin for pcnt_config_t

§

impl UnwindSafe for pcnt_config_t

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.