8000
Skip to content

[atm90e32] Only read 1 register per SPI transaction per datasheet. - #10258

Merged
jesserockz merged 2 commits into
esphome:devfrom
raineth:atm90e32_spi
Aug 19, 2025
Merged

[atm90e32] Only read 1 register per SPI transaction per datasheet.#10258
jesserockz merged 2 commits into
esphome:devfrom
raineth:atm90e32_spi

Conversation

@raineth
@raineth raineth commented Aug 16, 2025
Copy link
Copy Markdown
Contributor

What does this implement/fix?

This reverts the addition of read16_transaction_ from #10143, folds it back into read16_, and switches read32_ back to making 2 transactions.

According to the datasheet (section 4.2.2 / page 31), we're only allowed to read a single register per SPI transaction: "The SPI read/write transaction is CS-low defined. Each transaction can only access one register."

This corrects incorrect power register readings for me (which use read32_).

@CircuitSetup FYI

Types of changes

  • Bugfix (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)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

Pull request in esphome-docs with documentation (if applicable):

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • nRF52840

Example entry for config.yaml:

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

This reverts the addition of read16_transaction_ from pr#10143, folds
it back into read16_, and switches read32_ back to making 2
transactions.

According to the datasheet (section 4.2.2 / page 31), we're only
allowed to read a single register per SPI transaction: "The SPI
read/write transaction is CS-low defined. Each transaction can only
access one register."

This corrects incorrect power register readings for me (which use read32_).
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi there! This PR modifies 2 file(s) with codeowners.

@CircuitSetup, @descipher - As codeowner(s) of the affected files, your review would be appreciated! 🙏

Note: Automatic review request may have failed, but you're still welcome to review.

@github-actions
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#10258
    components: [atm90e32]
    refresh: 1h

(Added by the PR bot)

@codecov-commenter
codecov-commenter commented Aug 16, 2025
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.45%. Comparing base (3a6a665) to head (8244557).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10258   +/-   ##
=======================================
  Coverage   60.45%   60.45%           
=======================================
  Files          51       51           
  Lines       10417    10417           
  Branches     1388     1388           
=======================================
  Hits         6298     6298           
  Misses       3760     3760           
  Partials      359      359           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CircuitSetup
Copy link
Copy Markdown
Contributor

@raineth thanks for catching this! I should have noticed that detail in the datasheet.

@jesserockz jesserockz added this to the 2025.8.0b4 milestone Aug 19, 2025
@jesserockz
jesserockz merged commit 7e23d86 into esphome:dev Aug 19, 2025
25 checks passed
@jesserockz jesserockz mentioned this pull request Aug 19, 2025
@jesserockz jesserockz mentioned this pull request Aug 19, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants 3A60

0