|
EasyGUI
|
System based function for OS management, timings, etc. More...
Macros | |
| #define | GUI_SYS_MBOX_NULL (osMessageQId)0 |
| Value indicating message queue is not valid. More... | |
| #define | GUI_SYS_SEM_NULL (osSemaphoreId)0 |
| Value indicating semaphore is not valid. More... | |
| #define | GUI_SYS_MUTEX_NULL (osMutexId)0 |
| Value indicating mutex is not valid. More... | |
| #define | GUI_SYS_TIMEOUT ((uint32_t)osWaitForever) |
| Value indicating timeout for OS timings. More... | |
| #define | GUI_SYS_THREAD_PRIO (osPriorityNormal) |
| ESP stack threads priority parameter. More... | |
| #define | GUI_SYS_THREAD_SS (1024) |
| Stack size of system threads. More... | |
Typedefs | |
| typedef void(* | gui_sys_thread_fn) (void *) |
| Thread function prototype. | |
| typedef osMutexId | gui_sys_mutex_t |
| ESP system mutex ID type. More... | |
| typedef osSemaphoreId | gui_sys_sem_t |
| ESP system semaphore ID type. More... | |
| typedef osMessageQId | gui_sys_mbox_t |
| ESP system message queue ID type. More... | |
| typedef osThreadId | gui_sys_thread_t |
| ESP system thread ID type. More... | |
| typedef osPriority | gui_sys_thread_prio_t |
| ESP system thread priority type. More... | |
Functions | |
| uint8_t | gui_sys_init (void) |
| Init system dependant parameters. More... | |
| uint32_t | gui_sys_now (void) |
| Get current time in units of milliseconds. More... | |
| uint8_t | gui_sys_protect (void) |
| Unprotect stack core. More... | |
| uint8_t | gui_sys_unprotect (void) |
| Unprotect stack core. More... | |
| uint8_t | gui_sys_mutex_create (gui_sys_mutex_t *p) |
| Create a new mutex and pass it to input pointer. More... | |
| uint8_t | gui_sys_mutex_delete (gui_sys_mutex_t *p) |
| Delete mutex from OS. More... | |
| uint8_t | gui_sys_mutex_lock (gui_sys_mutex_t *p) |
| Wait forever to lock the mutex. More... | |
| uint8_t | gui_sys_mutex_unlock (gui_sys_mutex_t *p) |
| Unlock mutex. More... | |
| uint8_t | gui_sys_mutex_isvalid (gui_sys_mutex_t *p) |
| Check if mutex structure is valid OS entry. More... | |
| uint8_t | gui_sys_mutex_invalid (gui_sys_mutex_t *p) |
| Set mutex structure as invalid. More... | |
| uint8_t | gui_sys_sem_create (gui_sys_sem_t *p, uint8_t cnt) |
| Create a new binary semaphore and set initial state. More... | |
| uint8_t | gui_sys_sem_delete (gui_sys_sem_t *p) |
| Delete binary semaphore. More... | |
| uint32_t | gui_sys_sem_wait (gui_sys_sem_t *p, uint32_t timeout) |
| Wait for semaphore to be available. More... | |
| uint8_t | gui_sys_sem_release (gui_sys_sem_t *p) |
| Release semaphore. More... | |
| uint8_t | gui_sys_sem_isvalid (gui_sys_sem_t *p) |
| Check if semaphore is valid. More... | |
| uint8_t | gui_sys_sem_invalid (gui_sys_sem_t *p) |
| Invalid semaphore. More... | |
| uint8_t | gui_sys_mbox_create (gui_sys_mbox_t *b, size_t size) |
Create a new message queue with entry type of void * More... | |
| uint8_t | gui_sys_mbox_delete (gui_sys_mbox_t *b) |
| Delete message queue. More... | |
| uint32_t | gui_sys_mbox_put (gui_sys_mbox_t *b, void *m) |
| Put a new entry to message queue and wait until memory available. More... | |
| uint32_t | gui_sys_mbox_get (gui_sys_mbox_t *b, void **m, uint32_t timeout) |
| Get a new entry from message queue with timeout. More... | |
| uint8_t | gui_sys_mbox_putnow (gui_sys_mbox_t *b, void *m) |
| Put a new entry to message queue without timeout (now or fail) More... | |
| uint8_t | gui_sys_mbox_getnow (gui_sys_mbox_t *b, void **m) |
| Get an entry from message queue immediatelly. More... | |
| uint8_t | gui_sys_mbox_isvalid (gui_sys_mbox_t *b) |
| Check if message queue is valid. More... | |
| uint8_t | gui_sys_mbox_invalid (gui_sys_mbox_t *b) |
| Invalid message queue. More... | |
| uint8_t | gui_sys_thread_create (gui_sys_thread_t *t, const char *name, gui_sys_thread_fn thread_fn, void *const arg, size_t stack_size, gui_sys_thread_prio_t prio) |
| Create a new thread. More... | |
| uint8_t | gui_sys_thread_terminate (gui_sys_thread_t *t) |
| uint8_t | gui_sys_thread_yield (void) |
System ports | |
|
List of already available system ports. Configure GUI_CFG_SYS_PORT with one of these values to use preconfigured ports | |
| #define | GUI_SYS_PORT_CMSIS_OS 1 |
| #define | GUI_SYS_PORT_WIN32 2 |
System based function for OS management, timings, etc.
| #define GUI_SYS_MBOX_NULL (osMessageQId)0 |
Value indicating message queue is not valid.
| #define GUI_SYS_MUTEX_NULL (osMutexId)0 |
Value indicating mutex is not valid.
| #define GUI_SYS_PORT_CMSIS_OS 1 |
CMSIS-OS based port for OS systems capable of ARM CMSIS standard
| #define GUI_SYS_PORT_WIN32 2 |
WIN32 based port to use ESP library with Windows applications
| #define GUI_SYS_SEM_NULL (osSemaphoreId)0 |
Value indicating semaphore is not valid.
| #define GUI_SYS_THREAD_PRIO (osPriorityNormal) |
ESP stack threads priority parameter.
| #define GUI_SYS_THREAD_SS (1024) |
Stack size of system threads.
| #define GUI_SYS_TIMEOUT ((uint32_t)osWaitForever) |
Value indicating timeout for OS timings.
| typedef osMessageQId gui_sys_mbox_t |
ESP system message queue ID type.
| typedef osMutexId gui_sys_mutex_t |
ESP system mutex ID type.
| typedef osSemaphoreId gui_sys_sem_t |
ESP system semaphore ID type.
| typedef osPriority gui_sys_thread_prio_t |
ESP system thread priority type.
| typedef osThreadId gui_sys_thread_t |
ESP system thread ID type.
| uint8_t gui_sys_init | ( | void | ) |
Init system dependant parameters.
1 on success, 0 otherwise | uint8_t gui_sys_mbox_create | ( | gui_sys_mbox_t * | b, |
| size_t | size | ||
| ) |
Create a new message queue with entry type of void *
| [out] | b | Pointer to message queue structure |
| [in] | size | Number of entries for message queue to hold |
1 on success, 0 otherwise | uint8_t gui_sys_mbox_delete | ( | gui_sys_mbox_t * | b | ) |
Delete message queue.
| [in] | b | Pointer to message queue structure |
1 on success, 0 otherwise | uint32_t gui_sys_mbox_get | ( | gui_sys_mbox_t * | b, |
| void ** | m, | ||
| uint32_t | timeout | ||
| ) |
Get a new entry from message queue with timeout.
| [in] | b | Pointer to message queue structure |
| [in] | m | Pointer to pointer to result to save value from message queue to |
| [in] | timeout | Maximal timeout to wait for new message. When 0 is applied, wait for unlimited time |
| uint8_t gui_sys_mbox_getnow | ( | gui_sys_mbox_t * | b, |
| void ** | m | ||
| ) |
Get an entry from message queue immediatelly.
| [in] | b | Pointer to message queue structure |
| [in] | m | Pointer to pointer to result to save value from message queue to |
1 on success, 0 otherwise | uint8_t gui_sys_mbox_invalid | ( | gui_sys_mbox_t * | b | ) |
Invalid message queue.
| [in] | b | Pointer to message queue structure |
1 on success, 0 otherwise | uint8_t gui_sys_mbox_isvalid | ( | gui_sys_mbox_t * | b | ) |
Check if message queue is valid.
| [in] | b | Pointer to message queue structure |
1 on success, 0 otherwise | uint32_t gui_sys_mbox_put | ( | gui_sys_mbox_t * | b, |
| void * | m | ||
| ) |
Put a new entry to message queue and wait until memory available.
| [in] | b | Pointer to message queue structure |
| [in] | m | Pointer to entry to insert to message queue |
| uint8_t gui_sys_mbox_putnow | ( | gui_sys_mbox_t * | b, |
| void * | m | ||
| ) |
Put a new entry to message queue without timeout (now or fail)
| [in] | b | Pointer to message queue structure |
| [in] | m | Pointer to message to save to queue |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_create | ( | gui_sys_mutex_t * | p | ) |
Create a new mutex and pass it to input pointer.
| [out] | p | Pointer to mutex structure to save result to |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_delete | ( | gui_sys_mutex_t * | p | ) |
Delete mutex from OS.
| [in] | p | Pointer to mutex structure |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_invalid | ( | gui_sys_mutex_t * | p | ) |
Set mutex structure as invalid.
| [in] | p | Pointer to mutex structure |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_isvalid | ( | gui_sys_mutex_t * | p | ) |
Check if mutex structure is valid OS entry.
| [in] | p | Pointer to mutex structure |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_lock | ( | gui_sys_mutex_t * | p | ) |
Wait forever to lock the mutex.
| [in] | p | Pointer to mutex structure |
1 on success, 0 otherwise | uint8_t gui_sys_mutex_unlock | ( | gui_sys_mutex_t * | p | ) |
Unlock mutex.
| [in] | p | Pointer to mutex structure |
1 on success, 0 otherwise | uint32_t gui_sys_now | ( | void | ) |
Get current time in units of milliseconds.
| uint8_t gui_sys_protect | ( | void | ) |
Unprotect stack core.
1 on success, 0 otherwise | uint8_t gui_sys_sem_create | ( | gui_sys_sem_t * | p, |
| uint8_t | cnt | ||
| ) |
Create a new binary semaphore and set initial state.
| [out] | p | Pointer to semaphore structure to fill with result |
| [in] | cnt | Count indicating default semaphore state: 0: Lock it immediteally 1: Leave it unlocked |
1 on success, 0 otherwise | uint8_t gui_sys_sem_delete | ( | gui_sys_sem_t * | p | ) |
Delete binary semaphore.
| [in] | p | Pointer to semaphore structure |
1 on success, 0 otherwise | uint8_t gui_sys_sem_invalid | ( | gui_sys_sem_t * | p | ) |
Invalid semaphore.
| [in] | p | Pointer to semaphore structure |
1 on success, 0 otherwise | uint8_t gui_sys_sem_isvalid | ( | gui_sys_sem_t * | p | ) |
Check if semaphore is valid.
| [in] | p | Pointer to semaphore structure |
1 on success, 0 otherwise | uint8_t gui_sys_sem_release | ( | gui_sys_sem_t * | p | ) |
Release semaphore.
| [in] | p | Pointer to semaphore structure |
1 on success, 0 otherwise | uint32_t gui_sys_sem_wait | ( | gui_sys_sem_t * | p, |
| uint32_t | timeout | ||
| ) |
Wait for semaphore to be available.
| [in] | p | Pointer to semaphore structure |
| [in] | timeout | Timeout to wait in milliseconds. When 0 is applied, wait forever |
| uint8_t gui_sys_thread_create | ( | gui_sys_thread_t * | t, |
| const char * | name, | ||
| void(*)(void *) | thread_func, | ||
| void *const | arg, | ||
| size_t | stack_size, | ||
| gui_sys_thread_prio_t | prio | ||
| ) |
Create a new thread.
| [out] | t | Pointer to thread identifier if create was successful |
| [in] | name | Name of a new thread |
| [in] | thread_func | Thread function to use as thread body |
| [in] | arg | Thread function argument |
| [in] | stack_size | Size of thread stack in uints of bytes. If set to 0, reserve default stack size |
| [in] | prio | Thread priority |
1 on success, 0 otherwise | uint8_t gui_sys_unprotect | ( | void | ) |
Unprotect stack core.
1 on success, 0 otherwise