#include <complex.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "acc_alg_basic_utils.h"
#include "acc_algorithm.h"
#include "acc_detector_presence.h"
#include "acc_integration.h"
#include "ref_app_breathing.h"
Go to the source code of this file.
|
| static bool | validate_config (ref_app_breathing_config_t *config) |
| |
| static void | determine_state (ref_app_breathing_handle_t *handle, acc_detector_presence_result_t *presence_result) |
| |
| static void | update_presence_distance (ref_app_breathing_handle_t *handle, float presence_distance) |
| |
| static bool | reinit_breathing (ref_app_breathing_handle_t *handle, uint16_t start_point, uint16_t end_point) |
| |
| static bool | perform_action_based_on_state (ref_app_breathing_handle_t *handle, acc_int16_complex_t *frame, ref_app_breathing_result_t *result) |
| |
| static bool | process_breathing (ref_app_breathing_handle_t *handle, acc_int16_complex_t *frame, ref_app_breathing_result_t *result) |
| |
| ref_app_breathing_config_t * | ref_app_breathing_config_create (void) |
| | Create a configuration for the ref app breathing. More...
|
| |
| void | ref_app_breathing_config_destroy (ref_app_breathing_config_t *config) |
| | Destory a configuration for the ref app breathing. More...
|
| |
| ref_app_breathing_handle_t * | ref_app_breathing_create (ref_app_breathing_config_t *config) |
| | Create a handle for the ref app breathing. More...
|
| |
| void | ref_app_breathing_destroy (ref_app_breathing_handle_t *handle) |
| | Destroy a handle for the ref app breathing. More...
|
| |
| bool | ref_app_breathing_get_buffer_size (ref_app_breathing_handle_t *handle, uint32_t *buffer_size) |
| | Get the buffer size needed for the provided ref app breathing handle. More...
|
| |
| bool | ref_app_breathing_prepare (ref_app_breathing_handle_t *handle, ref_app_breathing_config_t *config, acc_sensor_t *sensor, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size) |
| | Prepare the application to do a measurement. More...
|
| |
| bool | ref_app_breathing_process (ref_app_breathing_handle_t *handle, void *buffer, ref_app_breathing_result_t *result) |
| | Process the data. More...
|
| |
◆ A_ANGLE_LENGTH
| #define A_ANGLE_LENGTH (4U) |
◆ A_STATIC_LENGTH
| #define A_STATIC_LENGTH (2U) |
◆ B_ANGLE_LENGTH
| #define B_ANGLE_LENGTH (5U) |
◆ B_STATIC_LENGTH
| #define B_STATIC_LENGTH (3U) |
◆ determine_state()
◆ perform_action_based_on_state()
◆ process_breathing()
◆ ref_app_breathing_config_create()
Create a configuration for the ref app breathing.
- Returns
- A configuration for the ref app breathing, NULL if creation was not possible
Definition at line 100 of file ref_app_breathing.c.
◆ ref_app_breathing_config_destroy()
Destory a configuration for the ref app breathing.
- Parameters
-
| [in] | config | The configuration to destroy |
Definition at line 143 of file ref_app_breathing.c.
◆ ref_app_breathing_create()
Create a handle for the ref app breathing.
- Parameters
-
| [in] | config | The configuration to create the handle with |
- Returns
- A handle for the ref app breathing, NULL if creation was not possible
Definition at line 156 of file ref_app_breathing.c.
◆ ref_app_breathing_destroy()
Destroy a handle for the ref app breathing.
- Parameters
-
| [in] | handle | The ref app breathing handle to destroy |
Definition at line 265 of file ref_app_breathing.c.
◆ ref_app_breathing_get_buffer_size()
Get the buffer size needed for the provided ref app breathing handle.
- Parameters
-
| [in] | handle | The ref app breathing handle to to get the buffer size for |
| [out] | buffer_size | The buffer size |
- Returns
- true if successful, false otherwise
Definition at line 353 of file ref_app_breathing.c.
◆ ref_app_breathing_prepare()
Prepare the application to do a measurement.
- Parameters
-
| [in] | handle | The ref app breathing handle to prepare for |
| [in] | config | The configuration to prepare with |
| [in] | sensor | The sensor instance to prepare |
| [in] | sensor_cal_result | The calibration result to prepare with |
| [in] | buffer | Memory used by the application to prepare the sensor for measurements The buffer will only be used during the duration of this call |
| [in] | buffer_size | The size in bytes of the buffer, should be at least buffer_size from ref_app_breathing_get_buffer_size |
- Returns
- true if successful, false otherwise
Definition at line 358 of file ref_app_breathing.c.
◆ ref_app_breathing_process()
Process the data.
- Parameters
-
| [in] | handle | The ref app breathing handle for to get the next result for |
| [in] | buffer | A reference to the buffer (populated by acc_sensor_read) containing the data to be processed. |
| [out] | result | Ref app breathing results |
- Returns
- true if successful, otherwise false
Definition at line 368 of file ref_app_breathing.c.
◆ reinit_breathing()
◆ update_presence_distance()
◆ validate_config()