Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/bq27441/bq27441/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,11 @@ def write_op_config(self, value):
# OpConfig register location: BQ27441_ID_REGISTERS id, offset 0
return self.write_extended_data(BQ27441_ID_REGISTERS, 0, op_config_data, 2)

# Issue a soft - reset to the BQ27441 - G1A
# Full reset of the BQ27441-G1A
def reset(self):
return self.execute_control_word(BQ27441_CONTROL_RESET)

# Soft reset (resimulation) of the BQ27441-G1A
def soft_reset(self):
return self.execute_control_word(BQ27441_CONTROL_SOFT_RESET)

Expand Down
11 changes: 11 additions & 0 deletions tests/scenarios/bq27441.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ tests:
expect: 185
mode: [mock]

- name: "Reset sends CONTROL_RESET command"
action: script
script: |
i2c.clear_write_log()
dev.reset()
log = i2c.get_write_log()
wrote_reset = any(reg == 0x00 and data[0] == 0x41 for reg, data in log)
result = wrote_reset
expect_true: true
mode: [mock]

- name: "Read state of health"
action: call
method: state_of_health
Expand Down