WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_ringbuf.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
3 * Description: Ring Buffer Public HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2019-10-10
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
34#ifndef _LOS_RINGBUF_H
35#define _LOS_RINGBUF_H
36
37#include "los_typedef.h"
38#include "los_spinlock.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
52
61
77
100extern UINT32 LOS_RingbufInit(Ringbuf *ringbuf, CHAR *fifo, UINT32 size, RingbufFlag flag);
101
121
142extern UINT32 LOS_RingbufWrite(Ringbuf *ringbuf, const CHAR *buf, UINT32 size);
143
164extern UINT32 LOS_RingbufRead(Ringbuf *ringbuf, CHAR *buf, UINT32 size);
165
186extern UINT32 LOS_RingbufPeek(Ringbuf *ringbuf, CHAR *buf, UINT32 size);
187
207
208#ifdef __cplusplus
209}
210#endif /* __cplusplus */
211
212#endif /* _LOS_RINGBUF_H */
UINT32 LOS_RingbufWrite(Ringbuf *ringbuf, const CHAR *buf, UINT32 size)
Write data to ringbuf.
UINT32 LOS_RingbufUsedSize(Ringbuf *ringbuf)
Get a ringbuf's used size.
void LOS_RingbufReset(Ringbuf *ringbuf)
Reset a ringbuf.
RingbufStatus
Definition los_ringbuf.h:48
RingbufFlag
Definition los_ringbuf.h:57
UINT32 LOS_RingbufRead(Ringbuf *ringbuf, CHAR *buf, UINT32 size)
Read data from ringbuf.
UINT32 LOS_RingbufInit(Ringbuf *ringbuf, CHAR *fifo, UINT32 size, RingbufFlag flag)
Init a ringbuf.
UINT32 LOS_RingbufPeek(Ringbuf *ringbuf, CHAR *buf, UINT32 size)
Read data from ringbuf but does not consume the data.
@ RBUF_UNINIT
Definition los_ringbuf.h:49
@ RBUF_INITED
Definition los_ringbuf.h:50
@ RBUF_NORMAL
Definition los_ringbuf.h:58
@ RBUF_OVERWRITE
Definition los_ringbuf.h:59
#define VOID
Definition los_typedef.h:88
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
Definition los_ringbuf.h:67
UINT32 size
Definition los_ringbuf.h:70
UINT32 startIdx
Definition los_ringbuf.h:68
RingbufFlag flag
Definition los_ringbuf.h:74
RingbufStatus status
Definition los_ringbuf.h:73
CHAR * fifo
Definition los_ringbuf.h:75
UINT32 remain
Definition los_ringbuf.h:71
SPIN_LOCK_S lock
Definition los_ringbuf.h:72
UINT32 endIdx
Definition los_ringbuf.h:69
Definition los_spinlock.h:78