aboutsummaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/channels.h12
-rw-r--r--src/include/serial.h33
2 files changed, 9 insertions, 36 deletions
diff --git a/src/include/channels.h b/src/include/channels.h
index dd2cd3301..57eb55c4a 100644
--- a/src/include/channels.h
+++ b/src/include/channels.h
@@ -78,7 +78,7 @@ typedef struct {
* @retval Q_OK if the operation succeeded.
* @retval Q_RESET if the channel associated queue (if any) was reset.
*/
-#define chIOPut(ip, b) ((ip)->vmt.m0->put(ip, b, TIME_INFINITE))
+#define chIOPut(ip, b) ((ip)->vmt->m0.put(ip, b, TIME_INFINITE))
/**
* @brief Channel blocking byte write with timeout.
@@ -97,7 +97,7 @@ typedef struct {
* @retval Q_TIMEOUT if the specified time expired.
* @retval Q_RESET if the channel associated queue (if any) was reset.
*/
-#define chIOPutTimeout(ip, b, timeout) ((ip)->vmt.m0->put(ip, b, timeout))
+#define chIOPutTimeout(ip, b, timeout) ((ip)->vmt->m0.put(ip, b, timeout))
/**
* @brief Channel blocking byte read.
@@ -108,7 +108,7 @@ typedef struct {
* @return A byte value from the queue or:
* @retval Q_RESET if the channel associated queue (if any) was reset.
*/
-#define chIOGet(ip) ((ip)->vmt.m0->put(ip, TIME_INFINITE))
+#define chIOGet(ip) ((ip)->vmt->m0.put(ip, TIME_INFINITE))
/**
* @brief Channel blocking byte read with timeout.
@@ -125,7 +125,7 @@ typedef struct {
* @retval Q_TIMEOUT if the specified time expired.
* @retval Q_RESET if the channel associated queue (if any) was reset.
*/
-#define chIOGetTimeout(ip, timeout) ((ip)->vmt.m0->put(ip, timeout))
+#define chIOGetTimeout(ip, timeout) ((ip)->vmt->m0.put(ip, timeout))
#if CH_USE_EVENTS
/**
@@ -192,7 +192,7 @@ typedef struct {
* @param[in] n the maximum amount of data to be transferred
* @return The number of bytes transferred.
*/
-#define chIOWrite(ip, bp, n) ((ip)->vmt.m1->write(ip, bp, n))
+#define chIOWrite(ip, bp, n) ((ip)->vmt->m1.write(ip, bp, n))
/**
* @brief Channel non-blocking read.
@@ -205,7 +205,7 @@ typedef struct {
* @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))
+#define chIORead(ip, bp, n) ((ip)->vmt->m1.read(ip, bp, n))
#endif /* CH_USE_EVENTS */
diff --git a/src/include/serial.h b/src/include/serial.h
index 27ded730e..845c4bf9c 100644
--- a/src/include/serial.h
+++ b/src/include/serial.h
@@ -128,12 +128,12 @@ struct _full_duplex_driver_data {
* Input queue, incoming data can be read from this input queue by
* using the queues APIs.
*/
- InputQueue sd_iqueue;
+ InputQueue iqueue;
/**
* Output queue, outgoing data can be written to this output queue by
* using the queues APIs.
*/
- OutputQueue sd_oqueue;
+ OutputQueue oqueue;
};
/**
@@ -169,7 +169,7 @@ typedef struct {
/**
* Virtual Methods Table.
*/
- struct _generic_serial_driver_vmt *vmt;
+ struct _full_duplex_driver_vmt *vmt;
/**
* @p BaseChannel class inherited data.
*/
@@ -186,33 +186,6 @@ typedef struct {
* @p FullDuplexDriver specific data.
*/
struct _full_duplex_driver_data d3;
-} FullDuplexDriver_;
-
-/**
- * @brief Full Duplex Serial Driver main structure.
- */
-typedef struct {
-
- /** Input queue. Incoming data can be read from this queue by using the
- * queues APIs.*/
- InputQueue sd_iqueue;
- /** Data Available @p EventSource. This event is generated when some incoming
- * data is inserted in the Input @p Queue.*/
- EventSource sd_ievent;
-
- /** Output queue. Outgoing data can be written to this Output @p Queue by
- * using the queues APIs.*/
- OutputQueue sd_oqueue;
- /** Data Transmitted @p EventSource. This event is generated when the
- * Output @p Queue is empty.*/
- EventSource sd_oevent;
-
- /** I/O driver status flags. This field should not be read directly but
- * the @p chFDDGetAndClearFlags() funtion should be used instead.*/
- dflags_t sd_flags;
- /** Status Change @p EventSource. This event is generated when a
- * condition flag was changed.*/
- EventSource sd_sevent;
} FullDuplexDriver;
#ifdef __cplusplus