source: rtos_arduino/trunk/arduino_lib/libraries/Ciao/src/lib/ringbuf.h@ 175

Last change on this file since 175 was 175, checked in by ertl-honda, 8 years ago

ライブラリを Arduino IDE 1.7.9 にupdate

File size: 570 bytes
Line 
1#ifndef _RING_BUF_H_
2#define _RING_BUF_H_
3
4#include <stdint.h>
5#include <stdlib.h>
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct{
11 uint8_t* p_o; /**< Original pointer */
12 uint8_t* volatile p_r; /**< Read pointer */
13 uint8_t* volatile p_w; /**< Write pointer */
14 volatile int32_t fill_cnt; /**< Number of filled slots */
15 int32_t size; /**< Buffer size */
16}RINGBUF;
17
18int16_t RINGBUF_Init(RINGBUF *r, uint8_t* buf, int32_t size);
19int16_t RINGBUF_Put(RINGBUF *r, uint8_t c);
20int16_t RINGBUF_Get(RINGBUF *r, uint8_t* c);
21
22#ifdef __cplusplus
23}
24#endif
25#endif
Note: See TracBrowser for help on using the repository browser.