Use a PCR module to rapidly develop accurate, low-power radar-based sensors
measurement, this design pattern begins by initializing the system and RSS, calling three routines in sequence: ■ acc_driver_hal_init(), which initializes the board and GPIOs ■ acc_driver_hal_get_ implementation(), which instantiates a C structure, acc_hal_t, that holds sensor and board properties as well as pointers to runtime handlers for memory allocation, semaphores, and others. ■ acc_rss_activate_with_hal(), which activates the Radar System Services (RSS) utility itself From this point, a typical measurement involves creating an object called a configuration that contains parameters associated with the sensor and the particular measurement. That configuration is then used to call an RSS API function to create the desired detector or service. The sample code illustrates the application of this design pattern in a module, example_detector_distance_ peak.c, for creating and working with a distance peak detector. In that module, the main() routine (Listing 1) first performs initialization and RSS activation before creating a configuration (acc_detector_distance_peak_ configuration_create()) and using that configuration to create a peak detector (distance_peak_detect_ with_blocking_calls()).
Listing 1: This snippet from a sample application in the Analog Devices 3D ToF SDK distribution demonstrates the few steps required to acquire depth and IR images and classify them with an inference model. (Code source: Analog Devices)
In this sample application, the actual distance peak measurements are performed in the routine distance_peak_ detect_with_blocking_calls(). This routine in turn uses the RSS API function acc_detector_distance_ peak_get_next() to retrieve the actual measurement data from the A111 device (Listing 2). In
this case, the code places the acc_detector_distance_peak_ get_next() measurement routine in a loop, decrementing a counter, detection_runs, until it performs 100 measurements. Developers can implement their own detectors, using service calls in a similar design pattern
80
Powered by FlippingBook