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: Queue mbed-rtos mbed
ringbuf.h
00001 #include "types.h" 00002 00003 #ifndef _RING_BUF_H_ 00004 #define _RING_BUF_H_ 00005 00006 typedef struct{ 00007 uint8* p_o; /**< Original pointer */ 00008 uint8* p_e; /**< End boundary */ 00009 uint8* volatile p_r; /**< Read pointer */ 00010 uint8* volatile p_w; /**< Write pointer */ 00011 volatile uint16 fill_cnt; /**< Number of filled slots */ 00012 volatile uint16 size; /**< Buffer size */ 00013 }ringbuf_t; 00014 00015 uint8 ICACHE_FLASH_ATTR ringbuf_init(ringbuf_t *r, uint8* buf, uint16 size); 00016 uint8 ICACHE_FLASH_ATTR ringbuf_clear(ringbuf_t *r); 00017 uint8 ICACHE_FLASH_ATTR ringbuf_put(ringbuf_t *r, uint8 c); 00018 uint8 ICACHE_FLASH_ATTR ringbuf_get(ringbuf_t *r, uint8 * c); 00019 uint16 ICACHE_FLASH_ATTR ringbuf_gets(ringbuf_t *r, uint8 * buff, uint16 size); 00020 uint16 ICACHE_FLASH_ATTR ringbuf_puts(ringbuf_t *r, uint8 * buff, uint16 size); 00021 00022 #endif
Generated on Thu Jul 14 2022 01:35:32 by
1.7.2