diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-02 10:58:11 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-02 10:58:11 +0000 |
commit | 3dc3f323693654c86c16a665a927cfa7f2cf15ce (patch) | |
tree | b0cec3aedc37daf0f17e5bb01c51e760725bcb30 | |
parent | 8cfd8aefb69f582c8d658995b6ce7b3f8b024c7e (diff) | |
download | ChibiOS-3dc3f323693654c86c16a665a927cfa7f2cf15ce.tar.gz ChibiOS-3dc3f323693654c86c16a665a927cfa7f2cf15ce.tar.bz2 ChibiOS-3dc3f323693654c86c16a665a927cfa7f2cf15ce.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@933 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | src/include/channels.h | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/src/include/channels.h b/src/include/channels.h index a534de9b7..ef3600893 100644 --- a/src/include/channels.h +++ b/src/include/channels.h @@ -28,11 +28,21 @@ #define _CHANNELS_H_
/**
- * @brief Virtual methods table for base channels. + * @brief Base channels methods.
*/
-struct _base_channel_vmt {
+struct _base_channel_methods {
/**
- * Channel synchronous put method.
+ * @brief Channel synchronous put method.
+ * @param[in] b the byte value to be written in the queue
+ * @param[in] timeout the number of ticks before the operation timeouts,
+ * the following special values are allowed:
+ * - @a TIME_IMMEDIATE immediate timeout.
+ * - @a TIME_INFINITE no timeout.
+ * .
+ * @return The operation status:
+ * @retval Q_OK if the operation succeeded.
+ * @retval Q_TIMEOUT if the specified time expired.
+ * @retval Q_RESET if the queue was reset.
*/
msg_t (*put)(void *instance, uint8_t b, systime_t timeout);
/**
@@ -50,6 +60,13 @@ struct _base_channel_data { };
/**
+ * @brief Virtual methods table for base channels.
+ */
+struct _base_channel_vmt {
+ struct _base_channel_methods m0; /**< Class methods. */
+};
+
+/**
* @brief Base channel class.
* @details This class represents a generic, synchronous, byte-wide,
* I/O channel. @@ -63,15 +80,7 @@ typedef struct { /**
* @brief Virtual methods table for base asynchronous channels.
*/
-struct _base_asynchronous_channel_vmt {
- /**
- * Channel synchronous put method.
- */
- msg_t (*put)(void *instance, uint8_t b, systime_t timeout);
- /**
- * Channel synchronous get method.
- */
- msg_t (*get)(void *instance, systime_t timeout);
+struct _base_asynchronous_channel_methods {
/**
* Channel asynchronous write method.
*/
@@ -99,6 +108,15 @@ struct _base_asynchronous_channel_data { };
/**
+ * @brief Virtual methods table for base asynchronous channels.
+ */
+struct _base_asynchronous_channel_vmt {
+ struct _base_channel_methods m0; /**< Super class methods. */
+ struct _base_asynchronous_channel_methods m1; /**< Class methods. */
+};
+
+
+/**
* @extends BaseChannel
*
* @brief Base asynchronous channel class.
|