Skip to content

feat(aw9523): update output API#88

Merged
finger563 merged 1 commit intomainfrom
feature/aw9523-bit-functions
Jul 12, 2023
Merged

feat(aw9523): update output API#88
finger563 merged 1 commit intomainfrom
feature/aw9523-bit-functions

Conversation

@finger563
Copy link
Contributor

Description

  • Updated Aw9523 API so that the set_pins now actually writes the output high (sets) the pins provided by the pin mask, not changing the other outputs
  • Added clear_pins API to Aw9523 to write the output low (clears) for the pins provided in the pin mask, not changing the other outputs
  • Added output(...) APIs to Aw9523 to keep functionality for simultaneously writing all values (high and low) for all pins on the output, in case the user wants to do that (e.g. to ensure certain pins are XOR-ed)
  • Rebuilt docs
  • Minor update to example code

Motivation and Context

Previously, if the user only wanted to set / clear a value for a certain pin, they would have to keep track of the state internally, since there was no API for reading the current output state and any call to the existing set_pins functions would overwrite all output values. This PR changes the set_pins API to only set the output values high for the pins that are set in the provided bit mask - doing so by reading the value of the output registers first. It similarly adds a clear_pins function which sets the output values low for any pins whose bits are set in the provided masks. The original functionality of the set_pins function which set both high and low output values for all output pins at once is now provided by the output functions.

How has this been tested?

Building the Aw9523 example.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Updated Aw9523 API so that the set_pins now actually writes the output high (sets) the pins provided by the pin mask, not changing the other outputs
* Added clear_pins API to Aw9523 to write the output low (clears) for the pins provided in the pin mask, not changing the other outputs
* Added output(...) APIs to Aw9523 to keep functionality for simultaneously writing all values (high and low) for all pins on the output, in case the user wants to do that (e.g. to ensure certain pins are XOR-ed)
* Rebuilt docs
* Minor update to example code
@finger563 finger563 added enhancement New feature or request aw9523 labels Jul 12, 2023
@finger563 finger563 merged commit c9b6fc7 into main Jul 12, 2023
@finger563 finger563 deleted the feature/aw9523-bit-functions branch July 12, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aw9523 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant