ARM7 based quadrocopter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
666 B

#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;
uint32_t size;
char buf[0];
};
uint32_t fifo_put(struct fifo *fifo, const char *buf, uint32_t len);
uint32_t fifo_get(struct fifo *fifo, char *buf, uint32_t len);
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);
uint32_t fifo_putbyte(struct fifo *fifo, char c);
uint32_t fifo_getbyte(struct fifo *fifo, char *p);
char * fifo_peek(struct fifo *fifo, uint32_t len);
struct fifo * fifo_alloc(uint32_t size);
#endif /*FIFO_H_*/