mirror of
https://github.com/justinian/edmfd_firmware.git
synced 2025-12-09 16:24:31 -08:00
32 lines
467 B
C++
32 lines
467 B
C++
#pragma once
|
|
|
|
namespace mcp23017 {
|
|
|
|
enum class reg : uint8_t {
|
|
iodira, iodirb,
|
|
ipola, ipolb,
|
|
gpintena, gpintenb,
|
|
defvala, defvalb,
|
|
intcona, intconb,
|
|
iocona, ioconb,
|
|
gppua, gppub,
|
|
intfa, intfb,
|
|
intcapa, intcapb,
|
|
gpioa, gpiob,
|
|
olata, olatb,
|
|
};
|
|
|
|
class gpios
|
|
{
|
|
public:
|
|
gpios(uint8_t addr);
|
|
|
|
int read(reg r, uint8_t *value);
|
|
int write(reg r, uint8_t value);
|
|
|
|
private:
|
|
uint8_t m_addr;
|
|
};
|
|
|
|
} // namespace mcp23017
|