can_buffer.h
来自「can initialization for coldfire microcon」· C头文件 代码 · 共 53 行
H
53 行
/************************************************************************
*
* Freescale Semicondactor
* ALL RIGHTS RESERVED
* (c) Copyright 2004Freescale Semiconductor
*
*************************************************************************
*
* FILE NAME: can_buffer.h
*
* PURPOSE:
*
* AUTHOR(s): Igor Byeda
*
*************************************************************************/
#ifndef _CAN_BUFFER_H
#define _CAN_BUFFER_H
#include "sys_global.h"
/************************************************************************
* Ring Buffer internal data structure
*************************************************************************/
typedef struct
{
can_Message_t * pBuf;
uint32 nBufSize; // the size of the ring buffer
uint32 pRD; // the read pointer (local array index)
uint32 pWR; // the write pointer (local array index)
uint32 tmp; // temporary field to make functions 'thread safe'
uint32 tmp2; // temporary field to make functions 'thread safe'
} rb_obj_t;
/************************************************************************
* Function Prototypes
*************************************************************************/
rb_obj_t * rb_Create(uint32 bufSizeWanted);
void rb_Destroy(rb_obj_t * rb);
uint32 rb_get_FreeSpace(rb_obj_t * rb);
uint32 rb_get_DataToReadSize(rb_obj_t * rb);
uint32 rb_data_Write(rb_obj_t * rb, can_Message_t * pExtBuf, uint32 nExtLen);
uint32 rb_data_Read (rb_obj_t * rb, can_Message_t * pExtBuf, uint32 nExtLen);
can_Message_t * rb_data_WriteOneVirtual(rb_obj_t *);
can_Message_t * rb_data_ReadOneVirtual(rb_obj_t *);
uint32 rb_data_WriteOneBack(rb_obj_t *);
#endif /* _CAN_BUFFER_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?