Skip to content

Staging/adxl366#3042

Closed
marcocrio wants to merge 5 commits intoanalogdevicesinc:mainfrom
marcocrio:staging/adxl366
Closed

Staging/adxl366#3042
marcocrio wants to merge 5 commits intoanalogdevicesinc:mainfrom
marcocrio:staging/adxl366

Conversation

@marcocrio
Copy link
Copy Markdown

@marcocrio marcocrio commented Mar 31, 2026

Pull Request Description

Add ADXL366 ultra-low-power 3-axis accelerometer driver with complete Phase 1 feature set and hardware-validated evaluation project.

Driver Implementation (15 functions):

adxl366_init() - Device initialization
adxl366_remove() - Cleanup and removal
adxl366_reg_read() - Single register read
adxl366_reg_write() - Single register write
adxl366_reg_read_multiple() - Multi-byte register read
adxl366_set_range() - Set measurement range (±2g/±4g/±8g)
adxl366_get_range() - Get measurement range
adxl366_set_odr() - Set output data rate (12.5Hz-400Hz)
adxl366_get_odr() - Get output data rate
adxl366_set_power_mode() - Set power mode (standby/measure)
adxl366_get_power_mode() - Get power mode
adxl366_read_accel() - Read 14-bit X/Y/Z acceleration data
adxl366_read_temperature() - Read temperature sensor
adxl366_get_status() - Read status register
adxl366_software_reset() - Software reset

Evaluation Project (MAX32655 FTHR):

Basic example: continuous accelerometer streaming
Comprehensive test: validates all 14 functions with explicit labeling
VSCode integration: build/flash tasks, IntelliSense paths configured
DEVELOPMENT.md: detailed strategy, technical decisions, upstream plan

Hardware Testing (March 30th, 2026):
ALL 14 FUNCTIONS TESTED AND PASSED on MAX32655 FTHR + ADXL366Z:
✅ Function 1: Device initialization
✅ Function 2: Register read (device ID verification)
✅ Functions 3-4: Range configuration (±2g, ±4g, ±8g)
✅ Functions 5-6: ODR configuration (12.5Hz, 50Hz, 100Hz, 400Hz)
✅ Functions 7-8: Temperature reading (25°C measured)
✅ Function 9: Accelerometer data (~1.4g magnitude measured)
✅ Function 10: Status register (DATA_RDY, AWAKE bits verified)
✅ Function 11: Register write operation
✅ Function 12: Multi-byte read operation
✅ Functions 13-14: Power mode control (standby/measure)

Project Structure:

Phase A (MAX32655): COMPLETE - ready for upstream contribution
Phase B (nRF54L15 with SDK): Next - after Phase A PR submitted
Phase C (Bare-metal nRF): Required - all phases must complete sequentially

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

Add ADXL366 ultra-low-power 3-axis accelerometer driver with complete
Phase 1 feature set and hardware-validated evaluation project.

Driver Implementation (15 functions):
- adxl366_init() - Device initialization
- adxl366_remove() - Cleanup and removal
- adxl366_reg_read() - Single register read
- adxl366_reg_write() - Single register write
- adxl366_reg_read_multiple() - Multi-byte register read
- adxl366_set_range() - Set measurement range (±2g/±4g/±8g)
- adxl366_get_range() - Get measurement range
- adxl366_set_odr() - Set output data rate (12.5Hz-400Hz)
- adxl366_get_odr() - Get output data rate
- adxl366_set_power_mode() - Set power mode (standby/measure)
- adxl366_get_power_mode() - Get power mode
- adxl366_read_accel() - Read 14-bit X/Y/Z acceleration data
- adxl366_read_temperature() - Read temperature sensor
- adxl366_get_status() - Read status register
- adxl366_software_reset() - Software reset

Evaluation Project (MAX32655 FTHR):
- Basic example: continuous accelerometer streaming
- Comprehensive test: validates all 14 functions with explicit labeling
- VSCode integration: build/flash tasks, IntelliSense paths configured
- DEVELOPMENT.md: detailed strategy, technical decisions, upstream plan

