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: u8Implementations
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- aIOModeobject, which defines the mode of the pin to be set.
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.