Add support for the AD-SWIOT1L-SL board - #734
Conversation
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>
Test Results1 825 tests +13 508 ✅ ± 0 4m 27s ⏱️ +3s 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. |
|
Generated documentation for this PR is available at Link |
thorenscientific
left a comment
There was a problem hiding this comment.
@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.
| no-os which exposes hwmon attributes). | ||
| """ | ||
|
|
||
| class adt75_iio(context_manager, attribute): |
There was a problem hiding this comment.
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.
| def reg_write(self, reg, value): | ||
| return self._ctrl.reg_write(reg, value) | ||
|
|
||
| class _channel(attribute): |
There was a problem hiding this comment.
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>
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.
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 Configuration:
Documentation
If this is a new feature or example please mention or link any documentation. All new hardware interface classes require documentation.
Checklist: