binary Clock
|
Defines a set of functions for implementing a general purpose ring buffer. More...
Functions | |
void | ring_buff_init (ring_buffer_t *rb_ptr, uint8_t *buffer_array_ptr, uint8_t buffer_len) |
retval_t | ring_buff_pop (ring_buffer_t *rb_ptr, uint8_t *return_item_ptr) |
retval_t | ring_buff_peak (ring_buffer_t *rb_ptr, uint8_t *return_item_ptr) |
retval_t | ring_buff_push (ring_buffer_t *rb_ptr, uint8_t new_val) |
bool_t | ring_buff_has_data (ring_buffer_t *rb_ptr) |
uint8_t | ring_buff_unread_items (ring_buffer_t *rb_ptr) |
void | ring_buff_reset (ring_buffer_t *rb_ptr) |
Defines a set of functions for implementing a general purpose ring buffer.
bool_t ring_buff_has_data | ( | ring_buffer_t * | rb_ptr | ) |
Gets whether or not there is valid data in the ring buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
[out] | retval | (bool_t): Returns whether or not there's data on the buffer. |
void ring_buff_init | ( | ring_buffer_t * | rb_ptr, |
uint8_t * | buffer_array_ptr, | ||
uint8_t | buffer_len | ||
) |
Initializes the ring buffer structure.
[in] | rb_ptr | (ring_buffer_t *): ring buffer admin structure to initialize. |
[in] | buffer_array_ptr | (uint8_t *): pointer to the buffer array. |
[in] | buffer_len | (uint8_t): length of the buffer to be initialized. |
retval_t ring_buff_peak | ( | ring_buffer_t * | rb_ptr, |
uint8_t * | return_item_ptr | ||
) |
Peaks at the current value on the ring buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
[in] | return_item_ptr | (uint8_t *): Location to return the value to |
[out] | retval | (retval_t): Returns the error or pass status. |
retval_t ring_buff_pop | ( | ring_buffer_t * | rb_ptr, |
uint8_t * | return_item_ptr | ||
) |
Pops a value off of the ring buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
[in] | return_item_ptr | (uint8_t *): Location to return the value to |
[out] | retval | (retval_t): Returns the error or pass status. |
retval_t ring_buff_push | ( | ring_buffer_t * | rb_ptr, |
uint8_t | new_val | ||
) |
Pushes a value onto the ring buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
[in] | new_val | (uint8_t): value to push onto the buffer. |
[out] | retval | (retval_t): Returns the error or pass status. |
void ring_buff_reset | ( | ring_buffer_t * | rb_ptr | ) |
Resets the ring buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
uint8_t ring_buff_unread_items | ( | ring_buffer_t * | rb_ptr | ) |
Gets how much unread data is on the buffer.
[in] | rb_ptr | (ring_buffer_t *): admin structure for the ring buffer we're using. |
[out] | unread_items | (uint8_t): Returns the amount of unread data is on the buffer. |