Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
RingBuffer.h
00001 #ifndef RING_BUFFER_H_ 00002 #define RING_BUFFER_H_ 00003 00004 #include "mbed.h" 00005 00006 #define RING_BUFFER_SIZE 512 00007 00008 class RingBuffer{ 00009 public: 00010 void initialize_buffer(); 00011 int16_t buffer_size(); 00012 uint8_t read_buffer_byte(); 00013 int16_t read_buffer_short(); 00014 void read_buffer(uint8_t buf[], int16_t offset, int16_t size); 00015 int16_t buffer_capacity(); 00016 void write_buffer_byte(uint8_t ch); 00017 void write_buffer(const uint8_t buf[], int16_t offset, int16_t size); 00018 bool is_buffer_empty(); 00019 00020 protected: 00021 uint8_t buffer[RING_BUFFER_SIZE]; 00022 int16_t start; 00023 int16_t end; 00024 }; 00025 00026 #endif /* RING_BUFFER_H_ */
Generated on Tue Jul 12 2022 18:37:36 by
1.7.2