-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement sequential read/write for 16-bit operations #43
Conversation
Great addition! |
This addition was on my todo list, so I'm happy you implemented and tested it. The POR (power on reset) value of the SEQOP bit is zero ==> sequential read/write mode. However as we will not be sure if the value is set to zero, I propose to clear that bit explicitly Add in the begin() function. line 73++ something like uint8_t reg = readReg(MCP23017_IOCR);
if (reg & MCP23017_IOCR_SEQOP) // check if already zero
{
reg &= ~MCP23017_IOCR_SEQOP; // clear SEQOP bit for sequential read/write
if (! writeReg(MCP23017_IOCR, reg)) return false;
} |
Yes, I agree. Should I also remove line 73 then? |
MCP23017_IOCR to MCP23x17_IOCR
Please remove line 73 as it has no function |
Removed line 73
LGTM |
@olkal
|
- #43 optimize read/write16, kudos to Olkal - add performance test output 0.5.2, 0.5.3 - add datasheet REV C and REV D to repo
Hi, this PR is implementing sequential read/write for 16-bit operations as described in the data sheet 3.2.1 page 13.
See test data below from running the MCP23S17_performance.ino sketch on an ESP32-S3@240mhz.