Go to the documentation of this file.
18 #define SENSOR_CALIBRATION_TIMEOUT_MS 500
19 #define SENSOR_MEASURE_TIMEOUT_MS 1000
25 bool cal_complete =
false;
31 if (cal_status && !cal_complete)
35 }
while (cal_status && !cal_complete);
46 return radar->
config != NULL ? true :
false;
86 fprintf(stderr,
"Failed to create processing\n");
92 fprintf(stderr,
"acc_rss_get_buffer_size() failed\n");
99 fprintf(stderr,
"acc_rss_get_buffer_size() failed\n");
107 if (radar->
sensor == NULL)
109 fprintf(stderr,
"Failed to create sensor\n");
115 fprintf(stderr,
"calibration failed\n");
124 fprintf(stderr,
"acc_sensor_prepare failed\n");
135 if (radar->
sensor != NULL)
141 if (radar->
buffer != NULL)
161 fprintf(stderr,
"acc_sensor_measure failed\n");
167 fprintf(stderr,
"Sensor interrupt timeout\n");
173 fprintf(stderr,
"acc_sensor_read failed\n");
bool acc_control_helper_get_next(acc_control_helper_t *radar)
Perform a radar measurement and wait for the result.
void acc_hal_integration_sensor_supply_off(acc_sensor_id_t sensor_id)
Power off sensor supply.
acc_sensor_id_t sensor_id
void acc_processing_destroy(acc_processing_t *handle)
Destroy a processing instance identified with the provided processing handle.
void acc_hal_integration_sensor_supply_on(acc_sensor_id_t sensor_id)
Power on sensor supply.
acc_processing_t * processing
bool acc_sensor_read(const acc_sensor_t *sensor, void *buffer, uint32_t buffer_size)
Read out radar data.
void acc_config_destroy(acc_config_t *config)
Destroy a configuration freeing any resources allocated.
#define SENSOR_MEASURE_TIMEOUT_MS
void acc_processing_execute(acc_processing_t *handle, void *buffer, acc_processing_result_t *result)
Process the data according to the configuration used in create.
acc_config_t * acc_config_create(void)
Create a configuration.
void * acc_integration_mem_alloc(size_t size)
Allocate dynamic memory.
acc_processing_metadata_t proc_meta
bool acc_hal_integration_wait_for_sensor_interrupt(acc_sensor_id_t sensor_id, uint32_t timeout_ms)
Wait for a sensor interrupt.
static bool acc_control_helper_calibrate(acc_control_helper_t *radar)
void acc_control_helper_destroy(acc_control_helper_t *radar)
Destroy a helper instance.
void acc_hal_integration_sensor_enable(acc_sensor_id_t sensor_id)
Enable sensor.
void acc_hal_integration_sensor_disable(acc_sensor_id_t sensor_id)
Disable sensor.
acc_cal_result_t cal_result
uint32_t acc_sensor_id_t
Type representing a sensor ID.
void acc_sensor_status(const acc_sensor_t *sensor)
Check the status of the sensor.
bool acc_sensor_prepare(acc_sensor_t *sensor, const acc_config_t *config, const acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size)
Prepare a sensor to do a measurement.
void acc_integration_mem_free(void *ptr)
Free dynamic memory.
#define SENSOR_CALIBRATION_TIMEOUT_MS
bool acc_sensor_calibrate(acc_sensor_t *sensor, bool *cal_complete, acc_cal_result_t *cal_result, void *buffer, uint32_t buffer_size)
Calibrate a sensor.
bool acc_sensor_measure(acc_sensor_t *sensor)
Start a radar measurement with previously prepared configuration.
acc_processing_t * acc_processing_create(const acc_config_t *config, acc_processing_metadata_t *processing_metadata)
Create a processing instance with the provided configuration.
acc_processing_result_t proc_result
bool acc_control_helper_activate(acc_control_helper_t *radar)
Activate the sensor.
void acc_sensor_destroy(acc_sensor_t *sensor)
Destroy a sensor instance freeing any resources allocated.
bool acc_control_helper_create(acc_control_helper_t *radar, acc_sensor_id_t sensor_id)
Create a helper instance.
acc_sensor_t * acc_sensor_create(acc_sensor_id_t sensor_id)
Create a sensor instance.