1 /** 2 * @file lv_async.h 3 * 4 */ 5 6 #ifndef LV_ASYNC_H 7 #define LV_ASYNC_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 17 #include "lv_types.h" 18 19 /********************* 20 * DEFINES 21 *********************/ 22 23 /********************** 24 * TYPEDEFS 25 **********************/ 26 27 /** 28 * Type for async callback. 29 */ 30 typedef void (*lv_async_cb_t)(void *); 31 32 /********************** 33 * GLOBAL PROTOTYPES 34 **********************/ 35 36 /** 37 * Call an asynchronous function the next time lv_timer_handler() is run. This function is likely to return 38 * **before** the call actually happens! 39 * @param async_xcb a callback which is the task itself. 40 * (the 'x' in the argument name indicates that it's not a fully generic function because it not follows 41 * the `func_name(object, callback, ...)` convention) 42 * @param user_data custom parameter 43 */ 44 lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); 45 46 /** 47 * Cancel an asynchronous function call 48 * @param async_xcb a callback which is the task itself. 49 * @param user_data custom parameter 50 */ 51 lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data); 52 53 /********************** 54 * MACROS 55 **********************/ 56 57 #ifdef __cplusplus 58 } /*extern "C"*/ 59 #endif 60 61 #endif /*LV_ASYNC_H*/ 62