PinType

Enum PinType 

Source
pub enum PinType {
Show 47 variants D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16, A0, A1, A2, A3, A4, A5, A6, A7, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, SW, User, Led, BoardType, Rst, BleInt, BleRst, McuRst,
}
Expand description

An explicit allowable types for RHPin

Variants§

§

D0

The Digital pin 0

§

D1

The Digital pin 1

§

D2

The Digital pin 2

§

D3

The Digital pin 3

§

D4

The Digital pin 4

§

D5

The Digital pin 5

§

D6

The Digital pin 6

§

D7

The Digital pin 7

§

D8

The Digital pin 8

§

D9

The Digital pin 9

§

D10

The Digital pin 10

§

D11

The Digital pin 11

§

D12

The Digital pin 12

§

D13

The Digital pin 13

§

D14

The Digital pin 14

§

D15

The Digital pin 15

§

D16

The Digital pin 16

§

A0

The Analog pin 0

§

A1

The Analog pin 1

§

A2

The Analog pin 2

§

A3

The Analog pin 3

§

A4

The Analog pin 4

§

A5

The Analog pin 5

§

A6

The Analog pin 6

§

A7

The Analog pin 7

§

P0

The Pwm pin 0

§

P1

The Pwm pin 1

§

P2

The Pwm pin 2

§

P3

The Pwm pin 3

§

P4

The Pwm pin 4

§

P5

The Pwm pin 5

§

P6

The Pwm pin 6

§

P7

The Pwm pin 7

§

P8

The Pwm pin 8

§

P9

The Pwm pin 9

§

P10

The Pwm pin 10

§

P11

The Pwm pin 11

§

P12

The Pwm pin 12

§

P13

The Pwm pin 13

§

SW

The USR button

§

User

The USR button

§

Led

The LED on the board

§

BoardType

The board type pin

§

Rst

The Reset pin

§

BleInt

The Ble interrupt pin ?

§

BleRst

The Ble reset pin ?

§

McuRst

The MCU reset pin

Implementations§

Source§

impl PinType

Source

pub fn is_digital_pin(&self) -> bool

checks if PinType is a Digital Pin

Source

pub fn is_adc_pin(&self) -> bool

checks if PinType is a Analog Pin

Source

pub fn is_pwm_pin(&self) -> bool

checks if PinType is a Pwm pin

Source

pub fn adc_channel(&self) -> u8

Get channel number for ADC pin PinType::A0-A7

Source

pub fn pwm_channel(&self) -> u8

Get channel number for Pwm pin PinType::P0-P13

Trait Implementations§

Source§

impl Clone for PinType

Source§

fn clone(&self) -> PinType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PinType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for PinType

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.