Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: fifo.h
- Revision:
- 0:3c704483eb79
- Child:
- 1:f2f253bec95e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fifo.h Wed May 21 18:30:45 2014 +0000
@@ -0,0 +1,23 @@
+#ifndef FIFO_H_
+#define FIFO_H_
+
+#include "LPC17xx.h"
+
+#define FIFO_SIZE 256
+#define FIFO_TYPE uint8_t
+
+class fifo
+{
+ FIFO_TYPE buffer[FIFO_SIZE];
+ uint32_t head, tail;
+
+public:
+ fifo();
+ uint8_t put(FIFO_TYPE data);// returns 0 on success
+ uint8_t get(FIFO_TYPE* data);
+ uint32_t available();
+ uint32_t free();
+};
+
+
+#endif /* FIFO_H_ */