Data Structures | Macros | Enumerations | Functions
ref_app_breathing.c File Reference
`#include <math.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <string.h>`
`#include "acc_alg_basic_utils.h"`
`#include "acc_algorithm.h"`
`#include "acc_definitions_a121.h"`
`#include "acc_definitions_common.h"`
`#include "acc_detector_presence.h"`
`#include "acc_hal_definitions_a121.h"`
`#include "acc_hal_integration_a121.h"`
`#include "acc_integration.h"`
`#include "acc_processing.h"`
`#include "acc_rss_a121.h"`
`#include "acc_sensor.h"`
`#include "acc_version.h"`

Go to the source code of this file.

## Data Structures
struct | acc_breathing_config_t
| Breathing application config container. More...
struct | acc_breathing_handle_t
| Breathing application context handle. More...
struct | acc_breathing_result_t
| Breathing application results container. More...

## Macros
#define | SENSOR_ID (1U)
#define | SENSOR_TIMEOUT_MS (1000U)
#define | ACC_ALGORITHM_APPROX_BASE_STEP_LENGTH_M (2.5e-3f)
#define | DEFAULT_PRESET_CONFIG BREATHING_PRESET_SITTING
#define | B_STATIC_LENGTH (3U)
#define | A_STATIC_LENGTH (2U)
#define | B_ANGLE_LENGTH (5U)
#define | A_ANGLE_LENGTH (4U)

## Enumerations
enum | breathing_preset_t { BREATHING_PRESET_NONE, BREATHING_PRESET_SITTING, BREATHING_PRESET_INFANT }
enum | acc_breathing_app_state_t { ACC_BREATHING_APP_STATE_INIT, ACC_BREATHING_APP_STATE_NO_PRESENCE, ACC_BREATHING_APP_STATE_INTRA_PRESENCE, ACC_BREATHING_APP_STATE_DETERMINE_DISTANCE, ACC_BREATHING_APP_STATE_ESTIMATE_BREATHING_RATE }

## Functions
static void | cleanup (acc_breathing_handle_t *handle, acc_breathing_config_t *config)
static void | set_config (acc_breathing_config_t *config, breathing_preset_t preset)
static bool | validate_config (acc_breathing_config_t *config)
static bool | init_handle (acc_breathing_handle_t *handle, acc_breathing_config_t *config)
static bool | init_sensor_resources (acc_breathing_handle_t *handle, acc_breathing_config_t *config)
static bool | sensor_calibration (acc_breathing_handle_t *handle)
static bool | reinit_breathing (acc_breathing_handle_t *handle, uint16_t start_point, uint16_t end_point)
static bool | measure (acc_breathing_handle_t *handle, acc_detector_presence_result_t *presence_result)
static bool | enter_hibernate (acc_sensor_t *sensor)
static bool | exit_hibernate (acc_sensor_t *sensor)
static void | determine_state (acc_breathing_handle_t *handle, acc_detector_presence_result_t *presence_result)
static void | update_presence_distance (acc_breathing_handle_t *handle, float presence_distance)
static bool | perform_action_based_on_state (acc_breathing_handle_t *handle, acc_int16_complex_t *frame, acc_breathing_result_t *result)
static bool | process_breathing (acc_breathing_handle_t *handle, acc_int16_complex_t *frame, acc_breathing_result_t *result)
static void | print_app_state (acc_breathing_handle_t *handle)
static void | print_result (acc_breathing_result_t *result)
static bool | check_indications (acc_breathing_handle_t *handle, acc_breathing_config_t *config, acc_detector_presence_result_t *presence_result, bool *recalibration_done)
int | acconeer_main (int argc, char *argv[])
| Assembly test example. More...

## Macro Definition Documentation

## ◆ A_ANGLE_LENGTH

#define A_ANGLE_LENGTH (4U)

Definition at line 43 of file ref_app_breathing.c.

## ◆ A_STATIC_LENGTH

#define A_STATIC_LENGTH (2U)

Definition at line 41 of file ref_app_breathing.c.

## ◆ ACC_ALGORITHM_APPROX_BASE_STEP_LENGTH_M

#define ACC_ALGORITHM_APPROX_BASE_STEP_LENGTH_M (2.5e-3f)

Definition at line 36 of file ref_app_breathing.c.

## ◆ B_ANGLE_LENGTH

#define B_ANGLE_LENGTH (5U)

Definition at line 42 of file ref_app_breathing.c.

## ◆ B_STATIC_LENGTH

#define B_STATIC_LENGTH (3U)

Definition at line 40 of file ref_app_breathing.c.

## ◆ DEFAULT_PRESET_CONFIG

#define DEFAULT_PRESET_CONFIG BREATHING_PRESET_SITTING

Definition at line 38 of file ref_app_breathing.c.

## ◆ SENSOR_ID

#define SENSOR_ID (1U)

Definition at line 33 of file ref_app_breathing.c.

## ◆ SENSOR_TIMEOUT_MS

#define SENSOR_TIMEOUT_MS (1000U)

Definition at line 34 of file ref_app_breathing.c.

## Enumeration Type Documentation

## ◆ acc_breathing_app_state_t

enum acc_breathing_app_state_t

