# lv_spinner.h (/api/widgets/spinner/lv_spinner_h)



<RelatedHeaders name="lv_spinner_private.h" isPrivate="false" />

<ApiSummary functions="6" enums="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (3)&#x22;,&#x22;Getters (2)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Setters (3)">
    <ApiMember kind="function" name="lv_spinner_set_anim_params" file="widgets/spinner/lv_spinner.h" line="63" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L63">
      lv_spinner_set_anim_params [#lv_spinner_set_anim_params]

      Set the animation time and arc length of the spinner The animation is suited for angle values between 180 and 360.

      ```c title=" " lineNumbers=1
      void lv_spinner_set_anim_params(lv_obj_t *obj, uint32_t t, uint32_t angle)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                        |
      | ------- | ------------------------------------------------ | ---------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner               |
      | `t`     | <ApiLink name="uint32_t" />                      | the animation time in milliseconds |
      | `angle` | <ApiLink name="uint32_t" />                      | the angle of the arc in degrees    |
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_set_anim_duration" file="widgets/spinner/lv_spinner.h" line="70" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L70">
      lv_spinner_set_anim_duration [#lv_spinner_set_anim_duration]

      Set the animation time of the spinner

      ```c title=" " lineNumbers=1
      void lv_spinner_set_anim_duration(lv_obj_t *obj, uint32_t t)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                        |
      | ----- | ------------------------------------------------ | ---------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner               |
      | `t`   | <ApiLink name="uint32_t" />                      | the animation time in milliseconds |
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_set_arc_sweep" file="widgets/spinner/lv_spinner.h" line="78" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L78">
      lv_spinner_set_arc_sweep [#lv_spinner_set_arc_sweep]

      Set the animation arc length of the spinner. The animation is suited to values between 180 and 360.

      ```c title=" " lineNumbers=1
      void lv_spinner_set_arc_sweep(lv_obj_t *obj, uint32_t angle)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner            |
      | `angle` | <ApiLink name="uint32_t" />                      | the angle of the arc in degrees |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_spinner_get_anim_duration" file="widgets/spinner/lv_spinner.h" line="85" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L85">
      lv_spinner_get_anim_duration [#lv_spinner_get_anim_duration]

      Get the animation duration of the spinner

      ```c title=" " lineNumbers=1
      uint32_t lv_spinner_get_anim_duration(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description          |
      | ----- | ------------------------------------------------ | -------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner |

      **Returns:** <ApiLink name="uint32_t" /> — the animation time in milliseconds
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_get_arc_sweep" file="widgets/spinner/lv_spinner.h" line="92" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L92">
      lv_spinner_get_arc_sweep [#lv_spinner_get_arc_sweep]

      Get the animation arc length of the spinner

      ```c title=" " lineNumbers=1
      uint32_t lv_spinner_get_arc_sweep(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description          |
      | ----- | ------------------------------------------------ | -------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner |

      **Returns:** <ApiLink name="uint32_t" /> — the angle of the arc in degrees
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_spinner_create" file="widgets/spinner/lv_spinner.h" line="54" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L54">
      lv_spinner_create [#lv_spinner_create]

      Create a spinner widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_spinner_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                     |
      | -------- | ------------------------------------------------ | --------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an object, it will be the parent of the new spinner. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the created spinner
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_spinner_id_t" file="widgets/spinner/lv_spinner.h" line="38" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L38">
  \_lv_property_spinner_id_t [#_lv_property_spinner_id_t]

  | Name                                | Value                                                            |
  | ----------------------------------- | ---------------------------------------------------------------- |
  | `LV_PROPERTY_SPINNER_ANIM_DURATION` | `(LV_PROPERTY_SPINNER_START + ((int) 0 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPINNER_ARC_SWEEP`     | `(LV_PROPERTY_SPINNER_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPINNER_END`           |                                                                  |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_spinner_class" file="widgets/spinner/lv_spinner.h" line="35" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/spinner/lv_spinner.h#L35">
  lv_spinner_class [#lv_spinner_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_spinner_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_obj_property.h&#x22;]" includedBy="[&#x22;lv_spinner_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;]" />
