AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
Loading...
Searching...
No Matches
argus_xtalk_cal_cli.c File Reference

Provides a CLI to run crosstalk calibration with the AFBR-S50 API. More...

#include "argus_xtalk_cal_cli.h"
#include "platform/argus_print.h"
#include "driver/uart.h"
#include "utility/fp_mul.h"
Include dependency graph for argus_xtalk_cal_cli.c:

Macros

#define READY()   (rxdataS[0]=='y')
 Macro to proceed to next step, see User_Query.
 
#define ABORT()   (rxdataS[0]=='n')
 Macro to abort crosstalk calibration, see User_Query.
 
#define PROMPT_INPUT()   (rxdataS[0])
 Macro to get user input, see Argus_XtalkCalibration_CLI.
 
#define CLEAR_INPUT()   (rxdataS[0] = 0, rxdataS[1] = 0, flag = 0)
 Macro to clear user input.
 

Functions

static void User_Query (void)
 CLI function while performing crosstalk calibration steps.
 
static void Device_Query (argus_hnd_t *hnd)
 Queries device status and invokes timeout.
 
static void Set_DCA_to_MaxState (argus_hnd_t *hnd)
 Sets the integration parameters to maximum.
 
static void Exec_SingleMeasurement (argus_hnd_t *hnd, uint8_t const cnt, bool print_all)
 Measurement sequence calling the Argus_TriggerMeasurement function a certain number of times. Results are going be printed according to the assigned print function (via set_print_fct) at the end.
 
static void Exec_XtalkMeasurement (argus_hnd_t *hnd, argus_cal_xtalk_table_t *xtk, uint8_t step)
 Measurement sequence to acquire crosstalk values.
 
static void Print_BinnedResults (argus_results_t const *res)
 Prints the contend of binned parameters and the status of the frame.
 
static void Print_PixelAmplResults (argus_results_t const *res)
 Prints the amplitudes of all 32 pixels in an 8 x 4 matrix.
 
static void Print_PixelSatResults (argus_results_t const *res)
 Prints the saturation status of all 32 pixels in an 8 x 4 matrix.
 
static void Print_PixelMapCoordinates (void)
 Prints the coordinates of all 32 pixels in an 8 x 4 matrix.
 
static void Print_XtalkMap (argus_cal_xtalk_table_t *extXtalk, uint8_t step)
 Prints the crosstalk values of each pixel in an 8x4 matrix.
 
static void Print_XtalkVectorTable (char *mode, argus_cal_xtalk_table_t *extXtalk)
 Prints the crosstalk values of each pixel in a table.
 
static void Print_FP_XtalkVectorTable (char *mode, argus_cal_xtalk_table_t *extXtalk)
 Prints the crosstalk fixed-point values of each pixel in a table.
 
static void Print_TotalXtalkMap (argus_hnd_t *hnd)
 Calculates and prints the total crosstalk values of each pixel in an 8x4 matrix.
 
static void Print_IntegrationEnergyInfo (argus_results_t const *res)
 Prints the values of integration parameters of a frame.
 
static void Get_GoldenPixel (argus_hnd_t *hnd)
 Gets the golden pixel coordinates stored in the EEPROM.
 
static void Interpolate_ActivePixels (argus_hnd_t *hnd)
 Interpolates crosstalk values in the total crosstalk vector table.
 
static void Set_Xtalk_AmplitudeThreshold (argus_hnd_t *hnd, uint8_t step, uint8_t trim)
 Sets the crosstalk amplitude threshold based on input parameters.
 
static void Handle_Error (status_t status, char const *msg)
 A callback function from the example code whenever an error occurs.
 
static void Get_UARTRxdata (void)
 Generic function to retrieve and assign UART data.
 
static void UART_Rx_Callback (uint8_t const *data, uint32_t const size)
 Received UART data ready callback implementation.
 
void Argus_XtalkCalibration_CLI (argus_hnd_t *hnd)
 Interactive Xtalk Calibration Procedure CLI.
 

Variables

static void(* set_print_fct )(argus_results_t const *)
 
static uint8_t loop_var = 0
 
static volatile uint8_t rxdata = 0
 
static uint8_t rxdataS [1280] = { 0 }
 
static bool flag = 0
 
static bool quit = false
 
static uint16_t max_ampl
 
static uint8_t sat_pixels_cnt
 
static uint32_t frame_time
 
static uint8_t gp_x = 0
 
static uint8_t gp_y = 0
 
static status_t status = STATUS_OK
 
static argus_mode_t myMode
 
static argus_dfm_mode_t myDFM
 
static argus_cfg_dca_t myDCA
 
static argus_cal_xtalk_table_t myXtalk
 
static argus_cal_xtalk_table_t totalXtalk
 
static argus_cal_xtalk_table_t eXtalkArr
 
static argus_cal_xtalk_table_t oeXtalkNoCoverArr
 
static argus_cal_xtalk_table_t oeXtalkCoverArr
 
static bool cancel_xtalk_cal_flag = false
 
static uint32_t const my_meas_time_ms = 1000
 
static uint32_t const device_query_timer_ms = 6000
 
static uint8_t const cnt_trig_meas = 20
 

Detailed Description

Provides a CLI to run crosstalk calibration with the AFBR-S50 API.

Copyright (c) 2023, Broadcom, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.