lv_arc.h

Typedefs

typedef _lv_arc_mode_t lv_arc_mode_t

Enums

enum _lv_arc_mode_t

Values:

enumerator LV_ARC_MODE_NORMAL
enumerator LV_ARC_MODE_SYMMETRICAL
enumerator LV_ARC_MODE_REVERSE
enum lv_arc_draw_part_type_t

type field in lv_obj_draw_part_dsc_t if class_p = lv_arc_class Used in LV_EVENT_DRAW_PART_BEGIN and LV_EVENT_DRAW_PART_END

Values:

enumerator LV_ARC_DRAW_PART_BACKGROUND

The background arc

enumerator LV_ARC_DRAW_PART_FOREGROUND

The foreground arc

enumerator LV_ARC_DRAW_PART_KNOB

The knob

Functions

lv_obj_t *lv_arc_create(lv_obj_t *parent)

Create an arc object

Parameters:

parent -- pointer to an object, it will be the parent of the new arc

Returns:

pointer to the created arc

void lv_arc_set_start_angle(lv_obj_t *obj, uint16_t start)

Set the start angle of an arc. 0 deg: right, 90 bottom, etc.

Parameters:
  • obj -- pointer to an arc object

  • start -- the start angle

void lv_arc_set_end_angle(lv_obj_t *obj, uint16_t end)

Set the end angle of an arc. 0 deg: right, 90 bottom, etc.

Parameters:
  • obj -- pointer to an arc object

  • end -- the end angle

void lv_arc_set_angles(lv_obj_t *obj, uint16_t start, uint16_t end)

Set the start and end angles

Parameters:
  • obj -- pointer to an arc object

  • start -- the start angle

  • end -- the end angle

void lv_arc_set_bg_start_angle(lv_obj_t *obj, uint16_t start)

Set the start angle of an arc background. 0 deg: right, 90 bottom, etc.

Parameters:
  • obj -- pointer to an arc object

  • start -- the start angle

void lv_arc_set_bg_end_angle(lv_obj_t *obj, uint16_t end)

Set the start angle of an arc background. 0 deg: right, 90 bottom etc.

Parameters:
  • obj -- pointer to an arc object

  • end -- the end angle

void lv_arc_set_bg_angles(lv_obj_t *obj, uint16_t start, uint16_t end)

Set the start and end angles of the arc background

Parameters:
  • obj -- pointer to an arc object

  • start -- the start angle

  • end -- the end angle

void lv_arc_set_rotation(lv_obj_t *obj, uint16_t rotation)

Set the rotation for the whole arc

Parameters:
  • obj -- pointer to an arc object

  • rotation -- rotation angle

void lv_arc_set_mode(lv_obj_t *obj, lv_arc_mode_t type)

Set the type of arc.

Parameters:
  • obj -- pointer to arc object

  • type -- arc's mode

void lv_arc_set_value(lv_obj_t *obj, int16_t value)

Set a new value on the arc

Parameters:
  • obj -- pointer to an arc object

  • value -- new value

void lv_arc_set_range(lv_obj_t *obj, int16_t min, int16_t max)

Set minimum and the maximum values of an arc

Parameters:
  • obj -- pointer to the arc object

  • min -- minimum value

  • max -- maximum value

void lv_arc_set_change_rate(lv_obj_t *obj, uint16_t rate)

Set a change rate to limit the speed how fast the arc should reach the pressed point.

Parameters:
  • obj -- pointer to an arc object

  • rate -- the change rate

void lv_arc_set_knob_offset(lv_obj_t *arc, int16_t offset)

Set an offset for the knob from the main arc object

Parameters:
  • arc -- pointer to an arc object

  • offset -- knob offset from main arc

uint16_t lv_arc_get_angle_start(lv_obj_t *obj)

Get the start angle of an arc.

Parameters:

obj -- pointer to an arc object

Returns:

the start angle [0..360]

uint16_t lv_arc_get_angle_end(lv_obj_t *obj)

Get the end angle of an arc.

Parameters:

obj -- pointer to an arc object

Returns:

the end angle [0..360]

uint16_t lv_arc_get_bg_angle_start(lv_obj_t *obj)

Get the start angle of an arc background.

Parameters:

obj -- pointer to an arc object

Returns:

the start angle [0..360]

uint16_t lv_arc_get_bg_angle_end(lv_obj_t *obj)

Get the end angle of an arc background.

Parameters:

obj -- pointer to an arc object

Returns:

the end angle [0..360]

int16_t lv_arc_get_value(const lv_obj_t *obj)

Get the value of an arc

Parameters:

obj -- pointer to an arc object

Returns:

the value of the arc

int16_t lv_arc_get_min_value(const lv_obj_t *obj)

Get the minimum value of an arc

Parameters:

obj -- pointer to an arc object

Returns:

the minimum value of the arc

int16_t lv_arc_get_max_value(const lv_obj_t *obj)

Get the maximum value of an arc

Parameters:

obj -- pointer to an arc object

Returns:

the maximum value of the arc

lv_arc_mode_t lv_arc_get_mode(const lv_obj_t *obj)

Get whether the arc is type or not.

Parameters:

obj -- pointer to an arc object

Returns:

arc's mode

int16_t lv_arc_get_rotation(const lv_obj_t *obj)

Get the rotation for the whole arc

Parameters:

obj -- pointer to an arc object

Returns:

arc's current rotation

int16_t lv_arc_get_knob_offset(const lv_obj_t *obj)

Get the current knob offset

Parameters:

obj -- pointer to an arc object

Returns:

arc's current knob offset

void lv_arc_align_obj_to_angle(const lv_obj_t *obj, lv_obj_t *obj_to_align, lv_coord_t r_offset)

Align an object to the current position of the arc (knob)

Parameters:
  • obj -- pointer to an arc object

  • obj_to_align -- pointer to an object to align

  • r_offset -- consider the radius larger with this value (< 0: for smaller radius)

void lv_arc_rotate_obj_to_angle(const lv_obj_t *obj, lv_obj_t *obj_to_rotate, lv_coord_t r_offset)

Rotate an object to the current position of the arc (knob)

Parameters:
  • obj -- pointer to an arc object

  • obj_to_rotate -- pointer to an object to rotate

  • r_offset -- consider the radius larger with this value (< 0: for smaller radius)

Variables

const lv_obj_class_t lv_arc_class
struct lv_arc_t

Public Members

lv_obj_t obj
uint16_t rotation
uint16_t indic_angle_start
uint16_t indic_angle_end
uint16_t bg_angle_start
uint16_t bg_angle_end
int16_t value
int16_t min_value
int16_t max_value
uint16_t dragging
uint16_t type
uint16_t min_close
uint16_t chg_rate
uint32_t last_tick
int16_t last_angle
int16_t knob_offset