lv_os.h

Enums

enum lv_thread_prio_t

Values:

enumerator LV_THREAD_PRIO_LOWEST
enumerator LV_THREAD_PRIO_LOW
enumerator LV_THREAD_PRIO_MID
enumerator LV_THREAD_PRIO_HIGH
enumerator LV_THREAD_PRIO_HIGHEST

Functions

lv_result_t lv_thread_init(lv_thread_t *thread, lv_thread_prio_t prio, void (*callback)(void*), size_t stack_size, void *user_data)

Create a new thread

参数:
  • thread -- a variable in which the thread will be stored

  • prio -- priority of the thread

  • callback -- function of the thread

  • stack_size -- stack size in bytes

  • user_data -- arbitrary data, will be available in the callback

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_thread_delete(lv_thread_t *thread)

Delete a thread

参数:

thread -- the thread to delete

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_mutex_init(lv_mutex_t *mutex)

Create a mutex

参数:

mutex -- a variable in which the thread will be stored

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_mutex_lock(lv_mutex_t *mutex)

Lock a mutex

参数:

mutex -- the mutex to lock

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_mutex_lock_isr(lv_mutex_t *mutex)

Lock a mutex from interrupt

参数:

mutex -- the mutex to lock

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_mutex_unlock(lv_mutex_t *mutex)

Unlock a mutex

参数:

mutex -- the mutex to unlock

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_mutex_delete(lv_mutex_t *mutex)

Delete a mutex

参数:

mutex -- the mutex to delete

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_thread_sync_init(lv_thread_sync_t *sync)

Create a thread synchronization object

参数:

sync -- a variable in which the sync will be stored

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_thread_sync_wait(lv_thread_sync_t *sync)

Wait for a "signal" on a sync object

参数:

sync -- a sync object

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_thread_sync_signal(lv_thread_sync_t *sync)

Send a wake-up signal to a sync object

参数:

sync -- a sync object

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure

lv_result_t lv_thread_sync_delete(lv_thread_sync_t *sync)

Delete a sync object

参数:

sync -- a sync object to delete

返回:

LV_RESULT_OK: success; LV_RESULT_INVALID: failure