modm API documentation
modm::Mcp23TransportSpi< SpiMaster, Cs > Class Template Reference

#include <modm/driver/gpio/mcp23_transport.hpp>

Inheritance diagram for modm::Mcp23TransportSpi< SpiMaster, Cs >:
modm::SpiDevice< SpiMaster > modm::NestedResumable< 2 >

Public Member Functions

 Mcp23TransportSpi (uint8_t address)
 
modm::ResumableResult< bool > ping ()
 pings the sensor
 
void attachConfigurationHandler (Spi::ConfigurationHandler handler)
 

Protected Member Functions

modm::ResumableResult< bool > write (uint8_t reg, uint8_t value)
 write a 8bit value
 
modm::ResumableResult< bool > write16 (uint8_t reg, uint16_t value)
 write a 16bit value
 
modm::ResumableResult< bool > read (uint8_t reg, uint8_t &value)
 read a 8bit value
 
modm::ResumableResult< bool > read (uint8_t reg, uint8_t *buffer, uint8_t length)
 read multiple 8bit values from a start register
 
bool acquireMaster ()
 
bool releaseMaster ()
 
modm::ResumableResult< ReturnType > resumable function (...)
 
int8_t getResumableDepth () const
 
bool isResumableRunning () const
 
void stopResumable ()
 Force all resumable functions to stop running at the current nesting level.
 

Detailed Description

template<class SpiMaster, class Cs>
class modm::Mcp23TransportSpi< SpiMaster, Cs >

MCP23xxx SPI Transport Layer.

This class manages communication with the gpio expcander via the SPI bus. The SPI interface can be clocked with up to 10MHz and requires Mode3.

See also
Mcp23x08
Mcp23x17
Template Parameters
Csconnected Chip Select Pin
Author
Niklas Hauser

Member Function Documentation

modm::ResumableResult< ReturnType > resumable modm::NestedResumable< 1 >::function (   ...)
inherited

Run the resumable function.

You need to implement this method in you subclass yourself.

Returns
>NestingError if still running, <=NestingError if it has finished.
int8_t modm::NestedResumable< 1 >::getResumableDepth ( ) const
inheritedinline
Returns
the nesting depth in the current resumable function, or -1 if called outside any resumable function
bool modm::NestedResumable< 1 >::isResumableRunning ( ) const
inheritedinline
Returns
true if a resumable function is running at the current nesting level, else false

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