EasyGUI  Version v1.0

Port functions for messages. More...

Functions

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...
 

Detailed Description

Port functions for messages.

Messages are used for communication between different threads

Function Documentation

◆ gui_sys_mbox_create()

uint8_t gui_sys_mbox_create ( gui_sys_mbox_t b,
size_t  size 
)

Create a new message queue with entry type of "void *".

Note
This function is required with OS
Parameters
[out]bPointer to message queue structure
[in]sizeNumber of entries for message queue to hold
Returns
1 on success, 0 otherwise

◆ gui_sys_mbox_delete()

uint8_t gui_sys_mbox_delete ( gui_sys_mbox_t b)

Delete message queue.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
Returns
1 on success, 0 otherwise

◆ gui_sys_mbox_get()

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.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
[in]mPointer to pointer to result to save value from message queue to
[in]timeoutMaximal timeout to wait for new message. When 0 is applied, wait for unlimited time
Returns
Time in units of milliseconds needed to put a message to queue

◆ gui_sys_mbox_getnow()

uint8_t gui_sys_mbox_getnow ( gui_sys_mbox_t b,
void **  m 
)

Get an entry from message queue immediatelly.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
[in]mPointer to pointer to result to save value from message queue to
Returns
1 on success, 0 otherwise

◆ gui_sys_mbox_invalid()

uint8_t gui_sys_mbox_invalid ( gui_sys_mbox_t b)

Invalid message queue.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
Returns
1 on success, 0 otherwise

◆ gui_sys_mbox_isvalid()

uint8_t gui_sys_mbox_isvalid ( gui_sys_mbox_t b)

Check if message queue is valid.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
Returns
1 on success, 0 otherwise

◆ gui_sys_mbox_put()

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.

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
[in]mPointer to entry to insert to message queue
Returns
Time in units of milliseconds needed to put a message to queue

◆ gui_sys_mbox_putnow()

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)

Note
This function is required with OS
Parameters
[in]bPointer to message queue structure
[in]mPointer to message to save to queue
Returns
1 on success, 0 otherwise