Enumerator
ACC_BREATHING_APP_STATE_INIT |
ACC_BREATHING_APP_STATE_NO_PRESENCE |
ACC_BREATHING_APP_STATE_INTRA_PRESENCE |
ACC_BREATHING_APP_STATE_DETERMINE_DISTANCE |
ACC_BREATHING_APP_STATE_ESTIMATE_BREATHING_RATE |

Definition at line 80 of file ref_app_breathing.c.

## ◆ breathing_preset_t

enum breathing_preset_t

Enumerator
BREATHING_PRESET_NONE |
BREATHING_PRESET_SITTING |
BREATHING_PRESET_INFANT |

Definition at line 26 of file ref_app_breathing.c.

## Function Documentation

## ◆ acconeer_main()

int acconeer_main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Assembly test example.

Surface velocity example application.

Tank level reference application.

Smart presence reference application.

Breathing example application.

Service subsweeps example.

Service multple configurations example.

Low power service example.

Service example.

Processing subtract adaptive background example.

Processing static presence example.

Processing peak interpolation example.

Processing noncoherent mean example.

Processing coherent mean example.

Processing amplitude example.

Detector presence example with multiple configurations.

Low power detector presence example.

Detector presence example.

Distance detector low power example.

Detector distance example.

Control helper example.

Returns
  Returns EXIT_SUCCESS if successful, otherwise EXIT_FAILURE

Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)

Test if measure on wake up is enable Do a measurement if the the detector is ready (configured and calibrated)

Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.

Detector filters and states are reset on prepare (reconfiguration) to avoid risk of false detections when switching back to a zone.

Definition at line 234 of file ref_app_breathing.c.

## ◆ check_indications()

static bool check_indications | ( | acc_breathing_handle_t * | handle,
|  | acc_breathing_config_t * | config,
|  | acc_detector_presence_result_t * | presence_result,
|  | bool * | recalibration_done
| ) |  |
| static

Definition at line 1075 of file ref_app_breathing.c.

## ◆ cleanup()

static void cleanup | ( | acc_breathing_handle_t * | handle,
|  | acc_breathing_config_t * | config
| ) |  |
| static

Definition at line 348 of file ref_app_breathing.c.

## ◆ determine_state()

static void determine_state | ( | acc_breathing_handle_t * | handle,
|  | acc_detector_presence_result_t * | presence_result
| ) |  |
| static

Definition at line 799 of file ref_app_breathing.c.

## ◆ enter_hibernate()

static bool enter_hibernate | ( | acc_sensor_t * | sensor | ) |
| static

Definition at line 767 of file ref_app_breathing.c.

## ◆ exit_hibernate()

static bool exit_hibernate | ( | acc_sensor_t * | sensor | ) |
| static

Definition at line 783 of file ref_app_breathing.c.

## ◆ init_handle()

static bool init_handle | ( | acc_breathing_handle_t * | handle,
|  | acc_breathing_config_t * | config
| ) |  |
| static

Definition at line 522 of file ref_app_breathing.c.

## ◆ init_sensor_resources()

static bool init_sensor_resources | ( | acc_breathing_handle_t * | handle,
|  | acc_breathing_config_t * | config
| ) |  |
| static

Definition at line 627 of file ref_app_breathing.c.

## ◆ measure()

static bool measure | ( | acc_breathing_handle_t * | handle,
|  | acc_detector_presence_result_t * | presence_result
| ) |  |
| static

Definition at line 722 of file ref_app_breathing.c.

## ◆ perform_action_based_on_state()

static bool perform_action_based_on_state | ( | acc_breathing_handle_t * | handle,
|  | acc_int16_complex_t * | frame,
|  | acc_breathing_result_t * | result
| ) |  |
| static

Definition at line 842 of file ref_app_breathing.c.

## ◆ print_app_state()

static void print_app_state | ( | acc_breathing_handle_t * | handle | ) |
| static

Definition at line 1042 of file ref_app_breathing.c.

## ◆ print_result()

static void print_result | ( | acc_breathing_result_t * | result | ) |
| static

Definition at line 1066 of file ref_app_breathing.c.

## ◆ process_breathing()

static bool process_breathing | ( | acc_breathing_handle_t * | handle,
|  | acc_int16_complex_t * | frame,
|  | acc_breathing_result_t * | result
| ) |  |
| static

Definition at line 909 of file ref_app_breathing.c.

## ◆ reinit_breathing()

static bool reinit_breathing | ( | acc_breathing_handle_t * | handle,
|  | uint16_t | start_point,
|  | uint16_t | end_point
| ) |  |
| static

Definition at line 697 of file ref_app_breathing.c.

## ◆ sensor_calibration()

static bool sensor_calibration | ( | acc_breathing_handle_t * | handle | ) |
| static

Definition at line 657 of file ref_app_breathing.c.

## ◆ set_config()

static void set_config | ( | acc_breathing_config_t * | config,
|  | breathing_preset_t | preset
| ) |  |
| static

Definition at line 451 of file ref_app_breathing.c.

## ◆ update_presence_distance()

static void update_presence_distance | ( | acc_breathing_handle_t * | handle,
|  | float | presence_distance
| ) |  |
| static

Definition at line 824 of file ref_app_breathing.c.

## ◆ validate_config()

static bool validate_config | ( | acc_breathing_config_t * | config | ) |
| static

Definition at line 494 of file ref_app_breathing.c.