lv_utils.h

API reference for lv_utils.h

Report on GitHub
Summary

Functions

lv_utils_bsearch

Searches base[0] to base[n - 1] for an item that matches *key.

 
void * lv_utils_bsearch(const void *key, const void *base, size_t n, size_t size, int(*cmp)(const void *pRef, const void *pElement))
Parameters
NameTypeDescription
keyconst void *Pointer to item being searched for
baseconst void *Pointer to first element to search
nsize_tNumber of elements
sizesize_tSize of each element
cmpint(*)(const void *pRef, const void *pElement)Pointer to comparison function (see unicode_list_compare() as a comparison function example)

Returns: void * — a pointer to a matching item, or NULL if none exists.

The function cmp must return negative if it's first argument (the search key) is less that it's second (a table entry), zero if equal, and positive if greater.

Items in the array must be in ascending order.

lv_draw_buf_save_to_file

Save a draw buf to a file

 
lv_result_t lv_draw_buf_save_to_file(const lv_draw_buf_t *draw_buf, const char *path)
Parameters
NameTypeDescription
draw_bufconst lv_draw_buf_t *pointer to a draw buffer
pathconst char *path to the file to save

Returns: lv_result_t — LV_RESULT_OK: success; LV_RESULT_INVALID: error

lv_swap_bytes_32

Reverse the order of the bytes in a 32-bit value.

 
static uint32_t lv_swap_bytes_32(uint32_t x)
Parameters
NameTypeDescription
xuint32_ta 32-bit value.

Returns: uint32_t — the value x with reversed byte-order.

lv_swap_bytes_16

Reverse the order of the bytes in a 16-bit value.

 
static uint16_t lv_swap_bytes_16(uint16_t x)
Parameters
NameTypeDescription
xuint16_ta 16-bit value.

Returns: uint16_t — the value x with reversed byte-order.

Dependencies

How is this guide?

Last updated on

On this page