buffer.h
来自「实现功能ATmega单片机上处理GSM模块的数据」· C头文件 代码 · 共 29 行
H
29 行
#ifndef BUFFER_H
#define BUFFER_H
typedef struct struct_cBuffer
{
unsigned char *dataptr; ///< the physical memory address where the buffer is stored
unsigned short size; ///< the allocated size of the buffer
unsigned short datalength; ///< the length of the data currently in the buffer
unsigned short dataindex; ///< the index into the buffer where the data starts
} cBuffer;
void bufferInit(cBuffer* buffer, unsigned char *start, unsigned short size);
unsigned char bufferGetFromFront(cBuffer* buffer);
void bufferDumpFromFront(cBuffer* buffer, unsigned short numbytes);
unsigned char bufferGetAtIndex(cBuffer* buffer, unsigned short index);
unsigned char bufferAddToEnd(cBuffer* buffer, unsigned char data);
unsigned char bufferIsNotFull(cBuffer* buffer);
void bufferFlush(cBuffer* buffer);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?