Class daisy::Mcp23017Transport¶
ClassList > daisy > Mcp23017Transport
#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_¶
variable i2c_address_¶
variable timeout¶
Public Functions Documentation¶
function Init [½]¶
function Init [2/2]¶
function ReadReg [½]¶
function ReadReg [2/2]¶
function WriteReg [½]¶
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