diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-08-19 11:59:36 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-08-19 11:59:36 +0000 |
commit | 94007010446b75548a41b3979fa0bdc4bf66a08c (patch) | |
tree | 0a9bac3e4eaae5c8ece6a5015e1f8ef1fb06b4af /os/io/serial.h | |
parent | f6b7b4d8448449097e44b13cff386fde5b292692 (diff) | |
download | ChibiOS-94007010446b75548a41b3979fa0bdc4bf66a08c.tar.gz ChibiOS-94007010446b75548a41b3979fa0bdc4bf66a08c.tar.bz2 ChibiOS-94007010446b75548a41b3979fa0bdc4bf66a08c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1080 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/serial.h')
-rw-r--r-- | os/io/serial.h | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/os/io/serial.h b/os/io/serial.h index ef6b7f742..aa18ebe7b 100644 --- a/os/io/serial.h +++ b/os/io/serial.h @@ -42,42 +42,30 @@ /** Break detected.*/
#define SD_BREAK_DETECTED 32
-#include "serial_lld.h"
+typedef struct _SerialDriver SerialDriver;
-/** Serial Driver condition flags type.*/
-typedef uint8_t sdflags_t;
+#include "serial_lld.h"
/**
- * @brief @p FullDuplexDriver specific methods.
+ * @brief @p SerialDriver specific methods.
*/
struct _serial_driver_methods {
- void (*start)(SerialDriver *sd, const SerialDriverConfig *config);
- void (*stop)(SerialDriver *sd);
-};
-
-/**
- * @brief @p SerialDriver specific data.
- */
-struct _serial_driver_data {
/**
- * Input queue, incoming data can be read from this input queue by
- * using the queues APIs.
+ * @brief Configures and starts the driver.
+ * + * @param[in] ip pointer to a @p SerialDriver or derived class
+ * @param[in] config The configuration record. */
- InputQueue iqueue;
- /**
- * Output queue, outgoing data can be written to this output queue by
- * using the queues APIs.
- */
- OutputQueue oqueue;
- /**
- * Status Change @p EventSource. This event is generated when one or more
- * condition flags change.
- */
- EventSource sevent;
+ void (*start)(void *ip, const SerialDriverConfig *config);
+
/**
- * I/O driver status flags.
+ * @brief Stops the driver.
+ * @Details Any thread waiting on the driver's queues will be awakened with
+ * the message @p Q_RESET.
+ *
+ * @param[in] ip pointer to a @p SerialDriver or derived class
*/
- sdflags_t flags;
+ void (*stop)(void *ip);
};
/**
@@ -105,7 +93,7 @@ struct SerialDriverVMT { * @details This class extends @p BaseAsynchronousChannel by adding physical
* I/O queues.
*/
-typedef struct {
+struct _SerialDriver {
/**
* Virtual Methods Table.
*/
@@ -122,14 +110,12 @@ typedef struct { * @p SerialDriver specific data.
*/
struct _serial_driver_data d2;
-} SerialDriver;
+};
#ifdef __cplusplus
extern "C" {
#endif
- void sdInit(SerialDriver *sd,
- uint8_t *ib, size_t isize, qnotify_t inotify,
- uint8_t *ob, size_t osize, qnotify_t onotify);
+ void sdInit(SerialDriver *sd, qnotify_t inotify, qnotify_t onotify);
void sdIncomingDataI(SerialDriver *sd, uint8_t b);
msg_t sdRequestDataI(SerialDriver *sd);
void sdAddFlagsI(SerialDriver *sd, sdflags_t mask);
|