precision-converters-firmware
Macros | Functions | Variables
pl_gui_views.c File Reference

Pocket lab GUI views. More...

#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include "pl_gui_views.h"
#include "pl_gui_iio_wrapper.h"
#include "adi_fft.h"
#include "no_os_delay.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "stm32f769i_discovery.h"
#include "tft.h"
#include "touchpad.h"
#include "lvgl/lvgl.h"
#include "lv_conf.h"
Include dependency graph for pl_gui_views.c:

Macros

#define PL_GUI_DATA_MAX_RANGE   16777215
 
#define PL_GUI_DATA_MIN_RANGE   -16777215
 
#define PL_GUI_CHART_MAX_PXL_RANGE   2000000
 
#define PL_GUI_CHART_MIN_PXL_RANGE   -2000000
 
#define PL_GUI_DMM_READ_CNT   10
 

Functions

uint32_t pl_gui_get_active_device_index (void)
 Read the active device index for current view. More...
 
void pl_gui_perform_dmm_read (void)
 Perform the DMM read operations. More...
 
void pl_gui_display_captured_data (uint8_t *buf, uint32_t rec_bytes)
 Display the captured data onto GUI. More...
 
uint32_t get_data_samples_count (void)
 Get the count for data samples to be captured. More...
 
void pl_gui_store_chn_info (struct scan_type *ch_info, uint32_t chn_indx)
 Store the channel info. More...
 
void pl_gui_get_capture_chns_mask (uint32_t *chn_mask)
 Get the channels mask based on enabled channels count. More...
 
bool pl_gui_is_dmm_running (void)
 DMM running status check. More...
 
bool pl_gui_is_capture_running (void)
 Capture running status check. More...
 
bool pl_gui_is_fft_running (void)
 FFT running status check. More...
 
float pl_gui_cnv_data_to_volt_without_vref (int32_t data, uint8_t chn)
 Convert input data to voltage without Vref. More...
 
float pl_gui_cnv_data_to_volt_wrt_vref (int32_t data, uint8_t chn)
 Convert input data code to voltage w.r.t Vref. More...
 
int32_t pl_gui_cnv_code_to_straight_binary (uint32_t code, uint8_t chn)
 Convert input code to straight binary data. More...
 
int32_t pl_gui_create_power_up_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI power-up view. More...
 
int32_t pl_gui_create_attributes_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI attributes view. More...
 
int32_t pl_gui_create_register_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI register view. More...
 
int32_t pl_gui_create_dmm_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI DMM view. More...
 
int32_t pl_gui_create_capture_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI data capture view. More...
 
int32_t pl_gui_create_analysis_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI analysis view. More...
 
int32_t pl_gui_create_about_view (lv_obj_t *parent, struct pl_gui_init_param *param)
 Create pocket lab GUI about view. More...
 
int32_t pl_gui_init (struct pl_gui_desc **desc, struct pl_gui_init_param *param)
 Init pocket lab GUI. More...
 

Variables

bool pl_gui_capture_is_running
 
struct adi_fft_processing pl_gui_fft_proc
 
struct adi_fft_measurements pl_gui_fft_meas
 
bool pl_gui_fft_is_running
 

Detailed Description

Pocket lab GUI views.

Copyright (c) 2023 Analog Devices, Inc.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Macro Definition Documentation

◆ PL_GUI_CHART_MAX_PXL_RANGE

#define PL_GUI_CHART_MAX_PXL_RANGE   2000000

◆ PL_GUI_CHART_MIN_PXL_RANGE

#define PL_GUI_CHART_MIN_PXL_RANGE   -2000000

◆ PL_GUI_DATA_MAX_RANGE

#define PL_GUI_DATA_MAX_RANGE   16777215

◆ PL_GUI_DATA_MIN_RANGE

#define PL_GUI_DATA_MIN_RANGE   -16777215

◆ PL_GUI_DMM_READ_CNT

#define PL_GUI_DMM_READ_CNT   10

Function Documentation

◆ get_data_samples_count()

uint32_t get_data_samples_count ( void  )

Get the count for data samples to be captured.

Returns
data samples count

