![]() |
BLE5.2 1.0
开发文档说明
|
函数 | |
| void | ring_buffer_create (ring_buffer_t *rb, uint8_t *buffer, uint32_t size) |
| void | ring_buffer_queue (ring_buffer_t *rb, uint8_t data) |
| void | ring_buffer_queue_arr (ring_buffer_t *rb, uint8_t *data, ring_buffer_size_t size) |
| ring_buffer_size_t | ring_buffer_dequeue (ring_buffer_t *rb, uint8_t *data) |
| ring_buffer_size_t | ring_buffer_dequeue_arr (ring_buffer_t *rb, uint8_t *data, ring_buffer_size_t len) |
| ring_buffer_size_t | ring_buffer_peek (ring_buffer_t *rb, uint8_t *data, ring_buffer_size_t index) |
| ring_buffer_size_t | ring_buffer_is_empty (ring_buffer_t *rb) |
| ring_buffer_size_t | ring_buffer_is_full (ring_buffer_t *rb) |
| ring_buffer_size_t | ring_buffer_num_items (ring_buffer_t *rb) |
Implementation of ring buffer functions.
在文件 ringbuffer.c 中定义.
| void ring_buffer_create | ( | ring_buffer_t * | rb, |
| uint8_t * | buffer, | ||
| uint32_t | size | ||
| ) |
Initializes the ring buffer pointed to by buffer. This function can also be used to empty/reset the buffer.
| buffer | The ring buffer to initialize. |
在文件 ringbuffer.c 第 11 行定义.
| ring_buffer_size_t ring_buffer_dequeue | ( | ring_buffer_t * | rb, |
| uint8_t * | data | ||
| ) |
Returns the oldest byte in a ring buffer.
| buffer | The buffer from which the data should be returned. |
| data | A pointer to the location at which the data should be placed. |
在文件 ringbuffer.c 第 50 行定义.
| ring_buffer_size_t ring_buffer_dequeue_arr | ( | ring_buffer_t * | rb, |
| uint8_t * | data, | ||
| ring_buffer_size_t | len | ||
| ) |
Returns the len oldest bytes in a ring buffer.
| buffer | The buffer from which the data should be returned. |
| data | A pointer to the array at which the data should be placed. |
| len | The maximum number of bytes to return. |
在文件 ringbuffer.c 第 63 行定义.
|
inline |
Returns whether a ring buffer is empty.
| buffer | The buffer for which it should be returned whether it is empty. |
在文件 ringbuffer.h 第 139 行定义.
|
inline |
Returns whether a ring buffer is full.
| buffer | The buffer for which it should be returned whether it is full. |
在文件 ringbuffer.h 第 149 行定义.
|
inline |
Returns the number of items in a ring buffer.
| buffer | The buffer for which the number of items should be returned. |
在文件 ringbuffer.h 第 160 行定义.
| ring_buffer_size_t ring_buffer_peek | ( | ring_buffer_t * | rb, |
| uint8_t * | data, | ||
| ring_buffer_size_t | index | ||
| ) |
Peeks a ring buffer, i.e. returns an element without removing it.
| buffer | The buffer from which the data should be returned. |
| data | A pointer to the location at which the data should be placed. |
| index | The index to peek. |
在文件 ringbuffer.c 第 81 行定义.
| void ring_buffer_queue | ( | ring_buffer_t * | rb, |
| uint8_t | data | ||
| ) |
Adds a byte to a ring buffer.
| buffer | The buffer in which the data should be placed. |
| data | The byte to place. |
在文件 ringbuffer.c 第 25 行定义.
| void ring_buffer_queue_arr | ( | ring_buffer_t * | rb, |
| uint8_t * | data, | ||
| ring_buffer_size_t | size | ||
| ) |
Adds an array of bytes to a ring buffer.
| buffer | The buffer in which the data should be placed. |
| data | A pointer to the array of bytes to place in the queue. |
| size | The size of the array. |
在文件 ringbuffer.c 第 40 行定义.