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 bus voltage over limit #14

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

Conversation

asssaf
Copy link

@asssaf asssaf commented Dec 24, 2024

  • Describe the scope of your change--i.e. what the change does and what parts
    of the code were modified.
    This will help us understand any risks of integrating
    the code.

Add getBusVoltageOverLimit and setBusVoltageOverLimit functions to read & write the BOVL register.

  • Describe any known limitations with your change. For example if the change
    doesn't apply to a supported platform of the library please mention it.

Only implemented for the BOVL register for now.

  • Please run any tests or examples that can exercise your modified code. We
    strive to not break users of the code and running tests/examples helps with this
    process.

This doesn't affect existing tests/examples.
Example code:

  ina228.setBusVoltageOverLimit(3000.0);

  float limit = ina228.getBusVoltageOverLimit();
  Serial.print("Bus over voltage limit: ");
  Serial.print(limit);
  Serial.println(" mV.");

  uint16_t flags = ina228.alertFunctionFlags();
  if (flags & 16) {
    triggered = true;
    Serial.print("Triggered at ");
    Serial.print(limit);
    Serial.println(" mV.");
  }

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.

1 participant