AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
|
A CLI module to interactively run crosstalk calibration. More...
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. | |
#define | ARGUS_XTALK_CAL_CLI_VERSION "v1.0" |
Version number of the xtalk calibration CLI. | |
#define | ELEC_XTK_AMPL_LMT (25U) |
The xtalk measurement amplitude limits in LSB for the electrical part. | |
#define | OPT_ELEC_XTK_AMPL_LMT (200U) |
The xtalk measurement amplitude limits in LSB for the optical part. | |
#define | T_GLASS (236U) |
Wavelength dependent transmission of a cover glass. | |
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 |
A CLI module to interactively run crosstalk calibration.
This interactive procedure guides through the steps needed to compensate the application specific crosstalk (xtalk) using the AFBR-S50 API.
Please read application note AFBR-S50-XTK-Crosstalk-Guide to get more information.
#define ABORT | ( | ) | (rxdataS[0]=='n') |
#define ARGUS_XTALK_CAL_CLI_VERSION "v1.0" |
Version number of the xtalk calibration CLI.
Changes:
Macro to clear user input.
Supportive function for the CLI.
#define ELEC_XTK_AMPL_LMT (25U) |
The xtalk measurement amplitude limits in LSB for the electrical part.
#define OPT_ELEC_XTK_AMPL_LMT (200U) |
The xtalk measurement amplitude limits in LSB for the optical part.
#define PROMPT_INPUT | ( | ) | (rxdataS[0]) |
#define READY | ( | ) | (rxdataS[0]=='y') |
#define T_GLASS (236U) |
Wavelength dependent transmission of a cover glass.
Wavelength dependent transmission or transmittance factor of the specific cover glass.
Example: Gorilla glass has 92% transmittance @ 850nm which is translated as UQ0.8 by 0.92 * 2^8 = 236
void Argus_XtalkCalibration_CLI | ( | argus_hnd_t * | hnd | ) |
Interactive Xtalk Calibration Procedure CLI.
This interactive procedure guides through the steps needed to compensate the application specific crosstalk (xtalk) using the AFBR-S50 API.
Please read application note AFBR-S50-XTK-Crosstalk-Guide to get more information.
|
static |
Queries device status and invokes timeout.
Checks Argus_GetStatus function and triggers a timeout based on global variable device_query_timer_ms.
hnd | The API handle; contains all internal states and data. |
|
static |
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.
Supportive function to the xtalk calibration sequence. In the crosstalk calibration sequence it is used to measure the pixel amplitudes while performing the crosstalk calibration. It will be called x-times to accommodate deviations in the first frames when DFM is used (default). See function Exec_XtalkMeasurement for more details.
hnd | The API handle; contains all internal states and data. |
cnt | A counter as integer value to determine which frame is printed at the CLI. |
print_all | Boolean to indicate if all or just last single measurement is printed |
|
static |
Measurement sequence to acquire crosstalk values.
The calibration measurement is carried out by the following steps:
hnd | The API handle; contains all internal states and data. |
xtk | A pointer to the argus_cal_xtalk_table_t structure that will be populated with measured crosstalk calibration data. |
step | Integer indicating the calling calibration step (1-3) |
|
static |
Gets the golden pixel coordinates stored in the EEPROM.
Gets the golden pixel coordinates and stores it to gp_x and gp_y (see Argus_GetCalibrationGoldenPixel)
hnd | The API handle; contains all internal states and data. |
|
static |
Generic function to retrieve and assign UART data.
Supportive function for the CLI.
|
static |
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 and then enter an infinite loop. The infinite loop is intended to prevent the program from continuing execution in case of errors.
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. |
msg | The associated error message to be printed in case of errors. |
|
static |
Interpolates crosstalk values in the total crosstalk vector table.
Supportive function to the xtalk calibration sequence. This function only applies to the higher focused sensor types like AFBR-S50LV85D, AFBR-S50LX85D and AFBR-S50MV68B. Due to the higher collimated laser beam it may appear that the reflex from the optical sink (:=low reflective target) yields higher crosstalk amplitudes in the active pixels which appear as peaks within the total crosstalk distribution. This effect can be mitigated by interpolating the crosstalk values of passive pixels (not receiving the reflex of the cover glass).
hnd | The API handle; contains all internal states and data. |
|
static |
Prints the contend of binned parameters and the status of the frame.
Function can be called from within a measurement function type or/and get assigned to a function pointer.
res | A pointer to the results structure that will be populated with evaluated data. |
|
static |
Prints the crosstalk fixed-point values of each pixel in a table.
Supportive function to the xtalk calibration sequence.
extXtalk | A pointer to the argus_cal_xtalk_table_t structure that will be populated with measured crosstalk calibration data. |
mode | A pointer to the char variable containing the current measurement mode. |
|
static |
Prints the values of integration parameters of a frame.
Function can be called from within a measurement function type or/and get assigned to a function pointer.
res | A pointer to the results structure that will be populated with evaluated data. |
|
static |
Prints the amplitudes of all 32 pixels in an 8 x 4 matrix.
Additionally, the maximum amplitude is shown. Supportive function to the xtalk calibration sequence.
res | A pointer to the results structure that will be populated with evaluated data. |
|
static |
Prints the coordinates of all 32 pixels in an 8 x 4 matrix.
Supportive function to the xtalk calibration sequence.
|
static |
Prints the saturation status of all 32 pixels in an 8 x 4 matrix.
Additionally, the total number of saturated pixels is shown. It serves as a supportive function to the xtalk calibration sequence.
res | A pointer to the results structure that will be populated with evaluated data. |
|
static |
Calculates and prints the total crosstalk values of each pixel in an 8x4 matrix.
Supportive function to the xtalk calibration sequence.
hnd | The API handle; contains all internal states and data. |
|
static |
Prints the crosstalk values of each pixel in an 8x4 matrix.
Supportive function to the xtalk calibration sequence.
extXtalk | A pointer to the argus_cal_xtalk_table_t structure that will be populated with measured crosstalk calibration data. |
step | Integer indicating the calling calibration step (1-3) |
|
static |
Prints the crosstalk values of each pixel in a table.
Supportive function to the xtalk calibration sequence.
extXtalk | A pointer to the argus_cal_xtalk_table_t structure that will be populated with measured crosstalk calibration data. |
mode | A pointer to the char variable containing the current measurement mode. |
|
static |
Sets the integration parameters to maximum.
Supportive function to the xtalk calibration sequence.
Note: Maximizing the integration energy is automatically done when calling #Argus_ExecuteXtalkCalibrationSequence, however, it does not return any pixel which amplitude is above the threshold!
hnd | The API handle; contains all internal states and data. |
|
static |
Sets the crosstalk amplitude threshold based on input parameters.
Supportive function to the xtalk calibration sequence. Dynamically sets the crosstalk amplitude threshold (see Argus_SetCalibrationCrosstalkSequenceAmplitudeThreshold) based on the maximum measured pixel amplitude (see Print_PixelAmplResults).
hnd | The API handle; contains all internal states and data. |
step | Integer indicating the calling calibration step (1-3) |
trim | Scaling factor between measured pixel amplitude and crosstalk values |
|
static |
Received UART data ready callback implementation.
Supportive function for the CLI. Receives data from the UART interrupt. Note that only the first character is evaluated per call.
data | Byte pointer to the data array. |
size | Size of the data array. |
|
static |
CLI function while performing crosstalk calibration steps.
Queries user to proceed to next step by confirming with 'ready' or 'abort'.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Function pointer for the result data structure
The argus_results_t data structure is a rich set of function which cannot be displayed all in once. This function pointer is used to call different print functions from within the same measurement function.
|
static |