MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / pinMode8

Method pinMode8

libraries/MCP23017_RT/MCP23017.cpp:336–347  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////// 8 pins interface whole register at once port = 0..1 value = 0..0xFF bit pattern

Source from the content-addressed store, hash-verified

334// port = 0..1
335// value = 0..0xFF bit pattern
336bool MCP23017::pinMode8(uint8_t port, uint8_t value)
337{
338 if (port > 1)
339 {
340 _error = MCP23017_PORT_ERROR;
341 return false;
342 }
343 if (port == 0) writeReg(MCP23017_DDR_A, value);
344 if (port == 1) writeReg(MCP23017_DDR_B, value);
345 _error = MCP23017_OK;
346 return true;
347}
348
349
350bool MCP23017::write8(uint8_t port, uint8_t value) // port = 0..1

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36