From 749edc4e23635a6f317ed92041e24a3add0292b4 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 31 Oct 2017 13:21:07 +0000 Subject: Added I-class functions to the serial driver. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10919 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/hal_serial.h | 61 +++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 22 deletions(-) (limited to 'os/hal') diff --git a/os/hal/include/hal_serial.h b/os/hal/include/hal_serial.h index 2a0925658..2276a49c8 100644 --- a/os/hal/include/hal_serial.h +++ b/os/hal/include/hal_serial.h @@ -140,7 +140,15 @@ struct SerialDriver { * writes directly on the output queue. This is faster but cannot * be used to write to different channels implementations. * - * @see chnPutTimeout() + * @iclass + */ +#define sdPutI(sdp, b) oqPutI(&(sdp)->oqueue, b) + +/** + * @brief Direct write to a @p SerialDriver. + * @note This function bypasses the indirect access to the channel and + * writes directly on the output queue. This is faster but cannot + * be used to write to different channels implementations. * * @api */ @@ -152,8 +160,6 @@ struct SerialDriver { * writes directly on the output queue. This is faster but cannot * be used to write to different channels implementations. * - * @see chnPutTimeout() - * * @api */ #define sdPutTimeout(sdp, b, t) oqPutTimeout(&(sdp)->oqueue, b, t) @@ -164,7 +170,15 @@ struct SerialDriver { * reads directly from the input queue. This is faster but cannot * be used to read from different channels implementations. * - * @see chnGetTimeout() + * @iclass + */ +#define sdGetI(sdp) iqGetI(&(sdp)->iqueue) + +/** + * @brief Direct read from a @p SerialDriver. + * @note This function bypasses the indirect access to the channel and + * reads directly from the input queue. This is faster but cannot + * be used to read from different channels implementations. * * @api */ @@ -176,8 +190,6 @@ struct SerialDriver { * reads directly from the input queue. This is faster but cannot * be used to read from different channels implementations. * - * @see chnGetTimeout() - * * @api */ #define sdGetTimeout(sdp, t) iqGetTimeout(&(sdp)->iqueue, t) @@ -188,12 +200,19 @@ struct SerialDriver { * writes directly to the output queue. This is faster but cannot * be used to write from different channels implementations. * - * @see chnWrite() + * @iclass + */ +#define sdWriteI(sdp, b, n) oqWriteI(&(sdp)->oqueue, b, n) + +/** + * @brief Direct blocking write to a @p SerialDriver. + * @note This function bypasses the indirect access to the channel and + * writes directly to the output queue. This is faster but cannot + * be used to write from different channels implementations. * * @api */ -#define sdWrite(sdp, b, n) \ - oqWriteTimeout(&(sdp)->oqueue, b, n, TIME_INFINITE) +#define sdWrite(sdp, b, n) oqWriteTimeout(&(sdp)->oqueue, b, n, TIME_INFINITE) /** * @brief Direct blocking write to a @p SerialDriver with timeout @@ -202,8 +221,6 @@ struct SerialDriver { * writes directly to the output queue. This is faster but cannot * be used to write to different channels implementations. * - * @see chnWriteTimeout() - * * @api */ #define sdWriteTimeout(sdp, b, n, t) \ @@ -215,8 +232,6 @@ struct SerialDriver { * writes directly to the output queue. This is faster but cannot * be used to write to different channels implementations. * - * @see chnWriteTimeout() - * * @api */ #define sdAsynchronousWrite(sdp, b, n) \ @@ -228,12 +243,19 @@ struct SerialDriver { * reads directly from the input queue. This is faster but cannot * be used to read from different channels implementations. * - * @see chnRead() + * @iclass + */ +#define sdReadI(sdp, b, n) iqReadI(&(sdp)->iqueue, b, n, TIME_INFINITE) + +/** + * @brief Direct blocking read from a @p SerialDriver. + * @note This function bypasses the indirect access to the channel and + * reads directly from the input queue. This is faster but cannot + * be used to read from different channels implementations. * * @api */ -#define sdRead(sdp, b, n) \ - iqReadTimeout(&(sdp)->iqueue, b, n, TIME_INFINITE) +#define sdRead(sdp, b, n) iqReadTimeout(&(sdp)->iqueue, b, n, TIME_INFINITE) /** * @brief Direct blocking read from a @p SerialDriver with timeout @@ -242,12 +264,9 @@ struct SerialDriver { * reads directly from the input queue. This is faster but cannot * be used to read from different channels implementations. * - * @see chnReadTimeout() - * * @api */ -#define sdReadTimeout(sdp, b, n, t) \ - iqReadTimeout(&(sdp)->iqueue, b, n, t) +#define sdReadTimeout(sdp, b, n, t) iqReadTimeout(&(sdp)->iqueue, b, n, t) /** * @brief Direct non-blocking read from a @p SerialDriver. @@ -255,8 +274,6 @@ struct SerialDriver { * reads directly from the input queue. This is faster but cannot * be used to read from different channels implementations. * - * @see chnReadTimeout() - * * @api */ #define sdAsynchronousRead(sdp, b, n) \ -- cgit v1.2.3