Skip to content
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

✨ Add tla2528 driver #5

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

MichaelYKersey
Copy link

The tla2528 is an i2c-based GPIO expander and ADC mux. It has 8 pins that can each be independently configured and operated as GPIO or ADC. This is a port of the tla2528 driver and adapters from the SJSU robotics team.

Features

  • ADC readings
  • Digital input readings (bus & individual)
  • Digital output writing (bus & individual) (push-pull & open-drain)
  • Adapters for each

Missing/future/unimplemented features:

  • TLA reset on object creation
  • ADC 16-bit precision (currently 12-bit, but chip allows for more)
  • ADC channel verification (redundancy)

@MichaelYKersey
Copy link
Author

currently, the reset command is declared as a private method but is unimplemented. Should it be removed? or is it better to leave it there for the binary interface consistency (I'm not sure how ABIs work)

@kammce kammce changed the title Tla2528 ✨ Add tla2528 driver Nov 27, 2024
Copy link
Member

@kammce kammce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Much of my comments have to do with formatting and documentation. The rest mostly looks good.

demos/applications/tla2528_analog_input.cpp Outdated Show resolved Hide resolved
demos/applications/tla2528_analog_input.cpp Outdated Show resolved Hide resolved
demos/applications/tla2528_input_pin.cpp Outdated Show resolved Hide resolved
include/libhal-expander/tla2528_adapters.hpp Outdated Show resolved Hide resolved
include/libhal-expander/tla2528_adapters.hpp Outdated Show resolved Hide resolved
src/tla2528.cpp Outdated Show resolved Hide resolved
src/tla2528_adapters.cpp Outdated Show resolved Hide resolved
src/tla2528.cpp Outdated Show resolved Hide resolved
demos/applications/tla2528_output_pin.cpp Outdated Show resolved Hide resolved
src/tla2528_adapters.cpp Outdated Show resolved Hide resolved
@kammce
Copy link
Member

kammce commented Nov 27, 2024

currently, the reset command is declared as a private method but is unimplemented. Should it be removed? or is it better to leave it there for the binary interface consistency (I'm not sure how ABIs work)

See my comment on what you should do about reset. As for ABI, class functions do not effect the ABI of a function so nothing to worry about from that angle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants