avr-classes
Public Member Functions | List of all members
OutputPortPin Class Reference

#include <outputportpin.h>

Inheritance diagram for OutputPortPin:
OutputPin

Public Member Functions

 OutputPortPin (OutputPort *port, uint8_t index)
 
virtual void setValue (bool value) override
 

Detailed Description

Output pin that can be set to a boolean value. The OutputPortPin works with any OutputPort interface. This could be a simple GpioPort, or a more sophisticated device like an OutputShiftRegisterPort.

Note
You have to make sure that pins being used for a OutputPortPin to operate on must be configured as output. The OutputPortPin doesn't know about setting a direction. So if you plan to use a GpioPort for this, first set it up correctly using its setDirection() method.

Constructor & Destructor Documentation

◆ OutputPortPin()

OutputPortPin::OutputPortPin ( OutputPort port,
uint8_t  index 
)
inline

Constructor.

Parameters
portPointer to output port the pin is located on.
indexZero based index of the pin within the port (e.g. index 2 on PortB results in the pin commonly called PB2).

Member Function Documentation

◆ setValue()

virtual void OutputPortPin::setValue ( bool  value)
inlineoverridevirtual

Sets the pin to the specified value.

Parameters
valueValue to set, true means HIGH level, false means LOW level.

Implements OutputPin.