Skip to content

Conversation

@KozhinovAlexander
Copy link
Contributor

@KozhinovAlexander KozhinovAlexander commented Nov 10, 2025

This PR adds stm32g4 opamp including following features implemented:

  • functional mode selection according to existing opamp_api
  • self-calibration routine at initialization stage with and without adc connected
  • adc connection of opamp instance
  • power-mode selection for slew-rate definition
  • different pinouts configurations for IN+/IN-/ VOUT and filtering pins routing

I am highly appreciating any well structured review especially due to the fact, that the documented behavior of opamp in RM0440 Rev. 9 was a kind of tricky to implement within existing opamp_api definition. But it looks good now.

Thank you for your reviews.

It is currently blocked by following PRs:

  1. DT_INST_STRING_TOKEN_BY_IDX_OR macro #97404
  2. Opamp usability #98877

The changes from 1 & 2 PRs are included here too to allow CI to run successfully, but I will drop them after 1 & 2 were merged. Also 1 & 2 PRs shall be merged definitely before this PR.
Please do not review changes of PRs 1 & 2 here, instead follow the link to provide your review.

set the default functional mode of OPAMP peripherals to "follower"

Signed-off-by: Alexander Kozhinov <[email protected]>
add OPAMP module description string and help

Signed-off-by: Alexander Kozhinov <[email protected]>
make functional mode required
add functional modes description with circuit examples

Signed-off-by: Alexander Kozhinov <[email protected]>
enable logging
add log buffer size and debug options and comment them

Signed-off-by: Alexander Kozhinov <[email protected]>
show gain value at runtime as a starting
use ADC calibration before conversion
update README with sample gain prints

Signed-off-by: Alexander Kozhinov <[email protected]>
This commit introduces the DT_INST_STRING_TOKEN_BY_IDX_OR
and DT_INST_STRING_TOKEN_BY_IDX macros, which allows
specifying a default value if the indexed string token is not
defined.

Signed-off-by: Alexander Kozhinov <[email protected]>
add tests for DT_STRING_TOKEN_BY_IDX_OR macro
add tests for DT_INST_STRING_TOKEN_BY_IDX_OR macro

Signed-off-by: Alexander Kozhinov <[email protected]>
common STM32 OPAMP properties (st,stm32-opamp.yaml)
stm32g4-specific OPAMP configuration (st,stm32g4-opamp.yaml)

Signed-off-by: Alexander Kozhinov <[email protected]>
add OPAMP1-6 peripheral nodes to STM32G4 device tree

Signed-off-by: Alexander Kozhinov <[email protected]>
add Kconfig options for stm32 opamp driver
add conditional source target to cmake file

Signed-off-by: Alexander Kozhinov <[email protected]>
implement operational amplifier driver for stm32g4 series

Signed-off-by: Alexander Kozhinov <[email protected]>
add NUCLEO-G474RE board overlay for OPAMP output_measure sample

Signed-off-by: Alexander Kozhinov <[email protected]>
add nucleo_g474re OPAMP to build_all driver test suite.

Signed-off-by: Alexander Kozhinov <[email protected]>
add nucleo_g474re OPAMP support to the generic opamp_api test

Signed-off-by: Alexander Kozhinov <[email protected]>
add extensive test suite for nucleo_g474re OPAMP driver covering most
features and configurations.

Signed-off-by: Alexander Kozhinov <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants