Struct rustduino::atmega328p::hal::port::Pin[][src]

#[repr(C, packed)]
pub struct Pin { pub port: *mut Port, pub pin: u8, }
Expand description

Represents a single Pin.

The struct contains reference to a Port under which the pin belong and the pin number.

Fields

port: *mut Portpin: u8

Implementations

Creates a Port of given PortName.

Returns

  • maybe a Pin object - which will be used for further implementations.

Change pin mode to input or output by changing the DDR bit of that pin to 0 and 1 respectively.

io_mode can be either IOMode::Input or IOMode::Output.

Arguments

  • mode - a IOMode object, which defines the mode of the pin to be set.

Toggles value of PORTxn, independent of value of DDRxn.

Set pin to high.

This function checks if the pin is already high or not by reading PINxn register. If it is not high then it calls Pin::toggle.

Set pin to low.

This function checks if the pin is already low or not by reading PINxn register. If it is not low then it calls Pin::toggle.

Change pin mode to output by changing the DDR bit of that pin to 1.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.