Hardware Testing (March 30th, 2026):
ALL 14 FUNCTIONS TESTED AND PASSED on MAX32655 FTHR + ADXL366Z:
✅ Function 1: Device initialization
✅ Function 2: Register read (device ID verification)
✅ Functions 3-4: Range configuration (±2g, ±4g, ±8g)
✅ Functions 5-6: ODR configuration (12.5Hz, 50Hz, 100Hz, 400Hz)
✅ Functions 7-8: Temperature reading (25°C measured)
✅ Function 9: Accelerometer data (~1.4g magnitude measured)
✅ Function 10: Status register (DATA_RDY, AWAKE bits verified)
✅ Function 11: Register write operation
✅ Function 12: Multi-byte read operation
✅ Functions 13-14: Power mode control (standby/measure)

Project Structure:
- Phase A (MAX32655): COMPLETE - ready for upstream contribution
- Phase B (nRF54L15 with SDK): Next - after Phase A PR submitted
- Phase C (Bare-metal nRF): Required - all phases must complete sequentially

Signed-off-by: Marco A Ramirez Castro <marco.ramirezcastro@analog.com>
Apply astyle formatting rules to pass CI checks:
- Fix spacing and indentation in adxl366.c and adxl366.h
- Fix formatting in comprehensive_example.c

Signed-off-by: Marco A Ramirez Castro <marco.ramirezcastro@analog.com>
Add README.rst documentation for ADXL366 driver including:
- Device overview and applications
- Driver initialization and configuration
- Usage examples for SPI communication
- Temperature and acceleration data reading

Signed-off-by: Marco A Ramirez Castro <marco.ramirezcastro@analog.com>
Add README.rst documentation for eval-adxl366z project including:
- Project overview and hardware specifications
- Basic and comprehensive test examples
- MAX32655 platform connection details
- Build and flash instructions
- Hardware test results summary

Signed-off-by: Marco A Ramirez Castro <marco.ramirezcastro@analog.com>
Add Sphinx RST includes for ADXL366 driver and eval-adxl366z project
to integrate with no-OS documentation build system.

Signed-off-by: Marco A Ramirez Castro <marco.ramirezcastro@analog.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@amiclaus amiclaus left a comment

Choose a reason for hiding this comment

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

i started the review but looking through the datasheets it raises one big question. why is this driver not included in the adxl367? the functional diagrams look identical.

Comment thread .vscode/settings.json
@@ -0,0 +1,6 @@
{
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.

this file should not be included.

* @brief Initialize the device.
*/
int adxl366_init(struct adxl366_dev **device,
struct adxl366_init_param init_param)
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.

this should be passed by pointer not value.

return -EINVAL;

/* Read 6 bytes starting from XDATA_H */
ret = adxl366_reg_read_multiple(dev, ADXL366_REG_XDATA_H, buf, 6);
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.

don't you need to check data_rdy bit?

return ret;

/* Combine high and low bytes (14-bit data in upper 14 bits) */
*x = ((int16_t)buf[0] << 8) | buf[1];
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.

consider using the approach in adxl367:

 if (*x & NO_OS_BIT(13))
     *x |= NO_OS_GENMASK(15, 14);

@marcocrio
Copy link
Copy Markdown
Author

i started the review but looking through the datasheets it raises one big question. why is this driver not included in the adxl367? the functional diagrams look identical.

I guess you're right, examining the ADXL367 driver closely, it seems to be a 100% compatible with the ADXL336. I may close the PR unless for organizing purposes an ADXL366 driver may want to be added

Copy link
Copy Markdown
Contributor

@amiclaus amiclaus left a comment

Choose a reason for hiding this comment

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

i started the review but looking through the datasheets it raises one big question. why is this driver not included in the adxl367? the functional diagrams look identical.

I guess you're right, examining the ADXL367 driver closely, it seems to be a 100% compatible with the ADXL336. I may close the PR unless for organizing purposes an ADXL366 driver may want to be added

you can have a look at other drivers that support multiple parts (currently usually through an enum device_type or similar).

@buha
Copy link
Copy Markdown
Contributor

buha commented Apr 20, 2026

please reopen when you continue the development

@buha buha closed this Apr 20, 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.

5 participants