summaryrefslogtreecommitdiff
path: root/tinyusb/common/fifo.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2012-11-29 10:41:33 +0700
committerhathach <[email protected]>2012-11-29 10:41:33 +0700
commit8cd811e2a9760afc1702ae0a872e999517bfcb40 (patch)
tree09ec2245a515fad540e60ebcf1da915de99e99fd /tinyusb/common/fifo.h
parent851f5bfd06c837626ddf06f1c326970763d07010 (diff)
start to work with doxygen
fix mem_size/mem_base usage with device rom driver
Diffstat (limited to 'tinyusb/common/fifo.h')
-rw-r--r--tinyusb/common/fifo.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/tinyusb/common/fifo.h b/tinyusb/common/fifo.h
index 1019c8bde..4a0bfc340 100644
--- a/tinyusb/common/fifo.h
+++ b/tinyusb/common/fifo.h
@@ -35,23 +35,40 @@
* This file is part of the tiny usb stack.
*/
+/** \file
+ * \brief Error Header
+ *
+ * \note TBD
+ */
+
+/** \ingroup Group_Common
+ *
+ * @{
+ */
+
#ifndef _TUSB_FIFO_H_
#define _TUSB_FIFO_H_
#include "common/common.h"
-/* ToDo: Describe each field in fifo_t */
-typedef struct _fifo_t
+/**
+ * \brief Simple FIFO
+ */
+typedef struct
{
- uint8_t* buf;
- uint16_t size;
- volatile uint16_t len;
- volatile uint16_t wr_ptr;
- volatile uint16_t rd_ptr;
- bool overwritable;
- IRQn_Type irq;
+ uint8_t* buf; ///< buffer pointer
+ uint16_t size; ///< buffer size
+ volatile uint16_t len; ///< bytes in fifo
+ volatile uint16_t wr_ptr; ///< write pointer
+ volatile uint16_t rd_ptr; ///< read pointer
+ bool overwritable; ///< allow overwrite data when full
+ IRQn_Type irq; ///< interrupt used to lock fifo
} fifo_t;
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
void fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq);
bool fifo_write(fifo_t* f, uint8_t data);
bool fifo_read(fifo_t* f, uint8_t *data);
@@ -73,4 +90,8 @@ static inline uint16_t fifo_getLength(fifo_t* f)
return f->len;
}
+#ifdef __cplusplus
+ }
+#endif
+
#endif /* _TUSB_FIFO_H_ */