ref_app_parking.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "acc_definitions_a121.h"
#include "acc_definitions_common.h"

Go to the source code of this file.

Data Structures

struct  ref_app_parking_car_config_t
 Configuration for car detection. More...
 
struct  ref_app_parking_obstruction_config_t
 Configuration for obstruction detection. More...
 
struct  ref_app_parking_config_t
 Overall configuration for parking application. More...
 

Typedefs

typedef struct ref_app_parking_handle ref_app_parking_handle_t
 

Enumerations

enum  ref_app_parking_parking_preset_t { PARKING_PRESET_NONE, PARKING_PRESET_GROUND, PARKING_PRESET_POLE }
 Configuration presets - a set of configurations for a specific sensor placement. More...
 

Functions

void ref_app_parking_set_config (ref_app_parking_parking_preset_t preset, ref_app_parking_config_t *parking_config)
 Set parking config according to specified preset. More...
 
ref_app_parking_handle_tref_app_parking_handle_create (ref_app_parking_config_t *parking_config, acc_sensor_id_t sensor_id)
 Create parking handle. More...
 
void ref_app_parking_handle_destroy (ref_app_parking_handle_t *handle)
 Destroy parking handle. More...
 
bool ref_app_parking_sensor_calibration (ref_app_parking_handle_t *handle)
 Sensor calibration. More...
 
bool ref_app_parking_noise_calibration (ref_app_parking_handle_t *handle)
 Noise calibration. More...
 
bool ref_app_parking_obstruction_calibration (ref_app_parking_handle_t *handle)
 Obstruction calibration. More...
 
bool ref_app_parking_sensor_prepare (ref_app_parking_handle_t *handle)
 Prepare sensor for measurement. More...
 
bool ref_app_parking_measure (ref_app_parking_handle_t *handle, bool hibernate)
 Perform a sensor measurement. More...
 
bool ref_app_parking_handle_indications (ref_app_parking_handle_t *handle, bool *data_reliable)
 Handle indications from a measurement. More...
 
void ref_app_parking_obstruction_process (ref_app_parking_handle_t *handle, bool *obstruction_detected)
 Do obstruction processing. More...
 
void ref_app_parking_process (ref_app_parking_handle_t *handle, bool *car_detected)
 Do parking processing. More...
 

Typedef Documentation

◆ ref_app_parking_handle_t

Definition at line 23 of file ref_app_parking.h.

Enumeration Type Documentation

◆ ref_app_parking_parking_preset_t

Configuration presets - a set of configurations for a specific sensor placement.

Enumerator
PARKING_PRESET_NONE 

No preset, user needs to set each specific parameter themselves

PARKING_PRESET_GROUND 

Sensor placed on ground beneath car, obstruction detection enabled

PARKING_PRESET_POLE 

Sensor placed on pole beside car, obstruction detection disabled

Definition at line 29 of file ref_app_parking.h.

Function Documentation

◆ ref_app_parking_handle_create()

ref_app_parking_handle_t* ref_app_parking_handle_create ( ref_app_parking_config_t parking_config,
acc_sensor_id_t  sensor_id 
)

Create parking handle.

The handle is used for both control and processing

This function enables the sensor

Parameters
[in]parking_configThe parking config used to create the parking handle
[in]sensor_idThe sensor_id for the sensor to be used
Returns
A parking handle, or NULL if creation failed

Definition at line 252 of file ref_app_parking.c.

◆ ref_app_parking_handle_destroy()

void ref_app_parking_handle_destroy ( ref_app_parking_handle_t handle)

Destroy parking handle.

This function disables the sensor

Parameters
[in]handleThe handle to destroy

Definition at line 284 of file ref_app_parking.c.

◆ ref_app_parking_handle_indications()

bool ref_app_parking_handle_indications ( ref_app_parking_handle_t handle,
bool *  data_reliable 
)

Handle indications from a measurement.

Parameters
[in]handleThe handle to do a sensor measurement for
[out]data_reliableFlag to determine if data from measurement is reliable. Se log for more details if false
Returns
true if successful, false otherwise

Definition at line 597 of file ref_app_parking.c.

◆ ref_app_parking_measure()

bool ref_app_parking_measure ( ref_app_parking_handle_t handle,
bool  hibernate 
)

Perform a sensor measurement.

Parameters
[in]handleThe handle to do a sensor measurement for
[in]hibernateHibernate sensor between measurements
Returns
true if successful, false otherwise

Definition at line 554 of file ref_app_parking.c.

◆ ref_app_parking_noise_calibration()

bool ref_app_parking_noise_calibration ( ref_app_parking_handle_t handle)

Noise calibration.

Parameters
[in]handleThe handle to calibrate noise for
Returns
true if successful, false otherwise

Definition at line 390 of file ref_app_parking.c.

◆ ref_app_parking_obstruction_calibration()

bool ref_app_parking_obstruction_calibration ( ref_app_parking_handle_t handle)

Obstruction calibration.

Note that the sensor must be free from obstruction when calling this function.

Parameters
[in]handleThe handle to calibrate obstruction for
Returns
true if successful, false otherwise

Definition at line 445 of file ref_app_parking.c.

◆ ref_app_parking_obstruction_process()

void ref_app_parking_obstruction_process ( ref_app_parking_handle_t handle,
bool *  obstruction_detected 
)

Do obstruction processing.

Parameters
[in]handleThe handle to do obstruction processing for
[out]obstruction_detectedtrue if obstruction detected, false otherwise

Definition at line 663 of file ref_app_parking.c.

◆ ref_app_parking_process()

void ref_app_parking_process ( ref_app_parking_handle_t handle,
bool *  car_detected 
)

Do parking processing.

Parameters
[in]handleThe handle to do parking processing for
[out]car_detectedtrue if car detected, false otherwise

Definition at line 711 of file ref_app_parking.c.

◆ ref_app_parking_sensor_calibration()

bool ref_app_parking_sensor_calibration ( ref_app_parking_handle_t handle)

Sensor calibration.

Parameters
[in]handleThe handle to calibrate sensor for
Returns
true if successful, false otherwise

Definition at line 355 of file ref_app_parking.c.

◆ ref_app_parking_sensor_prepare()

bool ref_app_parking_sensor_prepare ( ref_app_parking_handle_t handle)

Prepare sensor for measurement.

Parameters
[in]handleThe handle to prepare sensor for
Returns
true if successful, false otherwise

Definition at line 537 of file ref_app_parking.c.

◆ ref_app_parking_set_config()

void ref_app_parking_set_config ( ref_app_parking_parking_preset_t  preset,
ref_app_parking_config_t parking_config 
)

Set parking config according to specified preset.

Parameters
[in]presetThe preset used to set parking config
[out]parking_configThe parking config to be set

Definition at line 201 of file ref_app_parking.c.