precision-converters-firmware
pl_gui_views.h
Go to the documentation of this file.
1 /*************************************************************************/
13 #ifndef _PL_GUI_VIEWES_
14 #define _PL_GUI_VIEWES_
15 
16 /******************************************************************************/
17 /***************************** Include Files **********************************/
18 /******************************************************************************/
19 
20 #include <stdint.h>
21 #include "lvgl/lvgl.h"
22 #include "adi_fft.h"
23 
24 /******************************************************************************/
25 /********************** Macros and Constants Definition ***********************/
26 /******************************************************************************/
27 
28 #define PL_GUI_ADD_POWER_UP_DEF_VIEW {\
29  .view_name = " ", \
30  .create_view = &pl_gui_create_power_up_view\
31 }
32 
33 #define PL_GUI_ADD_ATTR_EDIT_DEF_VIEW {\
34  .view_name = "Configure", \
35  .create_view = &pl_gui_create_attributes_view\
36 }
37 
38 #define PL_GUI_ADD_REG_DEBUG_DEF_VIEW {\
39  .view_name = "Register", \
40  .create_view = &pl_gui_create_register_view\
41 }
42 
43 #define PL_GUI_ADD_DMM_DEF_VIEW {\
44  .view_name = "DMM", \
45  .create_view = &pl_gui_create_dmm_view\
46 }
47 
48 #define PL_GUI_ADD_CAPTURE_DEF_VIEW {\
49  .view_name = "Capture", \
50  .create_view = &pl_gui_create_capture_view\
51 }
52 
53 #define PL_GUI_ADD_ANALYSIS_DEF_VIEW {\
54  .view_name = "Analysis", \
55  .create_view = &pl_gui_create_analysis_view\
56 }
57 
58 #define PL_GUI_ADD_ABOUT_DEF_VIEW {\
59  .view_name = "About", \
60  .create_view = &pl_gui_create_about_view\
61 }
62 
63 #define PL_GUI_ADD_VIEW(_name, _function) {\
64  .view_name = _name,\
65  .create_view = _function\
66 }
67 
68 /* Requested data samples for capture. These number of samples would
69  * be displayed onto display GUI capture tab at single instance */
70 #define PL_GUI_REQ_DATA_SAMPLES 400
71 
72 /******************************************************************************/
73 /************************ Public Declarations *********************************/
74 /******************************************************************************/
75 
76 /* Pocket lab GUI device parameters */
79 };
80 
81 /* Pocket lab GUI init parameters */
83  /* Pocket lab GUI views */
85  /* Pocket lab GUI device parameters */
87  /* Init parameters extra */
88  void *extra;
89 };
90 
91 /* Pocket lab GUI view parameters */
92 struct pl_gui_views {
93  /* View name */
94  const char *view_name;
95  /* View create function */
96  int32_t(*create_view)(lv_obj_t *, struct pl_gui_init_param *);
97 };
98 
99 /* Pocket lab GUI run time parameters */
100 struct pl_gui_desc {
101  /* View object */
102  lv_obj_t *view_obj;
103 };
104 
105 int32_t pl_gui_init(struct pl_gui_desc **desc,
106  struct pl_gui_init_param *param);
107 int32_t pl_gui_create_power_up_view(lv_obj_t* parent,
108  struct pl_gui_init_param *param);
109 int32_t pl_gui_create_attributes_view(lv_obj_t* parent,
110  struct pl_gui_init_param *param);
111 int32_t pl_gui_create_register_view(lv_obj_t* parent,
112  struct pl_gui_init_param *param);
113 int32_t pl_gui_create_dmm_view(lv_obj_t* parent,
114  struct pl_gui_init_param *param);
115 int32_t pl_gui_create_capture_view(lv_obj_t* parent,
116  struct pl_gui_init_param *param);
117 int32_t pl_gui_create_analysis_view(lv_obj_t* parent,
118  struct pl_gui_init_param *param);
119 int32_t pl_gui_create_about_view(lv_obj_t* parent,
120  struct pl_gui_init_param *param);
121 uint32_t get_data_samples_count(void);
122 void pl_gui_get_capture_chns_mask(uint32_t *chn_mask);
123 void pl_gui_display_captured_data(uint8_t *buf, uint32_t rec_bytes);
124 bool pl_gui_is_dmm_running(void);
125 bool pl_gui_is_capture_running(void);
126 bool pl_gui_is_fft_running(void);
127 void pl_gui_perform_dmm_read(void);
128 uint32_t pl_gui_get_active_device_index(void);
129 float pl_gui_cnv_data_to_volt_without_vref(int32_t data, uint8_t chn);
130 float pl_gui_cnv_data_to_volt_wrt_vref(int32_t data, uint8_t chn);
131 int32_t pl_gui_cnv_code_to_straight_binary(uint32_t code, uint8_t chn);
132 
133 #endif // _PL_GUI_VIEWES_
FFT library implementation headers.
int32_t pl_gui_create_capture_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI data capture view.
Definition: pl_gui_views.c:1513
int32_t pl_gui_create_attributes_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI attributes view.
Definition: pl_gui_views.c:1059
int32_t pl_gui_init(struct pl_gui_desc **desc, struct pl_gui_init_param *param)
Init pocket lab GUI.
Definition: pl_gui_views.c:1977
uint32_t get_data_samples_count(void)
Get the count for data samples to be captured.
Definition: pl_gui_views.c:525
float pl_gui_cnv_data_to_volt_without_vref(int32_t data, uint8_t chn)
Convert input data to voltage without Vref.
Definition: pl_gui_views.c:993
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.
Definition: pl_gui_views.c:1008
int32_t pl_gui_create_about_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI about view.
Definition: pl_gui_views.c:1867
int32_t pl_gui_create_register_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI register view.
Definition: pl_gui_views.c:1215
int32_t pl_gui_create_dmm_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI DMM view.
Definition: pl_gui_views.c:1359
bool pl_gui_is_dmm_running(void)
DMM running status check.
Definition: pl_gui_views.c:582
uint32_t pl_gui_get_active_device_index(void)
Read the active device index for current view.
Definition: pl_gui_views.c:208
int32_t pl_gui_cnv_code_to_straight_binary(uint32_t code, uint8_t chn)
Convert input code to straight binary data.
Definition: pl_gui_views.c:1023
int32_t pl_gui_create_analysis_view(lv_obj_t *parent, struct pl_gui_init_param *param)
Create pocket lab GUI analysis view.
Definition: pl_gui_views.c:1722
bool pl_gui_is_capture_running(void)
Capture running status check.
Definition: pl_gui_views.c:591
void pl_gui_display_captured_data(uint8_t *buf, uint32_t rec_bytes)
Display the captured data onto GUI.
Definition: pl_gui_views.c:431
void pl_gui_perform_dmm_read(void)
Perform the DMM read operations.
Definition: pl_gui_views.c:385
bool pl_gui_is_fft_running(void)
FFT running status check.
Definition: pl_gui_views.c:600
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.
Definition: pl_gui_views.c:1038
void pl_gui_get_capture_chns_mask(uint32_t *chn_mask)
Get the channels mask based on enabled channels count.
Definition: pl_gui_views.c:550
Definition: adi_fft.h:50
Definition: pl_gui_views.h:100
lv_obj_t * view_obj
Definition: pl_gui_views.h:102
Definition: pl_gui_views.h:77
struct adi_fft_init_params * fft_params
Definition: pl_gui_views.h:78
Definition: pl_gui_views.h:82
void * extra
Definition: pl_gui_views.h:88
struct pl_gui_device_param * device_params
Definition: pl_gui_views.h:86
struct pl_gui_views * views
Definition: pl_gui_views.h:84
Definition: pl_gui_views.h:92
int32_t(* create_view)(lv_obj_t *, struct pl_gui_init_param *)
Definition: pl_gui_views.h:96
const char * view_name
Definition: pl_gui_views.h:94