acc_control_helper.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "acc_control_helper.h"
#include "acc_hal_integration_a121.h"
#include "acc_integration.h"
#include "acc_rss_a121.h"

Go to the source code of this file.

Macros

#define SENSOR_CALIBRATION_TIMEOUT_MS   500
 
#define SENSOR_MEASURE_TIMEOUT_MS   1000
 

Functions

static bool acc_control_helper_calibrate (acc_control_helper_t *radar)
 
bool acc_control_helper_create (acc_control_helper_t *radar, acc_sensor_id_t sensor_id)
 Create a helper instance. More...
 
void acc_control_helper_destroy (acc_control_helper_t *radar)
 Destroy a helper instance. More...
 
bool acc_control_helper_activate (acc_control_helper_t *radar)
 Activate the sensor. More...
 
bool acc_control_helper_get_next (acc_control_helper_t *radar)
 Perform a radar measurement and wait for the result. More...
 

Macro Definition Documentation

◆ SENSOR_CALIBRATION_TIMEOUT_MS

#define SENSOR_CALIBRATION_TIMEOUT_MS   500
Examples
acc_control_helper.c.

Definition at line 18 of file acc_control_helper.c.

◆ SENSOR_MEASURE_TIMEOUT_MS

#define SENSOR_MEASURE_TIMEOUT_MS   1000
Examples
acc_control_helper.c.

Definition at line 19 of file acc_control_helper.c.

Function Documentation

◆ acc_control_helper_activate()

bool acc_control_helper_activate ( acc_control_helper_t radar)

Activate the sensor.

After a successful call to this function the following members of the acc_control_helper_t struct are updated:

buffer_size: The size of the allocated buffer sensor: Pointer to sensor instance processing: Pointer to processing instance cal_result: The calibration data

Parameters
radarA pointer to an acc_control_helper_t struct
Returns
true if successful, false otherwise
Examples
acc_control_helper.c.

Definition at line 81 of file acc_control_helper.c.

◆ acc_control_helper_calibrate()

static bool acc_control_helper_calibrate ( acc_control_helper_t radar)
static
Examples
acc_control_helper.c.

Definition at line 22 of file acc_control_helper.c.

◆ acc_control_helper_create()

bool acc_control_helper_create ( acc_control_helper_t radar,
acc_sensor_id_t  sensor_id 
)

Create a helper instance.

After a successful call to this function all members of the the acc_control_helper_t are initialized to default values and the config member is created.

Parameters
radarA pointer to an acc_control_helper_t struct. The members in this struct will be initialized.
sensor_idThe sensor id
Returns
true if successful, false otherwise
Examples
acc_control_helper.c.

Definition at line 41 of file acc_control_helper.c.

◆ acc_control_helper_destroy()

void acc_control_helper_destroy ( acc_control_helper_t radar)

Destroy a helper instance.

Parameters
radarA pointer to an acc_control_helper_t struct
Examples
acc_control_helper.c.

Definition at line 50 of file acc_control_helper.c.

◆ acc_control_helper_get_next()

bool acc_control_helper_get_next ( acc_control_helper_t radar)

Perform a radar measurement and wait for the result.

After each call to this function the "proc_result" member of the acc_control_helper_t is updated.

Parameters
radarA pointer to an acc_control_helper_t struct
Returns
true if successful, false otherwise
Examples
acc_control_helper.c.

Definition at line 157 of file acc_control_helper.c.