From 5a8670e50f3114981835e5f2a1e2d2dbe196db59 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 3 May 2009 11:57:44 +0000 Subject: More macros added. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@944 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/include/channels.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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_ */ -- cgit v1.2.3