Skip to content

adf4377: add bleed delay & channel inversion, migrate eval project to STM32#3214

Open
skucukar wants to merge 4 commits into
mainfrom
dev/adf4377
Open

adf4377: add bleed delay & channel inversion, migrate eval project to STM32#3214
skucukar wants to merge 4 commits into
mainfrom
dev/adf4377

Conversation

@skucukar

Copy link
Copy Markdown
Collaborator

Pull Request Description

Driver

  • Add bleed-delay set/get (in femtoseconds) and clock/channel inversion set/get helpers.
  • Rework bleed word handling (enable + polarity bits, correct 0x15/0x16 layout, signed storage).
  • Make init non-fatal on chip-type/scratchpad/device-ID checks, drive CE/CLK GPIOs high, handle VCO lock timeout, clamp reference divider ≥ 1.
  • Cleanup: <malloc.h> → <stdlib.h>, fix ADF4377_SINGLE_INSTR mask, return -ETIMEDOUT on lock failure.

IIO

  • Add bleed_delay device attribute and per-channel inv attribute; debug reg callbacks now take void *dev.

Docs & Project

  • Document the new APIs/attributes in the driver README.
  • Migrate the adf4377_sdz eval project from Mbed (EoL) to STM32.

Testing

  • Built and tested on STM32 (SDP-CK1Z) with the basic and IIO examples.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have complied with the Submission Checklist
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

$(PLATFORM_DRIVERS)/stm32_irq.c \
$(PLATFORM_DRIVERS)/stm32_gpio_irq.c \
$(PLATFORM_DRIVERS)/stm32_uart.c \
$(PLATFORM_DRIVERS)/stm32_uart_stdio.c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All .mk files needs to be removed as well.

I think you need to rebase off main branch which was updated today to migrate xilinx builds to the cmake/Kconfig build system.

Comment thread projects/adf4377_sdz/Makefile Outdated
@@ -1,8 +1,8 @@
PLATFORM = mbed
# PLATFORM = xilinx
PLATFORM = stm32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makefile needs to be removed as well

Comment thread projects/adf4377_sdz/builds.json Outdated
@@ -1,10 +1,10 @@
{
"mbed": {
"stm32": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

builds.json needs to be removed, this build configuration is autodetected by the CI

@buha buha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rebase off fresh main and delete those files

skucukar added 3 commits July 16, 2026 16:25
Add adf4377_set_bleed_delay() and adf4377_get_bleed_delay() to program
and read back the bleed delay in femtoseconds, with a helper that derives
the delay per bleed-word step from the charge pump current and the PFD
frequency. Rework the bleed word set/get to handle the enable and
polarity bits and the correct 0x15/0x16 register layout, and store
bleed_word as signed to preserve polarity.

Add clock output and per-channel inversion set/get helpers.

Make init non-fatal on the chip type, scratchpad and device ID checks by
emitting warnings instead of aborting, drive the CE and CLK enable GPIOs
high explicitly, and treat a VCO lock timeout during setup as a warning.
Clamp the reference divider to a minimum of 1 and guard the PFD
computation against a zero divider.

Replace the deprecated <malloc.h> include with <stdlib.h>, fix the
ADF4377_SINGLE_INSTR mask name, and return -ETIMEDOUT on lock failure.

Assisted-by: Claude Opus 4.8
Signed-off-by: Sirac Kucukarabacioglu <sirac.kucukarabacioglu@analog.com>
Expose the new bleed delay and per-channel inversion controls through
the IIO interface. Add a device-level "bleed_delay" attribute backed by
adf4377_get/set_bleed_delay() and a per-channel "inv" attribute backed
by adf4377_get/set_channel_inv(), with the matching enum IDs.

Change the debug register read/write callbacks to take a void *dev and
cast to struct adf4377_iio_dev internally, matching the iio debug
callback signature. Mark the device-level attributes as
IIO_SHARED_BY_ALL.

Assisted-by: Claude Opus 4.8
Signed-off-by: Sirac Kucukarabacioglu <sirac.kucukarabacioglu@analog.com>
Document the bleed delay and channel inversion APIs and their IIO
attributes in the ADF4377 driver README.

Assisted-by: Claude Opus 4.8

Signed-off-by: Sirac Kucukarabacioglu <sirac.kucukarabacioglu@analog.com>
Project migrated from Mbed(EoL) to STM32 platform.
Its tested and documentation updated.
Kconfig added.

Assisted-by: Claude Opus 4.8
Signed-off-by: Sirac Kucukarabacioglu sirac.kucukarabacioglu@analog.com
@skucukar skucukar closed this Jul 17, 2026
@skucukar skucukar reopened this Jul 17, 2026
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.

2 participants