Data Structures | Macros | Typedefs | Enumerations | Functions
RSS

RSS API description. More...

## Data Structures
struct | acc_rss_assembly_test_result_t
| The result struct of acc_rss_assembly_test. More...

## Macros
#define | ACC_RSS_ASSEMBLY_TEST_MIN_BUFFER_SIZE 4096U
| The minimum buffer size needed for the assembly test. More...

## Typedefs
typedef struct acc_rss_assembly_test | acc_rss_assembly_test_t

## Enumerations
enum | acc_rss_test_state_t { ACC_RSS_TEST_STATE_ONGOING = 0, ACC_RSS_TEST_STATE_TOGGLE_ENABLE_PIN, ACC_RSS_TEST_STATE_WAIT_FOR_INTERRUPT, ACC_RSS_TEST_STATE_COMPLETE }
| Return code for rss tests. More...
enum | acc_rss_test_integration_status_t { ACC_RSS_TEST_INTEGRATION_STATUS_OK = 0, ACC_RSS_TEST_INTEGRATION_STATUS_TIMEOUT }
| Integration status for rss tests. More...
enum | acc_rss_assembly_test_test_id_t { ACC_RSS_ASSEMBLY_TEST_ID_BASIC_READ, ACC_RSS_ASSEMBLY_TEST_ID_COMMUNICATION, ACC_RSS_ASSEMBLY_TEST_ID_ENABLE_PIN, ACC_RSS_ASSEMBLY_TEST_ID_INTERRUPT, ACC_RSS_ASSEMBLY_TEST_ID_CLOCK_AND_SUPPLY, ACC_RSS_ASSEMBLY_TEST_ID_SENSOR_CALIBRATION }
| Test identity enum for acc_rss_assembly_test. More...

## Functions
bool | acc_rss_hal_register (const acc_hal_a121_t *hal)
| Register an integration. More...
bool | acc_rss_get_buffer_size (const acc_config_t *config, uint32_t *buffer_size)
| Get the buffer size needed for the specified config. More...
void | acc_rss_set_log_level (acc_log_level_t level)
| Set the log level that determines when the integration HAL logger function is called. More...
acc_rss_assembly_test_t * | acc_rss_assembly_test_create (acc_sensor_id_t sensor_id, void *buffer, uint32_t buffer_size)
| Create a sensor assembly test instance. More...
void | acc_rss_assembly_test_destroy (acc_rss_assembly_test_t *assembly_test)
| Destroy a sensor assembly test instance freeing any resources allocated. More...
void | acc_rss_assembly_test_enable_diagnostic_logs (void)
| Enable diagnostic logs for the assembly test,. More...
void | acc_rss_assembly_test_enable_all_tests (acc_rss_assembly_test_t *assembly_test)
| Enable all assembly tests. More...
void | acc_rss_assembly_test_disable_all_tests (acc_rss_assembly_test_t *assembly_test)
| Disable all assembly tests. More...
void | acc_rss_assembly_test_enable (acc_rss_assembly_test_t *assembly_test, acc_rss_assembly_test_test_id_t test_id)
| Enable a test in assembly test. More...
void | acc_rss_assembly_test_disable (acc_rss_assembly_test_t *assembly_test, acc_rss_assembly_test_test_id_t test_id)
| Disable a test in assembly test. More...
acc_rss_test_state_t | acc_rss_assembly_test_execute (acc_rss_assembly_test_t *assembly_test, acc_rss_test_integration_status_t integration_status)
| Execute the assembly test. More...
const acc_rss_assembly_test_result_t * | acc_rss_assembly_test_get_results (const acc_rss_assembly_test_t *assembly_test, uint16_t *nbr_of_test_results)
| A function to get the results from the sensor assembly test. More...

## Detailed Description

RSS API description.

## Macro Definition Documentation

## ◆ ACC_RSS_ASSEMBLY_TEST_MIN_BUFFER_SIZE

#define ACC_RSS_ASSEMBLY_TEST_MIN_BUFFER_SIZE 4096U

The minimum buffer size needed for the assembly test.

Examples
  example_bring_up.c, and example_diagnostic_test.c.

Definition at line 27 of file acc_rss_a121.h.

## Typedef Documentation

## ◆ acc_rss_assembly_test_t

typedef struct acc_rss_assembly_test acc_rss_assembly_test_t

Definition at line 98 of file acc_rss_a121.h.

## Enumeration Type Documentation

## ◆ acc_rss_assembly_test_test_id_t

enum acc_rss_assembly_test_test_id_t

Test identity enum for acc_rss_assembly_test.

Enumerator
ACC_RSS_ASSEMBLY_TEST_ID_BASIC_READ | Test SPI basic read functionality.
ACC_RSS_ASSEMBLY_TEST_ID_COMMUNICATION | Test SPI communication.
ACC_RSS_ASSEMBLY_TEST_ID_ENABLE_PIN | Test enable pin.
ACC_RSS_ASSEMBLY_TEST_ID_INTERRUPT | Test interrupt pin.
ACC_RSS_ASSEMBLY_TEST_ID_CLOCK_AND_SUPPLY | Test clock and supply stability.
ACC_RSS_ASSEMBLY_TEST_ID_SENSOR_CALIBRATION | Test sensor calibration.

Definition at line 64 of file acc_rss_a121.h.

## ◆ acc_rss_test_integration_status_t

enum acc_rss_test_integration_status_t

Integration status for rss tests.

Enumerator
ACC_RSS_TEST_INTEGRATION_STATUS_OK | The test status is OK
ACC_RSS_TEST_INTEGRATION_STATUS_TIMEOUT | The test has timed out

Definition at line 51 of file acc_rss_a121.h.

## ◆ acc_rss_test_state_t

enum acc_rss_test_state_t

Return code for rss tests.

Enumerator
ACC_RSS_TEST_STATE_ONGOING | The test is ongoing, the application should call test function again
ACC_RSS_TEST_STATE_TOGGLE_ENABLE_PIN | The application should toggle enable pin and then call test function again
ACC_RSS_TEST_STATE_WAIT_FOR_INTERRUPT | The application should wait for interrupt and then call test function again
ACC_RSS_TEST_STATE_COMPLETE | The test is complete

Definition at line 34 of file acc_rss_a121.h.

## Function Documentation

## ◆ acc_rss_assembly_test_create()

acc_rss_assembly_test_t* acc_rss_assembly_test_create | ( | acc_sensor_id_t | sensor_id,
|  | void * | buffer,
|  | uint32_t | buffer_size
| ) |  |

Create a sensor assembly test instance.

The assembly test instance is used to keep track of internal state and results of the assembly test.

The provided buffer start address should be 32-bit aligned. The size of the provided buffer must be at least ACC_RSS_ASSEMBLY_TEST_MIN_BUFFER_SIZE bytes. The size of the provided buffer should be a multiple of 8 bytes. The test will not behave differently if a larger buffer is provided.

All assembly tests are enabled by default after creation.

Parameters

  [in] | sensor_id | The sensor id to be used to communicate with
  [in] | buffer | A buffer used for assembly test
  [in] | buffer_size | The size of the buffer

Returns
  Assembly test instance, NULL if the creation of the instance failed

Examples
  example_bring_up.c, and example_diagnostic_test.c.

## ◆ acc_rss_assembly_test_destroy()

void acc_rss_assembly_test_destroy | ( | acc_rss_assembly_test_t * | assembly_test | ) |

Destroy a sensor assembly test instance freeing any resources allocated.

Parameters

  [in] | assembly_test | The assembly_test instance to destroy, can be NULL

Examples
  example_bring_up.c, and example_diagnostic_test.c.

## ◆ acc_rss_assembly_test_disable()

void acc_rss_assembly_test_disable | ( | acc_rss_assembly_test_t * | assembly_test,
|  | acc_rss_assembly_test_test_id_t | test_id
| ) |  |

Disable a test in assembly test.

Parameters

  [in] | assembly_test | The assembly_test instance
  [in] | test_id | The id of the test to be enabled

## ◆ acc_rss_assembly_test_disable_all_tests()

void acc_rss_assembly_test_disable_all_tests | ( | acc_rss_assembly_test_t * | assembly_test | ) |

Disable all assembly tests.

Parameters

  [in] | assembly_test | The assembly_test instance

Examples
  example_bring_up.c.

## ◆ acc_rss_assembly_test_enable()

void acc_rss_assembly_test_enable | ( | acc_rss_assembly_test_t * | assembly_test,
|  | acc_rss_assembly_test_test_id_t | test_id
| ) |  |

Enable a test in assembly test.

Parameters

  [in] | assembly_test | The assembly_test instance
  [in] | test_id | The id of the test to be enabled

Examples
  example_bring_up.c.

## ◆ acc_rss_assembly_test_enable_all_tests()

void acc_rss_assembly_test_enable_all_tests | ( | acc_rss_assembly_test_t * | assembly_test | ) |

Enable all assembly tests.

Parameters

  [in] | assembly_test | The assembly_test instance

