This file contains the Buffer Management Module definitions.
- Id:
- bmm.h 19562 2009-12-15 17:18:44Z sschneid
- Author
- Microchip Technology Inc: http://www.microchip.com
-
Support: https://www.microchip.com/support/
#include <stdint.h>
#include <stdbool.h>
|
#define | BMM_BUFFER_POINTER(buf) ((buf)->body) |
| This macro provides the pointer to the corresponding body of the supplied buffer header. More...
|
|
#define BMM_BUFFER_POINTER |
( |
|
buf | ) |
((buf)->body) |
This macro provides the pointer to the corresponding body of the supplied buffer header.
Buffer structure holding information of each buffer.
buffer_t* bmm_buffer_alloc |
( |
uint8_t |
size | ) |
|
Allocates a buffer.
This function allocates a buffer and returns a pointer to the buffer. The same pointer should be used while freeing the buffer.User should call BMM_BUFFER_POINTER(buf) to get the pointer to buffer user area.
- Parameters
-
size | size of buffer to be allocated. |
- Returns
- pointer to the buffer allocated, NULL if buffer not available.
void bmm_buffer_free |
( |
buffer_t * |
pbuffer | ) |
|
Frees up a buffer.
This function frees up a buffer. The pointer passed to this function should be the pointer returned during buffer allocation. The result is unpredictable if an incorrect pointer is passed.
- Parameters
-
pbuffer | Pointer to buffer that has to be freed. |
void bmm_buffer_init |
( |
void |
| ) |
|
Initializes the buffer module.
This function initializes the buffer module. This function should be called before using any other functionality of buffer module.