libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Mcp23017Transport Class Reference

Detailed Description

Barebones driver for MCP23017 I2C 16-Bit I/O Expander For now it supports only polling approach.

Usage: Mcp23017 mcp; mcp.Init(); mcp.PortMode(MCP23017Port::A, 0xFF); // Inputs mcp.PortMode(MCP23017Port::B, 0xFF); mcp.Read(); mcp.GetPin(2);

#include <mcp23x17.h>

Classes

struct  Config
 

Public Member Functions

void Init ()
 
void Init (const Config &config)
 
I2CHandle::Result WriteReg (MCPRegister reg, uint8_t val)
 
I2CHandle::Result WriteReg (MCPRegister reg, uint8_t portA, uint8_t portB)
 
uint8_t ReadReg (MCPRegister reg)
 
void ReadReg (MCPRegister reg, uint8_t &portA, uint8_t &portB)
 

Public Attributes

daisy::I2CHandle i2c_
 
uint8_t i2c_address_
 
uint8_t timeout {10}
 

Member Function Documentation

◆ Init() [1/2]

void daisy::Mcp23017Transport::Init ( )
inline

◆ Init() [2/2]

void daisy::Mcp23017Transport::Init ( const Config config)
inline

◆ ReadReg() [1/2]

uint8_t daisy::Mcp23017Transport::ReadReg ( MCPRegister  reg)
inline

◆ ReadReg() [2/2]

void daisy::Mcp23017Transport::ReadReg ( MCPRegister  reg,
uint8_t portA,
uint8_t portB 
)
inline

◆ WriteReg() [1/2]

I2CHandle::Result daisy::Mcp23017Transport::WriteReg ( MCPRegister  reg,
uint8_t  portA,
uint8_t  portB 
)
inline

◆ WriteReg() [2/2]

I2CHandle::Result daisy::Mcp23017Transport::WriteReg ( MCPRegister  reg,
uint8_t  val 
)
inline

Member Data Documentation

◆ i2c_

daisy::I2CHandle daisy::Mcp23017Transport::i2c_

◆ i2c_address_

uint8_t daisy::Mcp23017Transport::i2c_address_

◆ timeout

uint8_t daisy::Mcp23017Transport::timeout {10}

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