Digital IO
Public Member Functions | List of all members
PinIO Class Reference

AVR port I/O with runtime pin numbers. More...

#include <PinIO.h>

Public Member Functions

 PinIO ()
 
 PinIO (uint8_t pin)
 
bool begin (uint8_t pin)
 
void config (uint8_t mode, bool data)
 
void high ()
 
void highI ()
 
void low ()
 
void lowI ()
 
void mode (uint8_t mode)
 
void modeI (uint8_t mode)
 
bool read ()
 
void toggle ()
 
void write (bool level)
 
void writeI (bool level)
 

Detailed Description

AVR port I/O with runtime pin numbers.

Definition at line 39 of file PinIO.h.

Constructor & Destructor Documentation

PinIO::PinIO ( )
inline

Create a PinIO object with no assigned pin.

Definition at line 42 of file PinIO.h.

Member Function Documentation

void PinIO::high ( )
inline

Set pin level high if output mode or enable 20K pullup if input mode.

This function will enable interrupts. This function should not be called in an ISR or where interrupts are disabled.

Definition at line 114 of file PinIO.h.

void PinIO::highI ( )
inline

Set pin high if output mode or enable 20K pullup if input mode.

This function must be called with interrupts disabled. This function will not change the interrupt state.

Definition at line 66 of file PinIO.h.

void PinIO::low ( )
inline

Set pin level low if output mode or disable 20K pullup if input mode.

This function will enable interrupts. This function should not be called in an ISR or where interrupts are disabled.

Definition at line 123 of file PinIO.h.

void PinIO::lowI ( )
inline

Set pin low if output mode or disable 20K pullup if input mode.

This function must be called with interrupts disabled. This function will not change the interrupt state.

Definition at line 74 of file PinIO.h.

void PinIO::mode ( uint8_t  mode)
inline

Set pin mode.

Parameters
[in]modeINPUT, OUTPUT, or INPUT_PULLUP.

The internal pullup resistors will be enabled if mode is INPUT_PULLUP and disabled if the mode is INPUT.

This function will enable interrupts. This function should not be called in an ISR or where interrupts are disabled.

Definition at line 137 of file PinIO.h.

void PinIO::modeI ( uint8_t  mode)
inline

Set pin mode.

Parameters
[in]modeINPUT, OUTPUT, or INPUT_PULLUP.

The internal pullup resistors will be enabled if mode is INPUT_PULLUP and disabled if the mode is INPUT.

This function must be called with interrupts disabled. This function will not change the interrupt state.

Definition at line 86 of file PinIO.h.

bool PinIO::read ( )
inline
Returns
Pin's level

Definition at line 49 of file PinIO.h.

void PinIO::toggle ( )
inline

toggle a pin

If the pin is in output mode toggle the pin's level. If the pin is in input mode toggle the state of the 20K pullup.

Definition at line 57 of file PinIO.h.

void PinIO::write ( bool  level)
inline

Write pin.

Parameters
[in]levelIf output mode set pin high if true else low. If input mode enable 20K pullup if true else disable pullup.

This function will enable interrupts. This function should not be called in an ISR or where interrupts are disabled.

Definition at line 148 of file PinIO.h.

void PinIO::writeI ( bool  level)
inline

Write pin.

Parameters
[in]levelIf output mode set pin high if true else low. If input mode enable 20K pullup if true else disable pullup.

This function must be called with interrupts disabled. This function will not change the interrupt state.

Definition at line 103 of file PinIO.h.


The documentation for this class was generated from the following files: