|
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... | |
RSS API description.
#define ACC_RSS_ASSEMBLY_TEST_MIN_BUFFER_SIZE 4096U |
The minimum buffer size needed for the assembly test.
Definition at line 27 of file acc_rss_a121.h.
typedef struct acc_rss_assembly_test acc_rss_assembly_test_t |
Definition at line 98 of file acc_rss_a121.h.
Test identity enum for acc_rss_assembly_test.
Definition at line 64 of file acc_rss_a121.h.
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.
enum acc_rss_test_state_t |
Return code for rss tests.
Definition at line 34 of file acc_rss_a121.h.
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.
[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 |
void acc_rss_assembly_test_destroy | ( | acc_rss_assembly_test_t * | assembly_test | ) |
Destroy a sensor assembly test instance freeing any resources allocated.
[in] | assembly_test | The assembly_test instance to destroy, can be NULL |
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.
[in] | assembly_test | The assembly_test instance |
[in] | test_id | The id of the test to be enabled |
void acc_rss_assembly_test_disable_all_tests | ( | acc_rss_assembly_test_t * | assembly_test | ) |
Disable all assembly tests.
[in] | assembly_test | The assembly_test instance |
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.
[in] | assembly_test | The assembly_test instance |
[in] | test_id | The id of the test to be enabled |
void acc_rss_assembly_test_enable_all_tests | ( | acc_rss_assembly_test_t * | assembly_test | ) |
Enable all assembly tests.
[in] | assembly_test | The assembly_test instance |
void acc_rss_assembly_test_enable_diagnostic_logs | ( | void | ) |
Enable diagnostic logs for the assembly test,.
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.
[in,out] | assembly_test | The sensor assembly test instance |
[in] | integration_status | Report back to assembly test if 'wait for interrupt' timed out |
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.
[in] | assembly_test | The sensor assembly test instance |
[out] | nbr_of_test_results | The number of test results returned |
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.
[in] | config | The config to get the buffer size for |
[out] | buffer_size | The buffer size |
bool acc_rss_hal_register | ( | const acc_hal_a121_t * | hal | ) |
Register an integration.
[in] | hal | A reference to the hal to register |
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.
[in] | level | The severity level for log output. |