sam7fc/include/fifo.h

35 lines
871 B
C
Raw Normal View History

2008-02-03 21:41:39 +01:00
#ifndef FIFO_H_
#define FIFO_H_
#include <stdint.h>
struct fifo {
uint32_t in;
uint32_t out;
uint16_t pdc_tx;
uint16_t pdc_rx;
2008-02-06 15:30:54 +01:00
2008-02-03 21:41:39 +01:00
uint32_t size;
char buf[0];
};
2008-02-06 17:39:53 +01:00
uint32_t fifo_put(struct fifo *fifo, char *buf, uint32_t len);
2008-02-03 21:41:39 +01:00
uint32_t fifo_get(struct fifo *fifo, char *buf, uint32_t len);
2008-02-06 17:39:53 +01:00
uint32_t fifo_peek(struct fifo *fifo, char *buf, uint32_t len);
uint32_t fifo_remove(struct fifo *fifo, uint32_t len);
2008-02-03 21:41:39 +01:00
uint32_t fifo_rxpdc(struct fifo *fifo, AT91S_PDC *pdc, uint16_t maxsize);
uint32_t fifo_txpdc(struct fifo *fifo, AT91S_PDC *pdc, uint16_t maxsize);
2008-02-06 22:18:33 +01:00
uint32_t fifo_txudp(struct fifo *fifo, uint32_t ep, uint32_t maxsize);
uint32_t fifo_rxudp(struct fifo *fifo, uint32_t ep, uint32_t maxsize);
2008-02-03 21:41:39 +01:00
uint32_t fifo_putbyte(struct fifo *fifo, char c);
uint32_t fifo_getbyte(struct fifo *fifo, char *p);
struct fifo * fifo_alloc(uint32_t size);
#endif /*FIFO_H_*/