mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
30 lines
493 B
C
30 lines
493 B
C
#ifndef _FIF0_H_
|
|
#define _FIFO_H_
|
|
|
|
#include "wm_hal.h"
|
|
|
|
typedef struct fifo_t {
|
|
uint8_t *buf;
|
|
uint32_t size;
|
|
uint32_t in;
|
|
uint32_t out;
|
|
} _fifo_str;
|
|
|
|
#define min(x,y) ((x) < (y)?(x):(y))
|
|
|
|
int FifoInit(uint8_t fifoID,uint8_t *fifo_addr, uint32_t fifo_size);
|
|
|
|
int FifoDataLen(uint8_t fifoID);
|
|
|
|
int FifoSpaceLen(uint8_t fifoID);
|
|
|
|
int FifoRead(uint8_t fifoID,uint8_t *buf, uint32_t len);
|
|
|
|
int FifoWrite(uint8_t fifoID,uint8_t *buf, uint32_t len);
|
|
|
|
void FifoClear(uint8_t fifoID);
|
|
|
|
|
|
#endif
|
|
|