aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include/serial.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/include/serial.h')
-rw-r--r--os/hal/include/serial.h54
1 files changed, 39 insertions, 15 deletions
diff --git a/os/hal/include/serial.h b/os/hal/include/serial.h
index 3623fa7e5..6f80985ab 100644
--- a/os/hal/include/serial.h
+++ b/os/hal/include/serial.h
@@ -29,6 +29,10 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
/** No pending conditions.*/
#define SD_NO_ERROR 0
/** Connection happened.*/
@@ -44,6 +48,18 @@
/** Break detected.*/
#define SD_BREAK_DETECTED 32
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
/**
* @brief Structure representing a serial driver.
*/
@@ -101,23 +117,12 @@ struct _SerialDriver {
struct _serial_driver_data d2;
};
-#ifdef __cplusplus
-extern "C" {
-#endif
- void sdInit(void);
- void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify);
- void sdStart(SerialDriver *sdp, const SerialDriverConfig *config);
- void sdStop(SerialDriver *sdp);
- void sdIncomingDataI(SerialDriver *sdp, uint8_t b);
- msg_t sdRequestDataI(SerialDriver *sdp);
- void sdAddFlagsI(SerialDriver *sdp, sdflags_t mask);
- sdflags_t sdGetAndClearFlags(SerialDriver *sdp);
-#ifdef __cplusplus
-}
-#endif
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
/**
- * @brief Direct output check on a @p SerialDriver.
+ * @brief Direct output check on a @p SerialDriver.
* @details This function bypasses the indirect access to the channel and
* checks directly the output queue. This is faster but cannot
* be used to check different channels implementations.
@@ -190,6 +195,25 @@ extern "C" {
*/
#define sdRead(sdp, b, n) chIQRead(&(sdp)->d2.iqueue, b, n)
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void sdInit(void);
+ void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify);
+ void sdStart(SerialDriver *sdp, const SerialDriverConfig *config);
+ void sdStop(SerialDriver *sdp);
+ void sdIncomingDataI(SerialDriver *sdp, uint8_t b);
+ msg_t sdRequestDataI(SerialDriver *sdp);
+ void sdAddFlagsI(SerialDriver *sdp, sdflags_t mask);
+ sdflags_t sdGetAndClearFlags(SerialDriver *sdp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CH_HAL_USE_SERIAL */
#endif /* _SERIAL_H_ */