mirror of
https://github.com/justinian/edmfd_firmware.git
synced 2025-12-09 16:24:31 -08:00
Support feather board, move to broken out source
This commit is contained in:
31
src/edmfd/mcp23017.hh
Normal file
31
src/edmfd/mcp23017.hh
Normal file
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user