Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Memory Management

AIROC Memory Management Interface. More...

Macros

#define wiced_memory_permanent_allocate(a)   dynamic_memory_AllocatePermanent(a, WICED_FALSE)
 Allocates memory for permanent usage. More...
 

Typedefs

typedef struct wiced_pool_t wiced_bt_buffer_pool_t
 wiced buffer pool
 
struct {
   uint8_t   pool_id
 pool id
 
   uint16_t   pool_size
 pool buffer size
 
   uint16_t   current_allocated_count
 number of buffers currently allocated
 
   uint16_t   max_allocated_count
 maximum number of buffers allocated at any time
 
   uint16_t   total_count
 total number of buffers
 
wiced_bt_buffer_statistics_t
 AIROC Bluetooth dynamic buffer statistics.
 

Functions

void * dynamic_memory_AllocatePermanent (uint32_t size_bytes, wiced_bool_t allow_use_by_minidriver)
 
uint32_t wiced_memory_get_free_bytes (void)
 Function wiced_memory_get_free_bytes. More...
 
wiced_bool_t wiced_memory_set_application_thread_stack_size (uint16_t new_stack_size)
 Function wiced_memory_set_application_thread_stack_size. More...
 
wiced_bt_buffer_pool_twiced_bt_create_pool (uint32_t buffer_size, uint32_t buffer_cnt)
 Function wiced_bt_create_pool. More...
 
void * wiced_bt_get_buffer_from_pool (wiced_bt_buffer_pool_t *p_pool)
 Function wiced_bt_get_buffer_from_pool. More...
 
uint32_t wiced_bt_get_buffer_count (wiced_bt_buffer_pool_t *p_pool)
 Function wiced_bt_get_buffer_count. More...
 
void * wiced_bt_get_buffer (uint16_t buffer_size)
 Function wiced_bt_get_buffer. More...
 
void wiced_bt_free_buffer (void *p_buf)
 Function wiced_bt_free_buffer. More...
 
uint32_t wiced_bt_get_buffer_size (void *p_buf)
 Function wiced_bt_get_buffer_size. More...
 
wiced_result_t wiced_bt_get_buffer_usage (wiced_bt_buffer_statistics_t *p_buffer_stat, uint16_t size)
 Function wiced_bt_get_buffer_usage. More...
 
void * wiced_memory_allocate (uint32_t size)
 Function wiced_memory_allocate. More...
 
void wiced_memory_free (void *memoryBlock)
 Function wiced_memory_free. More...
 

Detailed Description

AIROC Memory Management Interface.

Macro Definition Documentation

#define wiced_memory_permanent_allocate (   a)    dynamic_memory_AllocatePermanent(a, WICED_FALSE)

Allocates memory for permanent usage.

Parameters
sizeThe size of the memory to be allocated
Returns
The pointer to the allocated memory on success NULL on failure

Function Documentation

wiced_bt_buffer_pool_t* wiced_bt_create_pool ( uint32_t  buffer_size,
uint32_t  buffer_cnt 
)

Function wiced_bt_create_pool.

Creates a private pool dedicated for the application usage.

Parameters
[in]buffer_size:size of the buffers in the pool
[in]buffer_cnt:number of buffers in the pool
Returns
pointer to the created pool on success NULL on failure
void wiced_bt_free_buffer ( void *  p_buf)

Function wiced_bt_free_buffer.

Frees the buffer

Parameters
[in]p_buf: pointer to the start of the buffer to be freed
Returns
None
void* wiced_bt_get_buffer ( uint16_t  buffer_size)

Function wiced_bt_get_buffer.

Allocates a buffer from the public pools. Public pools shall be specified using wiced_bt_cfg_buf_pool_t from the application.

Parameters
[in]buffer_size: size of the buffer
Returns
the pointer to the buffer NULL on failure
uint32_t wiced_bt_get_buffer_count ( wiced_bt_buffer_pool_t p_pool)

Function wiced_bt_get_buffer_count.

To get the number of buffers available in the pool

Parameters
[in]p_pool: pool pointer
Returns
the number of buffers available in the pool
void* wiced_bt_get_buffer_from_pool ( wiced_bt_buffer_pool_t p_pool)

Function wiced_bt_get_buffer_from_pool.

Allocates a buffer from the private pool. Pass the pool pointer to get the buffer from the desired pool

Parameters
[in]p_pool: pool pointer
Returns
the pointer to the buffer NULL on failure
uint32_t wiced_bt_get_buffer_size ( void *  p_buf)

Function wiced_bt_get_buffer_size.

Gets the buffer size

Parameters
[in]p_buf: pointer to the start of the buffer
Returns
the buffer size
wiced_result_t wiced_bt_get_buffer_usage ( wiced_bt_buffer_statistics_t p_buffer_stat,
uint16_t  size 
)

Function wiced_bt_get_buffer_usage.

Dumps dynamic buffer usage (see wiced_bt_buffer_statistics_t),from the last start of the system.

Parameters
[in]p_buffer_stat- pointer buffer to fill statistics.
[in]size- size of the memory to get the statistics.
Returns
WICED_BT_SUCCESS on success else error
void* wiced_memory_allocate ( uint32_t  size)

Function wiced_memory_allocate.

Allocates memory from Dynamic Memory pools

Parameters
[in]size:size of the memory to be allocated
Returns
pointer to the allocated memory on success NULL on failure
void wiced_memory_free ( void *  memoryBlock)

Function wiced_memory_free.

Frees the buffer

Parameters
[in]p_buf: free memory allocated from Dynamic Memory pools
Returns
None
uint32_t wiced_memory_get_free_bytes ( void  )

Function wiced_memory_get_free_bytes.

Returns the number of free bytes of RAM left

Returns
the number of free bytes of RAM left
wiced_bool_t wiced_memory_set_application_thread_stack_size ( uint16_t  new_stack_size)

Function wiced_memory_set_application_thread_stack_size.

Update the stack size of the application thread (MPAF)

NOTE : This API will work only when invoked from SPAR_CRT_SETUP()

Parameters
[in]new_stack_size- required size of the stack.
Returns
TRUE on success else FALSE