diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-03 11:57:44 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-03 11:57:44 +0000 |
commit | 5a8670e50f3114981835e5f2a1e2d2dbe196db59 (patch) | |
tree | 9b5dd08f1953a2e6312f46e8eaf90833966d923d /src | |
parent | 2713bd19c5ba6d454f0dafe2df8ab310a62536ef (diff) | |
download | ChibiOS-5a8670e50f3114981835e5f2a1e2d2dbe196db59.tar.gz ChibiOS-5a8670e50f3114981835e5f2a1e2d2dbe196db59.tar.bz2 ChibiOS-5a8670e50f3114981835e5f2a1e2d2dbe196db59.zip |
More macros added.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@944 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r-- | src/include/channels.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/include/channels.h b/src/include/channels.h index 2ff20b1ad..791572b75 100644 --- a/src/include/channels.h +++ b/src/include/channels.h @@ -258,13 +258,33 @@ typedef struct { * transfer is non-blocking and can return zero if the channel has
* no data immediately available.
*
- * @param[in] ip pointer to a @p BaseChannel or derived class
+ * @param[in] ip pointer to a @p BaseAsynchronousChannel or derived class
* @param[out] bp pointer to the buffer where the input data is copied
* @param[in] n the maximum amount of data to be transferred
* @return The number of bytes transferred.
*/
#define chIORead(ip, bp, n) ((ip)->vmt->m1.read(ip, bp, n))
+/**
+ * @brief Returns the write event source.
+ * @details The write event source is broadcasted when the channel is ready
+ * for write operations. This usually happens when the internal
+ * output queue becomes empty. + * @param[in] ip pointer to a @p BaseAsynchronousChannel or derived class
+ * @return A pointer to an @p EventSource object.
+ */
+#define chIOGetWriteEventSource(ip) (&((ip)->vmt->d1.oevent))
+
+/**
+ * @brief Returns the read event source.
+ * @details The read event source is broadcasted when the channel is ready
+ * for read operations. This usually happens when the internal
+ * input queue becomes non-empty.
+ * @param[in] ip pointer to a @p BaseAsynchronousChannel or derived class
+ * @return A pointer to an @p EventSource object.
+ */
+#define chIOGetReadEventSource(ip) (&((ip)->vmt->d1.ievent))
+
#endif /* CH_USE_EVENTS */
#endif /* _CHANNELS_H_ */
|