Skip to content

Add support for the AD-SWIOT1L-SL board - #734

Draft
CiprianRegus wants to merge 4 commits into
mainfrom
release/ad-swiot1l-sl
Draft

Add support for the AD-SWIOT1L-SL board#734
CiprianRegus wants to merge 4 commits into
mainfrom
release/ad-swiot1l-sl

Conversation

@CiprianRegus

@CiprianRegus CiprianRegus commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (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)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Hardware:
  • OS:

Documentation

If this is a new feature or example please mention or link any documentation. All new hardware interface classes require documentation.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Add a new class for the AD74413R software IO device. Also implement
basic testing for data capturing via the drivers's IIO buffer.

Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
Add a new class for the MAX14906 digital io device.

Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
The AD-SWIOT1L-SL board is a software configurable analog and digital
I/O with 10BASE-T1L development platform. The board has 4 I/O channels
that can be routed to either the AD74413R (analog) or the MAX14906
(digital) I/O. Since the IIO framework (and LibIIO) doesn't allow
changing the context without a rescan, we have to configure the channel
functions through a virtual IIO device (named "swiot").

The system has 2 states: config (allows caching the channel functions
using the swiot device) and runtime (the IIO devices are configured
with the cached functions and we can use them to write/read data). The
transition between the two modes is done using the "mode" attribute
of the swiot device. Whenever the "config" mode is set, the I/O channels
of the board are set in high-Z mode.

Add the swiot1l class to interract with the devices attributes. One
additional particularity is the adt75_iio interface. Theoretically, the
LM75 pyadi-iio class should support the ADT75, however the no-OS driver
for the ADT75 is implemented as an IIO device (with IIO specific
attributes), while the pyadi-iio implementation requires the Linux
hwmon driver. No-OS also has the lm75 driver, which has hwmon
attributes, but it's now being used in the swiot1l firmware project. In
the end the best way of handling this would be to swap the adt75 driver
with the lm75 one, but that requires changing the firmware on the
swiot1l board. For now, implement the adt75 iio class only as part of
swiot1l.

Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

Test Results

1 825 tests  +13     508 ✅ ± 0   4m 27s ⏱️ +3s
    1 suites ± 0   1 306 💤 + 2 
    1 files   ± 0      11 ❌ +11 

For more details on these failures, see this check.

Results for commit 0907805. ± Comparison against base commit 39313ed.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown

Generated documentation for this PR is available at Link

@CiprianRegus
CiprianRegus marked this pull request as draft April 14, 2026 15:29
@CiprianRegus
CiprianRegus marked this pull request as draft April 14, 2026 15:29

@thorenscientific thorenscientific 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.

@CiprianRegus a couple of suggestions for you. I have not played with the swiot1l much, but the ad74413r seems in the same continuum as ad5592r type devices.
@plescaevelyn has opened #737, so maybe hold off until that's merged before changing this from draft to normal PR.

Comment thread adi/swiot1l.py
no-os which exposes hwmon attributes).
"""

class adt75_iio(context_manager, attribute):

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.

Could you use https://github.com/analogdevicesinc/pyadi-iio/blob/main/adi/lm75.py ? It might need to be extended to support adt75 device name, but they're supported by the same driver.

Comment thread adi/ad74413r.py
def reg_write(self, reg, value):
return self._ctrl.reg_write(reg, value)

class _channel(attribute):

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.

I believe this is one of those "highly configurable" parts - take a peek at https://github.com/analogdevicesinc/pyadi-iio/blob/main/adi/ad5592r.py . Channel names get _adc or _dac appended accordingly, convenience call functions are there, etc.

- Add temperature_controller.py: Configure SWIO boards to read
  temperature data from TMP01/ADT75 and control a fan based on
  temperature thresholds with hysteresis
- Add tmp01_example.py: Reading example for AD-SWIOT1L-SL with
  AD74413R voltage input channels

Signed-off-by: Evelyn-Iulia Plesca <evelyn-iulia.plesca@analog.com>
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.

3 participants