mikroSDK Reference Manual
lv_arc.h
Go to the documentation of this file.
1
6#ifndef LV_ARC_H
7#define LV_ARC_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../lv_conf_internal.h"
17
18#if LV_USE_ARC != 0
19
20#include "../core/lv_obj.h"
21
22/*********************
23 * DEFINES
24 *********************/
25
26/**********************
27 * TYPEDEFS
28 **********************/
29
30enum {
31 LV_ARC_MODE_NORMAL,
32 LV_ARC_MODE_SYMMETRICAL,
33 LV_ARC_MODE_REVERSE
34};
35typedef uint8_t lv_arc_mode_t;
36
37typedef struct {
38 lv_obj_t obj;
39 uint16_t rotation;
40 uint16_t indic_angle_start;
41 uint16_t indic_angle_end;
42 uint16_t bg_angle_start;
43 uint16_t bg_angle_end;
44 int16_t value; /*Current value of the arc*/
45 int16_t min_value; /*Minimum value of the arc*/
46 int16_t max_value; /*Maximum value of the arc*/
47 uint16_t dragging : 1;
48 uint16_t type : 2;
49 uint16_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/
50 uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/
51 uint32_t last_tick; /*Last dragging event timestamp of the arc*/
52 int16_t last_angle; /*Last dragging angle of the arc*/
53} lv_arc_t;
54
55extern const lv_obj_class_t lv_arc_class;
56
61typedef enum {
62 LV_ARC_DRAW_PART_BACKGROUND,
63 LV_ARC_DRAW_PART_FOREGROUND,
64 LV_ARC_DRAW_PART_KNOB,
65} lv_arc_draw_part_type_t;
66
67/**********************
68 * GLOBAL PROTOTYPES
69 **********************/
70
76lv_obj_t * lv_arc_create(lv_obj_t * parent);
77
78/*======================
79 * Add/remove functions
80 *=====================*/
81
82/*=====================
83 * Setter functions
84 *====================*/
85
91void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start);
92
98void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end);
99
106void lv_arc_set_angles(lv_obj_t * obj, uint16_t start, uint16_t end);
107
113void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start);
114
120void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end);
121
128void lv_arc_set_bg_angles(lv_obj_t * obj, uint16_t start, uint16_t end);
129
135void lv_arc_set_rotation(lv_obj_t * obj, uint16_t rotation);
136
142void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type);
143
149void lv_arc_set_value(lv_obj_t * obj, int16_t value);
150
157void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max);
158
164void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate);
165
166/*=====================
167 * Getter functions
168 *====================*/
169
175uint16_t lv_arc_get_angle_start(lv_obj_t * obj);
176
182uint16_t lv_arc_get_angle_end(lv_obj_t * obj);
183
189uint16_t lv_arc_get_bg_angle_start(lv_obj_t * obj);
190
196uint16_t lv_arc_get_bg_angle_end(lv_obj_t * obj);
197
203int16_t lv_arc_get_value(const lv_obj_t * obj);
204
210int16_t lv_arc_get_min_value(const lv_obj_t * obj);
211
217int16_t lv_arc_get_max_value(const lv_obj_t * obj);
218
224lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj);
225
226/*=====================
227 * Other functions
228 *====================*/
229
236void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, lv_coord_t r_offset);
237
244void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_coord_t r_offset);
245
246/**********************
247 * MACROS
248 **********************/
249
250#endif /*LV_USE_ARC*/
251
252#ifdef __cplusplus
253} /*extern "C"*/
254#endif
255
256#endif /*LV_ARC_H*/
Definition lv_obj_class.h:49
Definition lv_obj.h:174