AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
|
Example and Demo Projects for the AFBR-S50 API. More...
Macros | |
#define | API_EXAMPLE 1 |
#define | RUN_HAL_TESTS 1 |
#define | RUN_XTALK_CALIBRATION 0 |
#define | SPI_SLAVE 1 |
Functions | |
void | ExampleMain (void) |
Application entry point for the specified example. | |
void | HandleError (status_t status, bool stop, char const *msg) |
A callback function from the example code whenever an error occurs. | |
Example and Demo Projects for the AFBR-S50 API.
A series of example and demo projects that utilize the AFBR-S50 API in several ways.
The following example projects are available:
#define API_EXAMPLE 1 |
Selector for example:
#define RUN_HAL_TESTS 1 |
Selector for HAL test demo:
#define RUN_XTALK_CALIBRATION 0 |
Selector for XTALK calibration demo:
#define SPI_SLAVE 1 |
Define the SPI slave for device.
void ExampleMain | ( | void | ) |
Application entry point for the specified example.
Test example configuration!
The main function of the specified example, called after startup code and hardware initialization.
This function will never be exited!
void HandleError | ( | status_t | status, |
bool | stop, | ||
char const * | msg | ||
) |
A callback function from the example code whenever an error occurs.
The example code calls this function whenever an unexpected error occurs, for example, if an API function returns an error code.
This implementation of the function will print the error message. If specified, the program execution will be stopped with an infinite loop. Otherwise, the program will continue to run and the error is printed and ignored.
This function needs to be replaced with a more sophisticated implementation to handle errors in a production system. For example, it could reset the device or try to recover from the error by re-initializing the device.
status | The specified status to be checked for errors. |
stop | Whether to stop the program (e.g. in case of a critical error). |
msg | The associated error message to be printed in case of errors. |