Skip to content

Class daisy::Mcp23017Transport

ClassList > daisy > Mcp23017Transport

More...

  • #include <mcp23x17.h>

Classes

Type Name
struct Config

Public Attributes

Type Name
daisy::I2CHandle i2c_
uint8_t i2c_address_
uint8_t timeout = {10}

Public Functions

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

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);

Public Attributes Documentation

variable i2c_

daisy::I2CHandle daisy::Mcp23017Transport::i2c_;

variable i2c_address_

uint8_t daisy::Mcp23017Transport::i2c_address_;

variable timeout

uint8_t daisy::Mcp23017Transport::timeout;

Public Functions Documentation

function Init [½]

inline void daisy::Mcp23017Transport::Init () 

function Init [2/2]

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

function ReadReg [½]

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

function ReadReg [2/2]

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

function WriteReg [½]

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

function WriteReg [2/2]

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


The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/mcp23x17.h