modm API documentation
|
#include <modm/driver/gpio/mcp23x17.hpp>
Public Typedefs | |
typedef modm::Flags16< Pin > | Pins |
using | PortType = uint16_t |
template<Mcp23x17< Transport > & object, Pin StartPin, uint8_t Width, GpioPort::DataOrder DataOrder = GpioPort::DataOrder::Normal> | |
using | Port = GpioExpanderPort< Mcp23x17< Transport >, object, StartPin, Width, DataOrder > |
Alias-templates for simpler use of the Port. | |
template<Mcp23x17< Transport > & object> | |
using | A0 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A0 > |
template<Mcp23x17< Transport > & object> | |
using | A1 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A1 > |
template<Mcp23x17< Transport > & object> | |
using | A2 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A2 > |
template<Mcp23x17< Transport > & object> | |
using | A3 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A3 > |
template<Mcp23x17< Transport > & object> | |
using | A4 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A4 > |
template<Mcp23x17< Transport > & object> | |
using | A5 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A5 > |
template<Mcp23x17< Transport > & object> | |
using | A6 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A6 > |
template<Mcp23x17< Transport > & object> | |
using | A7 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::A7 > |
template<Mcp23x17< Transport > & object> | |
using | B0 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B0 > |
template<Mcp23x17< Transport > & object> | |
using | B1 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B1 > |
template<Mcp23x17< Transport > & object> | |
using | B2 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B2 > |
template<Mcp23x17< Transport > & object> | |
using | B3 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B3 > |
template<Mcp23x17< Transport > & object> | |
using | B4 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B4 > |
template<Mcp23x17< Transport > & object> | |
using | B5 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B5 > |
template<Mcp23x17< Transport > & object> | |
using | B6 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B6 > |
template<Mcp23x17< Transport > & object> | |
using | B7 = GpioExpanderPin< Mcp23x17< Transport >, object, Pin::B7 > |
Public Member Functions | |
Mcp23x17 (uint8_t address=0x20) | |
Constructor, sets address to default of 0x20 (range 0x20 - 0x27) | |
modm::ResumableResult< bool > | initialize () |
modm::ResumableResult< bool > | setOutput (Pins pins) |
modm::ResumableResult< bool > | set (Pins pins) |
modm::ResumableResult< bool > | reset (Pins pins) |
modm::ResumableResult< bool > | toggle (Pins pins) |
modm::ResumableResult< bool > | set (Pins pins, bool value) |
bool | isSet (Pin pin) |
modm::Gpio::Direction | getDirection (Pin pin) |
modm::ResumableResult< bool > | setInput (Pins pins) |
modm::ResumableResult< bool > | setPullUp (Pins pins) |
modm::ResumableResult< bool > | resetPullUp (Pins pins) |
modm::ResumableResult< bool > | setInvertInput (Pins pins) |
modm::ResumableResult< bool > | resetInvertInput (Pins pins) |
bool | read (Pin pin) |
modm::ResumableResult< bool > | readInput () |
modm::ResumableResult< bool > | readAllInput () |
modm::ResumableResult< bool > | writePort (PortType data) |
modm::ResumableResult< bool > | readPort (PortType &data) |
Pins | getDirections () |
Pins | getOutputs () |
Pins | getInputs () |
Pins | getPolarities () |
modm::Gpio::Direction | getDirection (Pin pin) const |
returns direction of one pin at run-time | |
Pins | getDirections () const |
Returns the direction bits: 0 for Input, 1 for Output. | |
Pins | getInputs () const |
Returns the input bits: 0 for low, 1 for high. | |
Pins | getOutputs () const |
Returns the output bits: 0 for low, 1 for high. | |
bool | isSet (Pin pin) const |
Returns the set logical output state of the pin. | |
bool | read (Pins pins) const |
modm::ResumableResult< bool > | readPort (PortType &data) |
Reads the entire port, buffers them and outputs the result to data. | |
modm::ResumableResult< bool > | reset (Pins pins) |
modm::ResumableResult< bool > | set (Pins pins) |
modm::ResumableResult< bool > | set (Pins pins, bool value) |
modm::ResumableResult< bool > | setInput (Pins pins) |
Sets one or more pins to input. | |
modm::ResumableResult< bool > | setOutput (Pins pins) |
Sets one or more pins to output. | |
modm::ResumableResult< bool > | toggle (Pins pins) |
modm::ResumableResult< bool > | writePort (PortType data) |
Static Public Member Functions | |
static constexpr uint8_t | indexFromPin (Pin pin) |
Static Public Attributes | |
static constexpr uint8_t | width = 16 |
using modm::mcp23x17< Transport >::A0 = GpioExpanderPin< Mcp23x17<Transport>, object, Pin::A0 > |
Alias-templates for simpler use of the Pin
|
inherited |
Returns true if all pins have a high level
readInput()
to update the result.
|
inherited |
Resets one or more pins to logic low
|
inherited |
Sets one or more pins to logic high
|
inherited |
sets one or more pins to high or low level
|
inherited |
Toggles one or more pins
|
inherited |
Writes data to the entire port