Skip to content

boards: shields: Add EVAL-ADXL367-ARDZ accelerometer shield and streaming configuration #88644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vladislav-pejic
Copy link
Contributor

@vladislav-pejic vladislav-pejic commented Apr 15, 2025

Add a new shield definition for the Analog Devices EVAL-ADXL367-ARDZ
accelerometer shield. This shield provides support for an ADI ADXL367
accelerometer over an Arduino SPI connector.
Also adds adxl367 streaming configuration to accelerometer samples.

Signed-off-by: Vladislav Pejic [email protected]

Comment on lines 8 to 10
aliases {
accel0 = &adxl367_eval_adxl367_ardz;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

just move this to the shield's overlay so that "everyone" just benefits from this alias when using the shield.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it ok now?

@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch 3 times, most recently from 49d9682 to 2e6312f Compare April 15, 2025 11:12
@ubieda
Copy link
Member

ubieda commented Apr 15, 2025

I'm wondering whether this should be a device-tree property. That way multiple instances can be configured differently

@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch 2 times, most recently from 285527c to 9230a08 Compare April 16, 2025 08:52
@@ -232,6 +232,16 @@
#define ADXL367_ACCEL_4G_LSB_PER_G 2000
#define ADXL367_ACCEL_8G_LSB_PER_G 1000

#if CONFIG_ADXL367_FIFO_DISABLED
# define ADXL367_DEFAULT_FIFO_MODE ADXL367_FIFO_DISABLED
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we not do this weird indent and just do #define normally

Add a new shield definition for the Analog Devices EVAL-ADXL367-ARDZ
accelerometer shield. This shield provides support for an ADI ADXL367
accelerometer over an Arduino SPI connector.

Signed-off-by: Vladislav Pejic <[email protected]>
@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch 8 times, most recently from 5dfd2b5 to 2217b9b Compare April 24, 2025 12:23
@vladislav-pejic
Copy link
Contributor Author

I'm wondering whether this should be a device-tree property. That way multiple instances can be configured differently

Agree

Done!

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

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

Thanks @vladislav-pejic !

Comment on lines 53 to 58
Accelerometer FIFO Mode. If not set, default value is ADXL367_FIFO_MODE_DISABLED.
enum:
- 0 # ADXL367_FIFO_MODE_DISABLED
- 1 # ADXL367_FIFO_MODE_OLDEST_SAVED
- 2 # ADXL367_FIFO_MODE_STREAM
- 3 # ADXL367_FIFO_MODE_TRIGGERED
Copy link
Member

Choose a reason for hiding this comment

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

Need to explain in the description why the default value was selected
https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#dt-bindings-default-rules

The enumeration decoding needs to be moved from comments to the description so it will be included in the rendered documentation.

MaureenHelm
MaureenHelm previously approved these changes Apr 24, 2025
@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch from 2173a49 to 8c796fd Compare April 24, 2025 13:29
@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch 2 times, most recently from c3780f1 to 2b4af5d Compare April 24, 2025 18:33
Comment on lines 1118 to 1119
.fifo_config.fifo_mode = \
DT_INST_PROP_OR(inst, fifo_mode, ADXL367_FIFO_DISABLED), \
Copy link
Collaborator

Choose a reason for hiding this comment

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

end of line alignment seems off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Add support for setting FIFO mode using DT property.

Signed-off-by: Vladislav Pejic <[email protected]>
Adds adxl367 streaming configuration to accelerometer samples.

Signed-off-by: Vladislav Pejic <[email protected]>
@vladislav-pejic vladislav-pejic force-pushed the shield_eval_adxl367_ardz branch from 2b4af5d to f09dc4e Compare April 25, 2025 09:17
@kartben kartben merged commit 644dd75 into zephyrproject-rtos:main Apr 28, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Samples Samples area: Sensors Sensors area: Shields Shields (add-on boards) platform: ADI Analog Devices, Inc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants