zephyr/modules/hal_afbr/platform_misc.c
Luis Ubieda f9d9e5bb6d modules: afbr: Add basic functionality
- Add AFBR module as a HAL.
- Platform layer to support running AFBR API using Zephyr.
- Ability to instantiate on device-tree.
- Samples in the module proving foundations works.
- Zephyr Sensor API support, by introducing:
    - Read/Decode for SENSOR_CHAN_DISTANCE (1-D results).
    - Streaming mode for DATA_READY (1-D results).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-28 21:29:13 +02:00

25 lines
484 B
C

/*
* Copyright (c) 2025 Croxel Inc.
* Copyright (c) 2025 CogniPilot Foundation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <api/argus_api.h>
/** Used to get instance data from slave index */
#include <../drivers/sensor/broadcom/afbr_s50/platform.h>
argus_hnd_t *Argus_GetHandle(s2pi_slave_t spi_slave)
{
struct afbr_s50_platform_data *data;
int err;
err = afbr_s50_platform_get_by_id(spi_slave, &data);
if (err) {
return NULL;
}
return data->argus.handle;
}