Examples
  example_diagnostic_test.c.

## ◆ acc_rss_assembly_test_enable_diagnostic_logs()

void acc_rss_assembly_test_enable_diagnostic_logs | ( | void |  | ) |

Enable diagnostic logs for the assembly test,.

Examples
  example_diagnostic_test.c.

## ◆ acc_rss_assembly_test_execute()

acc_rss_test_state_t acc_rss_assembly_test_execute | ( | acc_rss_assembly_test_t * | assembly_test,
|  | acc_rss_test_integration_status_t | integration_status
| ) |  |

Execute the assembly test.

The sensor must be powered on and enabled before this function is called.

The function should be called repeatedly until it returns ACC_RSS_TEST_STATE_COMPLETE. If the function returns ACC_RSS_TEST_STATE_TOGGLE_ENABLE_PIN the caller should toggle the enable pin to reset the sensor and then call acc_rss_assembly_test_execute() again. If the function returns ACC_RSS_TEST_STATE_WAIT_FOR_INTERRUPT the caller have to wait for the interrupt pin before calling acc_rss_assembly_test_execute() again.

After assembly test has been run the sensor enable pin should be toggled to reset the sensor.

Parameters

  [in,out] | assembly_test | The sensor assembly test instance
  [in] | integration_status | Report back to assembly test if 'wait for interrupt' timed out

Returns
  ACC_RSS_TEST_STATE_ONGOING if caller should call this function again. ACC_RSS_TEST_STATE_TOGGLE_ENABLE_PIN if caller should toggle the enable pin. ACC_RSS_TEST_STATE_WAIT_FOR_INTERRUPT if caller should wait for interrupt pin. or ACC_RSS_TEST_STATE_COMPLETE if the assembly test is complete.

Examples
  example_bring_up.c, and example_diagnostic_test.c.

## ◆ acc_rss_assembly_test_get_results()

const acc_rss_assembly_test_result_t* acc_rss_assembly_test_get_results | ( | const acc_rss_assembly_test_t * | assembly_test,
|  | uint16_t * | nbr_of_test_results
| ) |  |

A function to get the results from the sensor assembly test.

Parameters

  [in] | assembly_test | The sensor assembly test instance
  [out] | nbr_of_test_results | The number of test results returned

Returns
  The assembly test result array

Examples
  example_bring_up.c.

## ◆ acc_rss_get_buffer_size()

bool acc_rss_get_buffer_size | ( | const acc_config_t * | config,
|  | uint32_t * | buffer_size
| ) |  |

Get the buffer size needed for the specified config.

This buffer size can be used to allocate a memory buffer in the application, which is needed for several functions in the RSS library.

Parameters

  [in] | config | The config to get the buffer size for
  [out] | buffer_size | The buffer size

Returns
  True if successful, false otherwise

Examples
  acc_control_helper.c, example_service.c, example_service_calibration_caching.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, example_service_subsweeps.c, and example_vibration_main.c.

## ◆ acc_rss_hal_register()

bool acc_rss_hal_register | ( | const acc_hal_a121_t * | hal | ) |

Register an integration.

Parameters

  [in] | hal | A reference to the hal to register

Returns
  True if a valid integration is registered, false otherwise

Examples
  example_bring_up.c, example_control_helper.c, example_detector_distance.c, example_detector_distance_calibration_caching.c, example_detector_distance_low_power_hibernate.c, example_detector_distance_low_power_off.c, example_detector_distance_with_iq_data_print.c, example_detector_presence.c, example_detector_presence_low_power_hibernate.c, example_detector_presence_low_power_off.c, example_detector_presence_multiple_configurations.c, example_detector_presence_with_iq_data_print.c, example_diagnostic_test.c, example_processing_amplitude.c, example_processing_coherent_mean.c, example_processing_noncoherent_mean.c, example_processing_peak_interpolation.c, example_processing_static_presence.c, example_processing_subtract_adaptive_bg.c, example_service.c, example_service_calibration_caching.c, example_service_low_power_sensor_disable.c, example_service_low_power_sensor_hibernate.c, example_service_multiple_configurations.c, example_service_sensor_disable.c, example_service_sensor_hibernate.c, example_service_sensor_off.c, example_service_subsweeps.c, example_vibration_main.c, and ref_app_tank_level.c.

## ◆ acc_rss_set_log_level()

void acc_rss_set_log_level | ( | acc_log_level_t | level | ) |

Set the log level that determines when the integration HAL logger function is called.

Shall be called when there is a hal registered in RSS as it has no effect otherwise.

Parameters

  [in] | level | The severity level for log output.