Data Structures | Typedefs | Enumerations | Functions
example_vibration.h File Reference
`#include <complex.h>`
`#include <stdbool.h>`
`#include <stdint.h>`
`#include "acc_config.h"`
`#include "acc_processing.h"`

Go to the source code of this file.

## Data Structures
struct | acc_vibration_config_t
| Vibration config container. More...
struct | acc_vibration_result_t
| Vibration processing result. More...

## Typedefs
typedef struct acc_vibration_handle | acc_vibration_handle_t
| Vibration processing handle. More...

## Enumerations
enum | acc_vibration_preset_t { ACC_VIBRATION_PRESET_HIGH_FREQUENCY, ACC_VIBRATION_PRESET_LOW_FREQUENCY }
| Vibration presets. More...
enum | acc_vibration_reported_displacement_mode_t { ACC_VIBRATION_REPORT_DISPLACEMENT_AS_AMPLITUDE, ACC_VIBRATION_REPORT_DISPLACEMENT_AS_PEAK2PEAK }
| Specifies how displacement is reported. More...

## Functions
void | acc_vibration_preset_set (acc_vibration_config_t *config, acc_vibration_preset_t preset)
void | acc_vibration_config_log (const acc_vibration_config_t *config)
acc_vibration_handle_t * | acc_vibration_handle_create (const acc_vibration_config_t *config)
const acc_config_t * | acc_vibration_handle_sensor_config_get (acc_vibration_handle_t *handle)
const float * | acc_vibration_handle_displacement_history_get (acc_vibration_handle_t *handle, uint16_t *num_elem)
bool | acc_vibration_handle_continuous_data_acquisition_get (acc_vibration_handle_t *handle, bool *continuous_data_acquisition)
void | acc_vibration_handle_destroy (acc_vibration_handle_t *handle)
void | acc_vibration_process (acc_processing_result_t *proc_result, acc_vibration_handle_t *handle, acc_vibration_config_t *config, acc_vibration_result_t *result)

## Typedef Documentation

## ◆ acc_vibration_handle_t

typedef struct acc_vibration_handle acc_vibration_handle_t

Vibration processing handle.

Definition at line 102 of file example_vibration.h.

## Enumeration Type Documentation

## ◆ acc_vibration_preset_t

enum acc_vibration_preset_t

Vibration presets.

Enumerator
ACC_VIBRATION_PRESET_HIGH_FREQUENCY |
ACC_VIBRATION_PRESET_LOW_FREQUENCY |

Definition at line 17 of file example_vibration.h.

## ◆ acc_vibration_reported_displacement_mode_t

enum acc_vibration_reported_displacement_mode_t

Specifies how displacement is reported.

Enumerator
ACC_VIBRATION_REPORT_DISPLACEMENT_AS_AMPLITUDE | Reports displacement as amplitude
ACC_VIBRATION_REPORT_DISPLACEMENT_AS_PEAK2PEAK | Reports displacement as peak-to-peak

Definition at line 26 of file example_vibration.h.

## Function Documentation

## ◆ acc_vibration_config_log()

void acc_vibration_config_log | ( | const acc_vibration_config_t * | config | ) |

Parameters

  [in] | config | The config to log

Examples
  example_vibration_main.c.

Definition at line 170 of file example_vibration.c.

## ◆ acc_vibration_handle_continuous_data_acquisition_get()

bool acc_vibration_handle_continuous_data_acquisition_get | ( | acc_vibration_handle_t * | handle,
|  | bool * | continuous_data_acquisition
| ) |  |

Parameters

  [in] | handle | A handle to get the internal setting from
  [out] | continuous_data_acquisition | Wether continuous data acquisition is enabled

Returns
  True is arguments are non-NULL, false otherwise

Examples
  example_vibration_main.c.

Definition at line 369 of file example_vibration.c.

## ◆ acc_vibration_handle_create()

acc_vibration_handle_t* acc_vibration_handle_create | ( | const acc_vibration_config_t * | config | ) |

Parameters

  [in] | config | A vibration app config to set default settings to.

Returns
  A vibration processing handle

Examples
  example_vibration_main.c.

Definition at line 233 of file example_vibration.c.

## ◆ acc_vibration_handle_destroy()

void acc_vibration_handle_destroy | ( | acc_vibration_handle_t * | handle | ) |

Parameters

  [in] | handle | The vibration handle to destroy

Examples
  example_vibration_main.c.

Definition at line 381 of file example_vibration.c.

## ◆ acc_vibration_handle_displacement_history_get()

const float* acc_vibration_handle_displacement_history_get | ( | acc_vibration_handle_t * | handle,
|  | uint16_t * | num_elem
| ) |  |

Parameters

  [in] | handle | A handle to get the internal displacement history from
  [out] | num_elem | The number of elements in the returned array

Returns
  An array with displacements if arguments are non-NULL

Examples
  example_vibration_main.c.

Definition at line 355 of file example_vibration.c.

## ◆ acc_vibration_handle_sensor_config_get()

const acc_config_t* acc_vibration_handle_sensor_config_get | ( | acc_vibration_handle_t * | handle | ) |

Parameters

  [in] | handle | The handle

Returns
  pointer to a sensor config corresponding to the vibration config 'handle' was created with.

Examples
  example_vibration_main.c.

Definition at line 350 of file example_vibration.c.

## ◆ acc_vibration_preset_set()

void acc_vibration_preset_set | ( | acc_vibration_config_t * | config,
|  | acc_vibration_preset_t | preset
| ) |  |

Parameters

  [out] | config | The vibration config to set a preset for
  [in] | preset | The preset

Examples
  example_vibration_main.c.

Definition at line 115 of file example_vibration.c.

## ◆ acc_vibration_process()

void acc_vibration_process | ( | acc_processing_result_t * | proc_result,
|  | acc_vibration_handle_t * | handle,
|  | acc_vibration_config_t * | config,
|  | acc_vibration_result_t * | result
| ) |  |

Parameters

  [in] | proc_result | Input for vibration processing
  [in] | handle | The vibration processing handle
  [in] | config | The vibration app config
  [out] | result | The vibration processing result

Examples
  example_vibration_main.c.

Definition at line 437 of file example_vibration.c.