Commit graph

6 commits

Author SHA1 Message Date
Alexander Apostolu
2e7ec2bc29 drivers: sensor: adi: adxl372: Remove logically dead code
Remove logically dead if and else-if conditions as shown by the static
analysis, replacing with the else statement.

When data_opt is assigned to the MIN of fifo_wmark_cfg and fifo_full_cfg,
both those variables will be non-NULL as an earlier condition ensures the
function returns if either one of the variables is NULL before assigning
to data_opt.

Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
2025-06-17 07:22:34 +02:00
Vladislav Pejic
e72e1c1c44 drivers: sensor: adxl372: FIFO mode from DT
Adds support for setting FIFO mode and water-mark from DT.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2025-04-28 12:55:18 -05:00
Luis Ubieda
5847680e1e sensor: adxl367 and adxl372: fix build-failure with streaming mode
These two sensors do not build with asserts enabled as they're
referencing a non-existent variable `pkt_size`.

Replaced for what (AFAIK) is the intended variable.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-21 04:39:16 +01:00
Luis Ubieda
5a9ff03c21 sensor: adxl3xx: Move run-time modification of ODR from cfg to data
Config struct is constant and attempting to modify it triggers a fault.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-01-15 19:05:45 +01:00
Mark Chen
f4da9b9705 drivers: sensor: Add sensor clock API support
This commit introduces a new Sensor Clock API, enabling the retrieval
of cycle counts and conversion to nanoseconds based on the system or
external clock. The API includes:

- `sensor_clock_get_cycles()` to get the current cycle count from the
  sensor clock.
- `sensor_clock_cycles_to_ns()` to convert cycles to nanoseconds using
  the clock's frequency.

The implementation supports both system clocks and external clocks
defined in the device tree, making the sensor clock integration more
flexible for various sensor use cases.

Signed-off-by: Mark Chen <mark.chen@cienet.com>
2025-01-15 19:03:13 +01:00
Vladislav Pejic
cfe64f7f1c drivers: sensor: adxl372: Updated driver with RTIO stream functionality
Updated ADXL372 driver with RTIO stream functionality.
RTIO stream is using both FIFO threshold and FIFO full triggers.
Together with RTIO stream, RTIO async read is also implemented.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-10-22 18:30:13 -04:00