# lv_async.h (/api/misc/lv_async_h)



<ApiSummary functions="2" typedefs="1" />

Functions [#functions]

<ApiMember kind="function" name="lv_async_call" file="misc/lv_async.h" line="44" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_async.h#L44">
  lv_async_call [#lv_async_call]

  Call an asynchronous function the next time <ApiLink name="lv_timer_handler" display="lv_timer_handler()" /> is run. This function is likely to return **before** the call actually happens!

  ```c title=" " lineNumbers=1
  lv_result_t lv_async_call(lv_async_cb_t async_xcb, void *user_data)
  ```

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

  | Name        | Type                             | Description                                                                                                                                                                                   |
  | ----------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `async_xcb` | <ApiLink name="lv_async_cb_t" /> | a callback which is the task itself. (the 'x' in the argument name indicates that it's not a fully generic function because it not follows the `func_name(object, callback, ...)` convention) |
  | `user_data` | `void *`                         | custom parameter                                                                                                                                                                              |
</ApiMember>

<ApiMember kind="function" name="lv_async_call_cancel" file="misc/lv_async.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_async.h#L51">
  lv_async_call_cancel [#lv_async_call_cancel]

  Cancel an asynchronous function call

  ```c title=" " lineNumbers=1
  lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void *user_data)
  ```

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

  | Name        | Type                             | Description                          |
  | ----------- | -------------------------------- | ------------------------------------ |
  | `async_xcb` | <ApiLink name="lv_async_cb_t" /> | a callback which is the task itself. |
  | `user_data` | `void *`                         | custom parameter                     |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_async_cb_t" file="misc/lv_async.h" line="30" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_async.h#L30">
  lv_async_cb_t [#lv_async_cb_t]

  ```c title=" " lineNumbers=1
  typedef void(* lv_async_cb_t) (void *)
  ```

  Type for async callback.
</ApiMember>

<TypeUsedBy name="lv_async_cb_t" count="2">
  * `lv_async_call` — param `async_xcb`
  * `lv_async_call_cancel` — param `async_xcb`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_types.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;]" />
