|
| class | RefreshTimer |
| | This timer runs in the parent executor and upon every timeout it executes the update / polling of the IO expander. More...
|
| |
|
| enum | { PORTA = 0
, PORTB = 1
} |
| |
|
| enum | Registers {
IODIRA = 0x0
, IODIRB = 0x1
, IPOLA = 0x2
, IPOLB = 0x3
,
GPINTENA = 0x4
, GPINTENB = 0x5
, DEFVALA = 0x6
, DEFVALB = 0x7
,
INTCONA = 0x8
, INTCONB = 0x9
, IOCON = 0xA
, GPPUA = 0xC
,
GPPUB = 0xD
, INTFA = 0xE
, INTFB = 0xF
, INTCAPA = 0x10
,
INTCAPB = 0x11
, RGPIOA = 0x12
, RGPIOB = 0x13
, OLATA = 0x14
,
OLATB = 0x15
} |
| |
| enum | { BASE_ADDRESS = 0b0100000
, DIRTY_DIR = 1
, DIRTY_LAT = 2
} |
| |
|
|
| DISALLOW_COPY_AND_ASSIGN (MCP23017) |
| |
| void | update_out () |
| | Updates the output direction and latch registers if any of it is dirty.
|
| |
| void | update_in () |
| | Updates input registers.
|
| |
| void | register_write (uint8_t reg, const uint8_t *data, uint16_t len) |
| | Writes one or more (sequential) registers in the MCP23017.
|
| |
| void | register_read (uint8_t reg, uint8_t *data, uint16_t len) |
| | Reads one or more (sequential) registers in the MCP23017.
|
| |
| void | lock () |
| |
| void | unlock () |
| |
Definition at line 46 of file MCP23017Gpio.hxx.
◆ anonymous enum
◆ anonymous enum
◆ Registers
◆ MCP23017()
Constructor.
- Parameters
-
| a2 | address bit 2 |
| a1 | address bit 1 |
| a0 | address bit 0 |
Definition at line 56 of file MCP23017Gpio.hxx.
◆ init() [1/2]
| void MCP23017::init |
( |
const char * |
i2c_path | ) |
|
|
inline |
Initializes the device.
- Parameters
-
| i2c_path | is the path to the device driver of the i2c port. |
Definition at line 77 of file MCP23017Gpio.hxx.
◆ init() [2/2]
| void MCP23017::init |
( |
int |
i2c_fd | ) |
|
|
inline |
Initializes the device.
- Parameters
-
| i2c_fd | is the file descriptor of the i2c port to use. |
Definition at line 86 of file MCP23017Gpio.hxx.
◆ register_read()
| void MCP23017::register_read |
( |
uint8_t |
reg, |
|
|
uint8_t * |
data, |
|
|
uint16_t |
len |
|
) |
| |
|
inlineprivate |
Reads one or more (sequential) registers in the MCP23017.
- Parameters
-
| reg | starting register offset. |
| data | where to write payload |
| len | number of registers to read. Returns when the read is complete. |
Definition at line 214 of file MCP23017Gpio.hxx.
◆ register_write()
| void MCP23017::register_write |
( |
uint8_t |
reg, |
|
|
const uint8_t * |
data, |
|
|
uint16_t |
len |
|
) |
| |
|
inlineprivate |
Writes one or more (sequential) registers in the MCP23017.
- Parameters
-
| reg | starting register offset. |
| data | payload to write |
| len | number of bytes to write. Returns when the write is complete. |
Definition at line 188 of file MCP23017Gpio.hxx.
◆ update_in()
| void MCP23017::update_in |
( |
| ) |
|
|
inlineprivate |
◆ update_out()
| void MCP23017::update_out |
( |
| ) |
|
|
inlineprivate |
Updates the output direction and latch registers if any of it is dirty.
Definition at line 144 of file MCP23017Gpio.hxx.
◆ MCP23017Gpio
◆ dir_
| uint8_t MCP23017::dir_[2] |
|
private |
◆ dirty_
| uint8_t MCP23017::dirty_ = 0 |
|
private |
◆ executor_
◆ fd_
◆ gpio_
| uint8_t MCP23017::gpio_[2] |
|
private |
◆ i2cAddress_
| uint8_t MCP23017::i2cAddress_ |
|
private |
◆ lat_
| uint8_t MCP23017::lat_[2] |
|
private |
◆ POLLING_DELAY
| constexpr long long MCP23017::POLLING_DELAY = MSEC_TO_NSEC(20) |
|
staticconstexpr |
◆ timer_
The documentation for this class was generated from the following file: