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.
Description
Motivation and Context
We need to construct the object before the hardware can be initialized. Also, if the AW9523 is shut down and restarted (power rail switching for example) this way it can be reinitialized without deconstructing and reconstructing a new object.
The 'get_output' methods allow to check what the current state of the outputs is in case there is no internal tracking of the state.
How has this been tested?
Used example code to verify the initialization happens as designed.
In this example, the 3V3SW power rail is used to power the AW9523. The 15V enable line is part of the AW9523.
The AW9523 is constructed before the power rails are set. The initialization happens after the "3V3SW Enable" log.
The "port0&1: 255" log is from reading the output registers, showing that the port 0_5 (15V enable line) is high.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist: