Add generic functions to write to or read from internal registers + use Wire1 #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new provided functions allow to use from the sketch:
PMIC.writePMICreg(Register const reg_addr, uint8_t val)
uint8_t regVal = PF1550.readPMICreg(Register const reg_addr)
PF1550.setPMICbit(Register const reg_addr, uint8_t posBit)
They can be tested using the provided example "ReadWriteRegs.ino".
The read function has been used to monitor some PMIC register from the fuel gauge library Arduino_MAX1726.
Communication goes over I2C on Wire1 (pin PB7 and PB8).
Debug capability has been added with the function
PF1550.debug(Stream& stream)
which takes as argument the Serial interface on which the user wants to print the internal debug messages.