◆ pl_gui_cnv_code_to_straight_binary()

int32_t pl_gui_cnv_code_to_straight_binary ( uint32_t  code,
uint8_t  chn 
)

Convert input code to straight binary data.

Parameters
code[in]- Input code (unsigned)
chn[in]- Input channel
Returns
straight binary data

◆ pl_gui_cnv_data_to_volt_without_vref()

float pl_gui_cnv_data_to_volt_without_vref ( int32_t  data,
uint8_t  chn 
)

Convert input data to voltage without Vref.

Parameters
data[in]- Input data (signed, straight binary)
chn[in]- Input channel
Returns
voltage

◆ pl_gui_cnv_data_to_volt_wrt_vref()

float pl_gui_cnv_data_to_volt_wrt_vref ( int32_t  data,
uint8_t  chn 
)

Convert input data code to voltage w.r.t Vref.

Parameters
data[in]- Input data (signed, straight binary)
chn[in]- Input channel
Returns
voltage

◆ pl_gui_create_about_view()

int32_t pl_gui_create_about_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI about view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_analysis_view()

int32_t pl_gui_create_analysis_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI analysis view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_attributes_view()

int32_t pl_gui_create_attributes_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI attributes view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_capture_view()

int32_t pl_gui_create_capture_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI data capture view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_dmm_view()

int32_t pl_gui_create_dmm_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI DMM view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_power_up_view()

int32_t pl_gui_create_power_up_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI power-up view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_create_register_view()

int32_t pl_gui_create_register_view ( lv_obj_t *  parent,
struct pl_gui_init_param param 
)

Create pocket lab GUI register view.

Parameters
parent[in]- tabview instance
param[in]- pointer to pocket lab gui init params
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_display_captured_data()

void pl_gui_display_captured_data ( uint8_t *  buf,
uint32_t  rec_bytes 
)

Display the captured data onto GUI.

Parameters
buf[in]- Data buffer
rec_bytes[in]- Number of received bytes
Returns
None

◆ pl_gui_get_active_device_index()

uint32_t pl_gui_get_active_device_index ( void  )

Read the active device index for current view.

Returns
active device index

◆ pl_gui_get_capture_chns_mask()

void pl_gui_get_capture_chns_mask ( uint32_t *  chn_mask)

Get the channels mask based on enabled channels count.

Parameters
chn_mask[in,out]- Channel mask
Returns
None

◆ pl_gui_init()

int32_t pl_gui_init ( struct pl_gui_desc **  desc,
struct pl_gui_init_param param 
)

Init pocket lab GUI.

Parameters
desc[in]- Pocket lab GUI descriptor
param[in]- Pocket lab GUI init parameters
Returns
0 in case of success, negative error code otherwise

◆ pl_gui_is_capture_running()

bool pl_gui_is_capture_running ( void  )

Capture running status check.

Returns
Capture running status
Here is the caller graph for this function:

◆ pl_gui_is_dmm_running()

bool pl_gui_is_dmm_running ( void  )

DMM running status check.

Returns
DMM running status
Here is the caller graph for this function:

◆ pl_gui_is_fft_running()

bool pl_gui_is_fft_running ( void  )

FFT running status check.

Returns
FFT running status
Here is the caller graph for this function:

◆ pl_gui_perform_dmm_read()

void pl_gui_perform_dmm_read ( void  )

Perform the DMM read operations.

Returns
None
Note
DMM results are manipulated based on the raw, offset and scale attribute values read from the device
Here is the caller graph for this function:

◆ pl_gui_store_chn_info()

void pl_gui_store_chn_info ( struct scan_type *  ch_info,
uint32_t  chn_indx 
)

Store the channel info.

Parameters
ch_info[in]- Channel information
chn_indx[in]- Channel index
Returns
None

Variable Documentation

◆ pl_gui_capture_is_running

bool pl_gui_capture_is_running

◆ pl_gui_fft_is_running

bool pl_gui_fft_is_running

◆ pl_gui_fft_meas

struct adi_fft_measurements pl_gui_fft_meas

◆ pl_gui_fft_proc

struct adi_fft_processing pl_gui_fft_proc