Difference between revisions of "GQUEUE"

From uGFX Wiki
Jump to: navigation, search
Line 1: Line 1:
 
The GQUEUE modules does provide queues and buffers.
 
The GQUEUE modules does provide queues and buffers.
 +
 +
== API reference ==
 +
The API reference of the GQUEUE module can be found [http://ugfx.org/images/resources/doxygen/master/group___g_q_u_e_u_e.html here].
  
 
== Buffers ==
 
== Buffers ==
 
Buffers are used to pass data from one module to another. For example, buffers are used to read an audio file from an SD-Card using the [[GFILE]] module and output it using the [[GAUDIO]] module.
 
Buffers are used to pass data from one module to another. For example, buffers are used to read an audio file from an SD-Card using the [[GFILE]] module and output it using the [[GAUDIO]] module.
  
 +
=== Allocation ===
 
A pool of buffers can be allocated using <code>gfxBufferAlloc(num, size)</code> where ''num'' is the number of buffers and ''size'' the size per buffer. The created buffer pool is global. It is not possible to have more than one buffer pool.
 
A pool of buffers can be allocated using <code>gfxBufferAlloc(num, size)</code> where ''num'' is the number of buffers and ''size'' the size per buffer. The created buffer pool is global. It is not possible to have more than one buffer pool.
  
Memory once dedicated to be come a buffer cannot be freed anymore. Therefore, the amount and size of the buffers allocated should be chosen carefully.
+
Memory once dedicated to be come a buffer cannot be freed anymore. Therefore, the number and size of the buffers allocated should be chosen carefully.
 +
 
 +
=== Handling ===
 +
<code>gfxBufferGet()</code> will return a pointer to a free buffer in the buffer pool (if any). The buffer is marked as used until it has been released using <code>gfxBufferRelease()</code>.
 +
Note that some modules like the [[GAUDIO]] module that take a buffer as a parameter usually release the buffer automatically.
  
 
== Queues ==
 
== Queues ==
 
Although the queues provided by the GQUEUE module are mainly used internally, these features are still accessible for the user.
 
Although the queues provided by the GQUEUE module are mainly used internally, these features are still accessible for the user.
 +
 +
ToDo
  
  

Revision as of 23:47, 4 July 2014

The GQUEUE modules does provide queues and buffers.

API reference

The API reference of the GQUEUE module can be found here.

Buffers

Buffers are used to pass data from one module to another. For example, buffers are used to read an audio file from an SD-Card using the GFILE module and output it using the GAUDIO module.

Allocation

A pool of buffers can be allocated using gfxBufferAlloc(num, size) where num is the number of buffers and size the size per buffer. The created buffer pool is global. It is not possible to have more than one buffer pool.

Memory once dedicated to be come a buffer cannot be freed anymore. Therefore, the number and size of the buffers allocated should be chosen carefully.

Handling

gfxBufferGet() will return a pointer to a free buffer in the buffer pool (if any). The buffer is marked as used until it has been released using gfxBufferRelease(). Note that some modules like the GAUDIO module that take a buffer as a parameter usually release the buffer automatically.

Queues

Although the queues provided by the GQUEUE module are mainly used internally, these features are still accessible for the user.

ToDo