nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Memory pool library

Memory pool implementation, based on circular buffer data structure, which supports asynchronous processing of RX data. The current default implementation supports 1 TX buffer and 4 RX buffers. The memory managed by the pool is allocated from static storage instead of heap. The internal design of the circular buffer implementing the RX memory layout is illustrated in the picture below.

memory_pool.png
Circular buffer design

The expected call order for the RX APIs is as follows:

  • hci_mem_pool_rx_produce
  • hci_mem_pool_rx_data_size_set
  • hci_mem_pool_rx_extract
  • hci_mem_pool_rx_consume
Warning
If the above mentioned expected call order is violated the end result can be undefined.
Component specific configuration options

The following compile time configuration options are available to suit various implementations:

  • TX_BUF_SIZE TX buffer size in bytes.
  • RX_BUF_SIZE RX buffer size in bytes.
  • RX_BUF_QUEUE_SIZE RX buffer element size.