AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
Loading...
Searching...
No Matches
examples.h
Go to the documentation of this file.
1/*************************************************************************/
37#ifndef ARGUS_EXAMPLE_H
38#define ARGUS_EXAMPLE_H
39
40/*!***************************************************************************
41 * @defgroup example_apps AFBR-S50 API Examples
42 * @ingroup demo_apps
43 *
44 * @brief Example and Demo Projects for the AFBR-S50 API.
45 *
46 * @details A series of example and demo projects that utilize the AFBR-S50
47 * API in several ways.
48 *
49 * The following example projects are available:
50 *
51 * - 01_simple_example.c: Uses the API in the most straightforward
52 * way by invoking single measurements in a blocking manner.
53 *
54 * - 02_advanced_example.c: A more sophisticated example that
55 * utilizes a timer to trigger periodic measurements asynchronously
56 * from an interrupt service routine.
57 *
58 * - 03_high_speed_example.c: Demonstrates the high speed
59 * configuration of the device that allows measurement rates
60 * up to 3000 frames per second (depending on hardware!!).
61 *
62 * - 04_multi_device_example.c: Demonstrates the usage of multiple
63 * devices on a single MCU.
64 *
65 * - 05_simple_example_debug.c: Demonstrates how to obtain debug
66 * information.
67 *
68 * @warning The example code provides is not intended to be used as a for
69 * production systems. It is intended to demonstrate the usage of
70 * the API and to provide a starting point for custom applications.
71 *
72 * @addtogroup example_apps
73 * @{
74 *****************************************************************************/
75
82#ifndef API_EXAMPLE
83#define API_EXAMPLE 1
84#endif
85
89#ifndef RUN_HAL_TESTS
90#define RUN_HAL_TESTS 1
91#endif
92
96#ifndef RUN_XTALK_CALIBRATION
97#define RUN_XTALK_CALIBRATION 0
98#endif
99
101#ifndef SPI_SLAVE
102#define SPI_SLAVE 1
103#endif
104
106#if API_EXAMPLE < 1 || API_EXAMPLE > 5
107#error The selected API_EXAMPLE is not available!
108#endif
109
110#include "board/board.h"
111#include "platform/argus_print.h" // declaration of print()
112
113/*!***************************************************************************
114 * @brief Application entry point for the specified example.
115 *
116 * @details The main function of the specified example, called after startup code
117 * and hardware initialization.
118 *
119 * This function will never be exited!
120 *****************************************************************************/
121void ExampleMain(void);
122
123/*!***************************************************************************
124 * @brief A callback function from the example code whenever an error occurs.
125 *
126 * @details The example code calls this function whenever an unexpected error
127 * occurs, for example, if an API function returns an error code.
128 *
129 * This implementation of the function will print the error message.
130 * If specified, the program execution will be stopped with an
131 * infinite loop. Otherwise, the program will continue to run and the
132 * error is printed and ignored.
133 *
134 * @warning This is only a simple example implementation that does not handle
135 * errors in a production system. It is intended to demonstrate the
136 * usage of the API and to provide a starting point for custom
137 * applications.
138 *
139 * This function needs to be replaced with a more sophisticated
140 * implementation to handle errors in a production system.
141 * For example, it could reset the device or try to recover from
142 * the error by re-initializing the device.
143 *
144 * @param status The specified status to be checked for errors.
145 * @param stop Whether to stop the program (e.g. in case of a critical error).
146 * @param msg The associated error message to be printed in case of errors.
147 *****************************************************************************/
148void HandleError(status_t status, bool stop, char const * msg);
149
151#endif /* ARGUS_EXAMPLE_H */
This file is part of the AFBR-S50 API.
int32_t status_t
Type used for all status and error return values.
Definition argus_status.h:70
static status_t status
Definition argus_xtalk_cal_cli.c:140
void HandleError(status_t status, bool stop, char const *msg)
A callback function from the example code whenever an error occurs.
Definition main.c:62
void ExampleMain(void)
Application entry point for the specified example.