|
|
#include <stdarg.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include "acc_definitions_a121.h"#include "acc_detector_presence.h"#include "acc_hal_definitions_a121.h"#include "acc_hal_integration_a121.h"#include "acc_integration.h"#include "acc_rss_a121.h"#include "acc_version.h"#include "acc_reg_protocol.h"#include "i2c_application_system.h"#include "i2c_ref_app_breathing.h"#include "ref_app_breathing_reg_protocol.h"Go to the source code of this file.
Data Structures | |
| struct | ref_app_breathing_resources_t |
Macros | |
| #define | SENSOR_ID (1U) |
| #define | SENSOR_TIMEOUT_MS (10000U) |
| #define | UART_LOG_BUFFER_SIZE 100 |
Functions | |
| static uint32_t | get_command (void) |
| Get the i2c_app_command values. More... | |
| static void | command_handler (uint32_t command) |
| Execute the command sent from the host. More... | |
| static void | app_status_set_bits (uint32_t bit_mask) |
| Set bits in the i2c_app_status. More... | |
| static void | app_status_clr_bits (uint32_t bit_mask) |
| Clear bits in the i2c_app_status. More... | |
| static bool | app_status_test_bits (uint32_t bit_mask) |
| Test bits in the i2c_app_status. More... | |
| static void | create_sensor (ref_app_breathing_resources_t *resources) |
| Create sensor. More... | |
| static bool | calibrate_sensor (ref_app_breathing_resources_t *resources) |
| Calibrate sensor. More... | |
| static void | apply_app_config (ref_app_breathing_resources_t *resources) |
| Apply application config. More... | |
| static bool | app_activate (ref_app_breathing_resources_t *resources, bool enable) |
| Activate application. More... | |
| static bool | app_get_next (ref_app_breathing_resources_t *resources) |
| Get next breathing measurement. More... | |
| static void | module_low_power (void) |
| Try to set module in low power mode. More... | |
| static bool | enter_hibernate (acc_sensor_t *sensor) |
| Enter sensor hibernation state. More... | |
| static bool | exit_hibernate (acc_sensor_t *sensor) |
| Exit sensor hibernation state. More... | |
| static void | print_breathing_result (ref_app_breathing_result_t *result) |
| Print the ref app breathing result. More... | |
| static void | uart_log (const char *format,...) |
| UART logging function (can be enabled/disabled by command) More... | |
| ref_app_breathing_config_t * | i2c_ref_app_breathing_get_config (void) |
| Get ref app breathing configuration handle. More... | |
| bool | i2c_ref_app_breathing_command (uint32_t command) |
| Send command to be executed to i2c ref app breathing. More... | |
| uint32_t | i2c_ref_app_breathing_get_status (void) |
| Get ref app breathing status. More... | |
| uint32_t | i2c_ref_app_breathing_get_result (void) |
| Get ref app breathing result. More... | |
| float | i2c_ref_app_breathing_get_breathing_rate (void) |
| Get breathing rate. More... | |
| ref_app_breathing_app_state_t | i2c_ref_app_breathing_get_app_state (void) |
| Get app state. More... | |
| uint32_t | i2c_ref_app_breathing_get_counter (void) |
| Get measure counter. More... | |
| uint32_t | i2c_ref_app_breathing_get_frame_rate_mhz (void) |
| Get the actual frame rate for the current ref app breathing configuration. More... | |
| int | acconeer_main (int argc, char *argv[]) |
| Assembly test example. More... | |
Variables | |
| static ref_app_breathing_resources_t | app_resources = {0} |
| static uint32_t | i2c_app_command = 0U |
| static uint32_t | i2c_app_status = 0U |
| static bool | ref_app_breathing_active = false |
| static bool | result_ready = false |
| static bool | result_ready_sticky = false |
| static float | breathing_rate = 0.0f |
| static ref_app_breathing_app_state_t | app_state = REF_APP_BREATHING_APP_STATE_INIT |
| static uint32_t | breathing_frame_counter = 0U |
| static uint32_t | breathing_last_tick_ms = 0U |
| static uint32_t | breathing_frame_rate_mhz = 0U |
| static bool | uart_logs_enabled = false |
| #define SENSOR_ID (1U) |
Definition at line 26 of file i2c_ref_app_breathing.c.
| #define SENSOR_TIMEOUT_MS (10000U) |
Definition at line 27 of file i2c_ref_app_breathing.c.
| #define UART_LOG_BUFFER_SIZE 100 |
Definition at line 53 of file i2c_ref_app_breathing.c.
| int acconeer_main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Assembly test example.
Touchless button application.
Tank level reference application.
Smart presence reference application.
Parking application.
Breathing example application.
Waste level application.
Vibration example.
Surface velocity example application.
Service subsweeps example.
Service multple configurations example.
Low power service example.
Service sensor calibration caching 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.
hand motion application
Detector presence example with multiple configurations.
Low power detector presence example.
Detector presence example.
Detector distance example with iq data print.
Distance detector low power example.
Detector distance with calibration caching example.
Detector distance example.
Control helper example.
Cargo application.
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)
Definition at line 295 of file i2c_ref_app_breathing.c.
|
static |
Activate application.
This function will activate the application
| [in] | resources | Application resources struct |
| [in] | enable | set to true to enable the application |
Definition at line 664 of file i2c_ref_app_breathing.c.
|
static |
Get next breathing measurement.
| [in] | resources | Application resources struct |
Definition at line 708 of file i2c_ref_app_breathing.c.
|
static |
Clear bits in the i2c_app_status.
The i2c_app_status is protected by a critical section
| [in] | bit_mask | The bit_mask to clear |
Definition at line 513 of file i2c_ref_app_breathing.c.
|
static |
Set bits in the i2c_app_status.
The i2c_app_status is protected by a critical section
| [in] | bit_mask | The bit_mask to set |
Definition at line 500 of file i2c_ref_app_breathing.c.
|
static |
Test bits in the i2c_app_status.
The i2c_app_status is protected by a critical section
| [in] | bit_mask | The bit_mask to test |
Definition at line 526 of file i2c_ref_app_breathing.c.
|
static |
Apply application config.
This function will create the ref app breathing and allocate the needed memory
| [in] | resources | Application resources struct |
Definition at line 597 of file i2c_ref_app_breathing.c.
|
static |
Calibrate sensor.
| [in] | resources | Application resources struct |
Definition at line 557 of file i2c_ref_app_breathing.c.
|
static |
Execute the command sent from the host.
| [in] | command | The command to execute |
Definition at line 440 of file i2c_ref_app_breathing.c.
|
static |
Create sensor.
| [in] | resources | Application resources struct |
Definition at line 538 of file i2c_ref_app_breathing.c.
|
static |
Enter sensor hibernation state.
Definition at line 826 of file i2c_ref_app_breathing.c.
|
static |
Exit sensor hibernation state.
Definition at line 840 of file i2c_ref_app_breathing.c.
|
static |
Get the i2c_app_command values.
The i2c_app_command is cleared during this read The read and clear are protected by a critical section
Definition at line 426 of file i2c_ref_app_breathing.c.
| bool i2c_ref_app_breathing_command | ( | uint32_t | command | ) |
Send command to be executed to i2c ref app breathing.
| [in] | command | The command to be executed |
Definition at line 182 of file i2c_ref_app_breathing.c.
| ref_app_breathing_app_state_t i2c_ref_app_breathing_get_app_state | ( | void | ) |
Get app state.
Definition at line 257 of file i2c_ref_app_breathing.c.
| float i2c_ref_app_breathing_get_breathing_rate | ( | void | ) |
Get breathing rate.
Definition at line 245 of file i2c_ref_app_breathing.c.
| ref_app_breathing_config_t* i2c_ref_app_breathing_get_config | ( | void | ) |
Get ref app breathing configuration handle.
Definition at line 177 of file i2c_ref_app_breathing.c.
| uint32_t i2c_ref_app_breathing_get_counter | ( | void | ) |
Get measure counter.
The counter will be increased every time the application completes a measure
Definition at line 269 of file i2c_ref_app_breathing.c.
| uint32_t i2c_ref_app_breathing_get_frame_rate_mhz | ( | void | ) |
Get the actual frame rate for the current ref app breathing configuration.
Definition at line 281 of file i2c_ref_app_breathing.c.
| uint32_t i2c_ref_app_breathing_get_result | ( | void | ) |
Get ref app breathing result.
Definition at line 216 of file i2c_ref_app_breathing.c.
| uint32_t i2c_ref_app_breathing_get_status | ( | void | ) |
Get ref app breathing status.
Definition at line 204 of file i2c_ref_app_breathing.c.
|
static |
Try to set module in low power mode.
Definition at line 803 of file i2c_ref_app_breathing.c.
|
static |
Print the ref app breathing result.
Only available when the UART logs have been enabled with ENABLE_UART_LOGS
| [in] | result | The ref app breathing result |
Definition at line 854 of file i2c_ref_app_breathing.c.
|
static |
UART logging function (can be enabled/disabled by command)
Definition at line 862 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 40 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 47 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 48 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 50 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 49 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 46 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 41 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 42 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 43 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 44 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 45 of file i2c_ref_app_breathing.c.
|
static |
Definition at line 51 of file i2c_ref_app_breathing.c.