Documentation related fixes.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5298 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2013-02-22 11:34:04 +00:00
parent 4149bab2ca
commit d4c246e1bf
11 changed files with 407 additions and 388 deletions

101
os/hal/dox/io_block.dox Normal file
View File

@ -0,0 +1,101 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @defgroup IO_BLOCK Abstract I/O Block Device
* @ingroup IO
*
* @section io_block_1 Driver State Machine
* The drivers implementing this interface shall implement the following
* state machine internally. Not all the driver functionalities can be used
* in any moment, any transition not explicitly shown in the following
* diagram has to be considered an error and shall be captured by an
* assertion (if enabled).
* @if LATEX_PDF
* @dot
digraph example {
size="5, 7";
rankdir="LR";
node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Sans, fontsize=8];
stop [label="BLK_STOP\nLow Power"];
uninit [label="BLK_UNINIT", style="bold"];
ready [label="BLK_READY\nClock Enabled"];
connecting [label="BLK_CONN.ING\nConnecting"];
disconnecting [label="BLK_DISC.ING\nDisconnecting"];
active [label="BLK_ACTIVE\nCard Ready"];
reading [label="BLK_READING\nReading"];
writing [label="BLK_WRITING\nWriting"];
uninit -> stop [label=" blkInit()", constraint=false];
stop -> stop [label="\nblkStop()"];
stop -> ready [label="\nblkStart()"];
ready -> stop [label="\nblkStop()"];
ready -> ready [label="\nblkStart()\nblkDisconnect()"];
ready -> connecting [label="\nblkConnect()"];
connecting -> active [label="\nconnection\nsuccessful"];
connecting -> active [label="\nblkConnect()", dir="back"];
connecting -> ready [label="\nconnection\nfailed"];
disconnecting -> active [label="\nblkDisconnect()", dir="back"];
ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
active -> reading [label="\nblkRead()"];
reading -> active [label="\nread finished\nread error"];
active -> writing [label="\nblkWrite()"];
writing -> active [label="\nwrite finished\nwrite error"];
}
* @enddot
* @else
* @dot
digraph example {
rankdir="LR";
node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Sans, fontsize=8];
stop [label="BLK_STOP\nLow Power"];
uninit [label="BLK_UNINIT", style="bold"];
ready [label="BLK_READY\nClock Enabled"];
connecting [label="BLK_CONN.ING\nConnecting"];
disconnecting [label="BLK_DISC.ING\nDisconnecting"];
active [label="BLK_ACTIVE\nCard Ready"];
reading [label="BLK_READING\nReading"];
writing [label="BLK_WRITING\nWriting"];
uninit -> stop [label=" blkInit()", constraint=false];
stop -> stop [label="\nblkStop()"];
stop -> ready [label="\nblkStart()"];
ready -> stop [label="\nblkStop()"];
ready -> ready [label="\nblkStart()\nblkDisconnect()"];
ready -> connecting [label="\nblkConnect()"];
connecting -> active [label="\nconnection\nsuccessful"];
connecting -> active [label="\nblkConnect()", dir="back"];
connecting -> ready [label="\nconnection\nfailed"];
disconnecting -> active [label="\nblkDisconnect()", dir="back"];
ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
active -> reading [label="\nblkRead()"];
reading -> active [label="\nread finished\nread error"];
active -> writing [label="\nblkWrite()"];
writing -> active [label="\nwrite finished\nwrite error"];
}
* @enddot
* @endif
*/

24
os/hal/dox/io_channel.dox Normal file
View File

@ -0,0 +1,24 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @defgroup IO_CHANNEL Abstract I/O Channel
* @ingroup IO
*/

View File

@ -28,92 +28,12 @@
* @p HAL_USE_SPI options must be enabled in @p halconf.h. * @p HAL_USE_SPI options must be enabled in @p halconf.h.
* *
* @section mmc_spi_1 Driver State Machine * @section mmc_spi_1 Driver State Machine
* The driver implements a state machine internally, not all the driver * This driver implements a state machine internally, see the @ref IO_BLOCK
* functionalities can be used in any moment, any transition not explicitly * module documentation for details.
* shown in the following diagram has to be considered an error and shall *
* be captured by an assertion (if enabled). * @section mmc_spi_2 Driver Operations
* @if LATEX_PDF * This driver allows to read or write single or multiple 512 bytes blocks
* @dot * on a SD Card.
digraph example {
size="5, 7";
rankdir="LR";
node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
any [label="Any State"];
stop2 [label="MMC_STOP\nLow Power"];
uninit [label="MMC_UNINIT", style="bold"];
stop [label="MMC_STOP\nLow Power"];
wait [label="MMC_WAIT\nWaiting Card"];
inserted [label="MMC_INSERTED\nCard Inserted"];
ready [label="MMC_READY\nCard Ready"];
reading [label="MMC_READING\nReading"];
writing [label="MMC_WRITING\nWriting"];
uninit -> stop [label="mmcInit()"];
stop -> wait [label="mmcStart()", constraint=false];
wait -> inserted [label="insertion (inserted event)"];
inserted -> inserted [label="mmcDisconnect()"];
inserted -> ready [label="mmcConnect()"];
ready -> ready [label="mmcConnect()"];
ready -> inserted [label="mmcDisconnect()"];
ready -> reading [label="mmcStartSequentialRead()"];
reading -> reading [label="mmcSequentialRead()"];
reading -> ready [label="mmcStopSequentialRead()"];
reading -> ready [label="read error"];
ready -> writing [label="mmcStartSequentialWrite()"];
writing -> writing [label="mmcSequentialWrite()"];
writing -> ready [label="mmcStopSequentialWrite()"];
writing -> ready [label="write error"];
inserted -> wait [label="removal (removed event)"];
ready -> wait [label="removal (removed event)"];
reading -> wait [label="removal (removed event)"];
writing -> wait [label="removal (removed event)"];
any -> stop2 [label="mmcStop()"];
}
* @enddot
* @else
* @dot
digraph example {
rankdir="LR";
node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
any [label="Any State"];
stop2 [label="MMC_STOP\nLow Power"];
uninit [label="MMC_UNINIT", style="bold"];
stop [label="MMC_STOP\nLow Power"];
wait [label="MMC_WAIT\nWaiting Card"];
inserted [label="MMC_INSERTED\nCard Inserted"];
ready [label="MMC_READY\nCard Ready"];
reading [label="MMC_READING\nReading"];
writing [label="MMC_WRITING\nWriting"];
uninit -> stop [label="mmcInit()"];
stop -> wait [label="mmcStart()", constraint=false];
wait -> inserted [label="insertion (inserted event)"];
inserted -> inserted [label="mmcDisconnect()"];
inserted -> ready [label="mmcConnect()"];
ready -> ready [label="mmcConnect()"];
ready -> inserted [label="mmcDisconnect()"];
ready -> reading [label="mmcStartSequentialRead()"];
reading -> reading [label="mmcSequentialRead()"];
reading -> ready [label="mmcStopSequentialRead()"];
reading -> ready [label="read error"];
ready -> writing [label="mmcStartSequentialWrite()"];
writing -> writing [label="mmcSequentialWrite()"];
writing -> ready [label="mmcStopSequentialWrite()"];
writing -> ready [label="write error"];
inserted -> wait [label="removal (removed event)"];
ready -> wait [label="removal (removed event)"];
reading -> wait [label="removal (removed event)"];
writing -> wait [label="removal (removed event)"];
any -> stop2 [label="mmcStop()"];
}
* @enddot
* @endif
* *
* @ingroup IO * @ingroup IO
*/ */

28
os/hal/dox/mmcsd.dox Normal file
View File

@ -0,0 +1,28 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @defgroup MMCSD MMC/SD Block Device
* @details This module implements a common ancestor for all device drivers
* accessing MMC or SD cards. This interface inherits the state
* machine and the interface from the @ref IO_BLOCK module.
*
* @ingroup IO
*/

View File

@ -26,82 +26,10 @@
* must be enabled in @p halconf.h. * must be enabled in @p halconf.h.
* *
* @section sdc_1 Driver State Machine * @section sdc_1 Driver State Machine
* The driver implements a state machine internally, not all the driver * This driver implements a state machine internally, see the @ref IO_BLOCK
* functionalities can be used in any moment, any transition not explicitly * module documentation for details.
* shown in the following diagram has to be considered an error and shall
* be captured by an assertion (if enabled).
* @if LATEX_PDF
* @dot
digraph example {
size="5, 7";
rankdir="LR";
node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Sans, fontsize=8];
stop [label="SDC_STOP\nLow Power"];
uninit [label="SDC_UNINIT", style="bold"];
ready [label="SDC_READY\nClock Enabled"];
connecting [label="SDC_CONN.ING\nConnecting"];
disconnecting [label="SDC_DISC.ING\nDisconnecting"];
active [label="SDC_ACTIVE\nCard Ready"];
reading [label="SDC_READING\nReading"];
writing [label="SDC_WRITING\nWriting"];
uninit -> stop [label=" sdcInit()", constraint=false];
stop -> stop [label="\nsdcStop()"];
stop -> ready [label="\nsdcStart()"];
ready -> stop [label="\nsdcStop()"];
ready -> ready [label="\nsdcStart()\nsdcDisconnect()"];
ready -> connecting [label="\nsdcConnect()"];
connecting -> active [label="\nconnection\nsuccessful"];
connecting -> active [label="\nsdcConnect()", dir="back"];
connecting -> ready [label="\nconnection\nfailed"];
disconnecting -> active [label="\nsdcDisconnect()", dir="back"];
ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
active -> reading [label="\nsdcRead()"];
reading -> active [label="\nread finished\nread error"];
active -> writing [label="\nsdcWrite()"];
writing -> active [label="\nwrite finished\nwrite error"];
}
* @enddot
* @else
* @dot
digraph example {
rankdir="LR";
node [shape=circle, fontname=Sans, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Sans, fontsize=8];
stop [label="SDC_STOP\nLow Power"];
uninit [label="SDC_UNINIT", style="bold"];
ready [label="SDC_READY\nClock Enabled"];
connecting [label="SDC_CONN.ING\nConnecting"];
disconnecting [label="SDC_DISC.ING\nDisconnecting"];
active [label="SDC_ACTIVE\nCard Ready"];
reading [label="SDC_READING\nReading"];
writing [label="SDC_WRITING\nWriting"];
uninit -> stop [label=" sdcInit()", constraint=false];
stop -> stop [label="\nsdcStop()"];
stop -> ready [label="\nsdcStart()"];
ready -> stop [label="\nsdcStop()"];
ready -> ready [label="\nsdcStart()\nsdcDisconnect()"];
ready -> connecting [label="\nsdcConnect()"];
connecting -> active [label="\nconnection\nsuccessful"];
connecting -> active [label="\nsdcConnect()", dir="back"];
connecting -> ready [label="\nconnection\nfailed"];
disconnecting -> active [label="\nsdcDisconnect()", dir="back"];
ready -> disconnecting [label="\ndisconnection\nfinished", dir="back"];
active -> reading [label="\nsdcRead()"];
reading -> active [label="\nread finished\nread error"];
active -> writing [label="\nsdcWrite()"];
writing -> active [label="\nwrite finished\nwrite error"];
}
* @enddot
* @endif
* *
* @section sdc_2 SDC Operations. * @section sdc_2 Driver Operations
* This driver allows to read or write single or multiple 512 bytes blocks * This driver allows to read or write single or multiple 512 bytes blocks
* on a SD Card. * on a SD Card.
* *

View File

@ -81,20 +81,3 @@
* *
* @ingroup IO * @ingroup IO
*/ */
/**
* @defgroup IO_CHANNEL Abstract I/O Channels
* @ingroup IO
*/
/**
* @defgroup IO_BLOCK Abstract I/O Block Device
* @ingroup IO
*/
/**
* @defgroup MMCSD MMC/SD Block Devices common ancestor
* @details This module implements a common ancestor for all device drivers
* accessing MMC or SD cards.
* @ingroup IO
*/

View File

@ -21,12 +21,12 @@
/** /**
* @file io_block.h * @file io_block.h
* @brief I/O block devices access. * @brief I/O block devices access.
* @details This header defines abstract interfaces useful to access generic * @details This header defines an abstract interface useful to access generic
* I/O block devices in a standardized way. * I/O block devices in a standardized way.
* *
* @addtogroup IO_BLOCK * @addtogroup IO_BLOCK
* @details This module define an abstract interface for accessing generic * @details This module defines an abstract interface for accessing generic
* block devices. * block devices.<br>
* Note that no code is present, just abstract interfaces-like * Note that no code is present, just abstract interfaces-like
* structures, you should look at the system as to a set of * structures, you should look at the system as to a set of
* abstract C++ classes (even if written in C). This system * abstract C++ classes (even if written in C). This system

View File

@ -21,16 +21,17 @@
/** /**
* @file io_channel.h * @file io_channel.h
* @brief I/O channels access. * @brief I/O channels access.
* @details This header defines abstract interfaces useful to access generic * @details This header defines an abstract interface useful to access generic
* I/O serial devices in a standardized way. * I/O serial devices in a standardized way.
* *
* @addtogroup IO_CHANNEL * @addtogroup IO_CHANNEL
* @details This module defines an abstract interface for I/O channels by * @details This module defines an abstract interface for I/O channels by
* extending the @p BaseSequentialStream interface. Note that no code * extending the @p BaseSequentialStream interface.<br>
* is present, I/O channels are just abstract interface like * Note that no code is present, I/O channels are just abstract
* structures, you should look at the systems as to a set of abstract * interface like structures, you should look at the systems as
* C++ classes (even if written in C). Specific device drivers can * to a set of abstract C++ classes (even if written in C).
* use/extend the interface and implement them.<br> * Specific device drivers can use/extend the interface and
* implement them.<br>
* This system has the advantage to make the access to channels * This system has the advantage to make the access to channels
* independent from the implementation logic. * independent from the implementation logic.
* @{ * @{

View File

@ -21,6 +21,8 @@
/** /**
* @file mmcsd.h * @file mmcsd.h
* @brief MMC/SD cards common header. * @brief MMC/SD cards common header.
* @details This header defines an abstract interface useful to access MMC/SD
* I/O block devices in a standardized way.
* *
* @addtogroup MMCSD * @addtogroup MMCSD
* @{ * @{

View File

@ -63,11 +63,10 @@ void port_halt(void) {
* is responsible for the context switch between 2 threads. * is responsible for the context switch between 2 threads.
* @note The implementation of this code affects <b>directly</b> the context * @note The implementation of this code affects <b>directly</b> the context
* switch performance so optimize here as much as you can. * switch performance so optimize here as much as you can.
*
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/ */
#if !defined(__DOXYGEN__)
__attribute__((naked)) __attribute__((naked))
#endif
void port_dummy1(void) { void port_dummy1(void) {
asm (".global _port_switch"); asm (".global _port_switch");
@ -96,7 +95,9 @@ void port_dummy1(void) {
* @details If the work function returns @p chThdExit() is automatically * @details If the work function returns @p chThdExit() is automatically
* invoked. * invoked.
*/ */
#if !defined(__DOXYGEN__)
__attribute__((naked)) __attribute__((naked))
#endif
void port_dummy2(void) { void port_dummy2(void) {
asm (".global _port_thread_start"); asm (".global _port_thread_start");

View File

@ -192,15 +192,15 @@ namespace chibios_rt {
* @brief Enables a virtual timer. * @brief Enables a virtual timer.
* @note The associated function is invoked from interrupt context. * @note The associated function is invoked from interrupt context.
* *
* @param[in] time the number of ticks before the operation timeouts, the * @param[in] time the number of ticks before the operation timeouts,
* special values are handled as follow: * the special values are handled as follow:
* - @a TIME_INFINITE is allowed but interpreted as a * - @a TIME_INFINITE is allowed but interpreted as a
* normal time specification. * normal time specification.
* - @a TIME_IMMEDIATE this value is not allowed. * - @a TIME_IMMEDIATE this value is not allowed.
* . * .
* @param[in] vtfunc the timer callback function. After invoking the * @param[in] vtfunc the timer callback function. After invoking the
* callback the timer is disabled and the structure can * callback the timer is disabled and the structure
* be disposed or reused. * can be disposed or reused.
* @param[in] par a parameter that will be passed to the callback * @param[in] par a parameter that will be passed to the callback
* function * function
* *
@ -289,6 +289,8 @@ namespace chibios_rt {
/** /**
* @brief Resumes the currently referenced thread, if any. * @brief Resumes the currently referenced thread, if any.
* *
* @param[in] msg the wakeup message
*
* @api * @api
*/ */
void resume(msg_t msg); void resume(msg_t msg);
@ -296,6 +298,8 @@ namespace chibios_rt {
/** /**
* @brief Resumes the currently referenced thread, if any. * @brief Resumes the currently referenced thread, if any.
* *
* @param[in] msg the wakeup message
*
* @iclass * @iclass
*/ */
void resumeI(msg_t msg); void resumeI(msg_t msg);
@ -305,8 +309,8 @@ namespace chibios_rt {
* @pre The target thread must be written to invoke periodically * @pre The target thread must be written to invoke periodically
* @p chThdShouldTerminate() and terminate cleanly if it returns * @p chThdShouldTerminate() and terminate cleanly if it returns
* @p TRUE. * @p TRUE.
* @post The specified thread will terminate after detecting the termination * @post The specified thread will terminate after detecting the
* condition. * termination condition.
* *
* @api * @api
*/ */
@ -317,10 +321,11 @@ namespace chibios_rt {
* @brief Blocks the execution of the invoking thread until the specified * @brief Blocks the execution of the invoking thread until the specified
* thread terminates then the exit code is returned. * thread terminates then the exit code is returned.
* @details This function waits for the specified thread to terminate then * @details This function waits for the specified thread to terminate then
* decrements its reference counter, if the counter reaches zero then * decrements its reference counter, if the counter reaches zero
* the thread working area is returned to the proper allocator.<br> * then the thread working area is returned to the proper
* The memory used by the exited thread is handled in different ways * allocator.<br>
* depending on the API that spawned the thread: * The memory used by the exited thread is handled in different
* ways depending on the API that spawned the thread:
* - If the thread was spawned by @p chThdCreateStatic() or by * - If the thread was spawned by @p chThdCreateStatic() or by
* @p chThdCreateI() then nothing happens and the thread working * @p chThdCreateI() then nothing happens and the thread working
* area is not released or modified in any way. This is the * area is not released or modified in any way. This is the
@ -334,12 +339,12 @@ namespace chibios_rt {
* order to use this function. * order to use this function.
* @post Enabling @p chThdWait() requires 2-4 (depending on the * @post Enabling @p chThdWait() requires 2-4 (depending on the
* architecture) extra bytes in the @p Thread structure. * architecture) extra bytes in the @p Thread structure.
* @post After invoking @p chThdWait() the thread pointer becomes invalid * @post After invoking @p chThdWait() the thread pointer becomes
* and must not be used as parameter for further system calls. * invalid and must not be used as parameter for further system
* @note If @p CH_USE_DYNAMIC is not specified this function just waits for * calls.
* the thread termination, no memory allocators are involved. * @note If @p CH_USE_DYNAMIC is not specified this function just waits
* for the thread termination, no memory allocators are involved.
* *
* @param[in] tp pointer to the thread
* @return The exit code from the terminated thread. * @return The exit code from the terminated thread.
* *
* @api * @api
@ -371,7 +376,6 @@ namespace chibios_rt {
/** /**
* @brief Returns an enqueued message or @p NULL. * @brief Returns an enqueued message or @p NULL.
* *
* @param[in] trp the sender thread reference
* @return The incoming message. * @return The incoming message.
* *
* @api * @api
@ -381,7 +385,6 @@ namespace chibios_rt {
/** /**
* @brief Releases the next message in queue with a reply. * @brief Releases the next message in queue with a reply.
* *
* @param[in] trp the sender thread reference
* @param[in] msg the answer message * @param[in] msg the answer message
* *
* @api * @api
@ -414,7 +417,7 @@ namespace chibios_rt {
}; };
/*------------------------------------------------------------------------* /*------------------------------------------------------------------------*
* chibios_rt::BaseThread * * chibios_rt::BaseThread *
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
/** /**
* @brief Abstract base class for a ChibiOS/RT thread. * @brief Abstract base class for a ChibiOS/RT thread.
@ -454,7 +457,7 @@ namespace chibios_rt {
* @pre This function only stores the pointer to the name if the option * @pre This function only stores the pointer to the name if the option
* @p CH_USE_REGISTRY is enabled else no action is performed. * @p CH_USE_REGISTRY is enabled else no action is performed.
* *
* @param[in] p thread name as a zero terminated string * @param[in] tname thread name as a zero terminated string
* *
* @api * @api
*/ */
@ -507,7 +510,8 @@ namespace chibios_rt {
static void exitS(msg_t msg); static void exitS(msg_t msg);
/** /**
* @brief Verifies if the current thread has a termination request pending. * @brief Verifies if the current thread has a termination request
* pending.
* @note Can be invoked in any context. * @note Can be invoked in any context.
* *
* @retval TRUE termination request pending. * @retval TRUE termination request pending.
@ -520,10 +524,10 @@ namespace chibios_rt {
/** /**
* @brief Suspends the invoking thread for the specified time. * @brief Suspends the invoking thread for the specified time.
* *
* @param[in] time the delay in system ticks, the special values are * @param[in] interval the delay in system ticks, the special values are
* handled as follow: * handled as follow:
* - @a TIME_INFINITE the thread enters an infinite sleep * - @a TIME_INFINITE the thread enters an infinite
* state. * sleep state.
* - @a TIME_IMMEDIATE this value is not allowed. * - @a TIME_IMMEDIATE this value is not allowed.
* . * .
* *
@ -532,8 +536,8 @@ namespace chibios_rt {
static void sleep(systime_t interval); static void sleep(systime_t interval);
/** /**
* @brief Suspends the invoking thread until the system time arrives to the * @brief Suspends the invoking thread until the system time arrives to
* specified value. * the specified value.
* *
* @param[in] time absolute system time * @param[in] time absolute system time
* *
@ -543,8 +547,8 @@ namespace chibios_rt {
/** /**
* @brief Yields the time slot. * @brief Yields the time slot.
* @details Yields the CPU control to the next thread in the ready list with * @details Yields the CPU control to the next thread in the ready list
* equal priority, if any. * with equal priority, if any.
* *
* @api * @api
*/ */
@ -574,7 +578,8 @@ namespace chibios_rt {
/** /**
* @brief Adds (OR) a set of event flags on the current thread, this is * @brief Adds (OR) a set of event flags on the current thread, this is
* @b much faster than using @p chEvtBroadcast() or @p chEvtSignal(). * @b much faster than using @p chEvtBroadcast() or
* @p chEvtSignal().
* *
* @param[in] mask the event flags to be added * @param[in] mask the event flags to be added
* @return The current pending events mask. * @return The current pending events mask.
@ -643,7 +648,8 @@ namespace chibios_rt {
* @param[in] ewmask mask of the events that the function should * @param[in] ewmask mask of the events that the function should
* wait for, @p ALL_EVENTS enables all the events * wait for, @p ALL_EVENTS enables all the events
* *
* @param[in] time the number of ticks before the operation timouts * @param[in] time the number of ticks before the operation
* timouts
* @return The mask of the lowest id served and cleared * @return The mask of the lowest id served and cleared
* event. * event.
* @retval 0 if the specified timeout expired. * @retval 0 if the specified timeout expired.
@ -693,8 +699,8 @@ namespace chibios_rt {
* @brief Invokes the event handlers associated to an event flags mask. * @brief Invokes the event handlers associated to an event flags mask.
* *
* @param[in] mask mask of the event flags to be dispatched * @param[in] mask mask of the event flags to be dispatched
* @param[in] handlers an array of @p evhandler_t. The array must have size * @param[in] handlers an array of @p evhandler_t. The array must have
* equal to the number of bits in eventmask_t. * size equal to the number of bits in eventmask_t.
* *
* @api * @api
*/ */
@ -735,8 +741,8 @@ namespace chibios_rt {
* mutexes are unlocked. * mutexes are unlocked.
* @note This function is <b>MUCH MORE</b> efficient than releasing the * @note This function is <b>MUCH MORE</b> efficient than releasing the
* mutexes one by one and not just because the call overhead, * mutexes one by one and not just because the call overhead,
* this function does not have any overhead related to the priority * this function does not have any overhead related to the
* inheritance mechanism. * priority inheritance mechanism.
* *
* @api * @api
*/ */
@ -756,7 +762,7 @@ namespace chibios_rt {
template <int N> template <int N>
class BaseStaticThread : public BaseThread { class BaseStaticThread : public BaseThread {
protected: protected:
WORKING_AREA(wa, N); // Thread working area. WORKING_AREA(wa, N);
public: public:
/** /**
@ -815,14 +821,14 @@ namespace chibios_rt {
/** /**
* @brief Performs a reset operation on the semaphore. * @brief Performs a reset operation on the semaphore.
* @post After invoking this function all the threads waiting on the * @post After invoking this function all the threads waiting on the
* semaphore, if any, are released and the semaphore counter is set * semaphore, if any, are released and the semaphore counter is
* to the specified, non negative, value. * set to the specified, non negative, value.
* @note The released threads can recognize they were waked up by a reset * @note The released threads can recognize they were waked up by a
* rather than a signal because the @p chSemWait() will return * reset rather than a signal because the @p chSemWait() will
* @p RDY_RESET instead of @p RDY_OK. * return @p RDY_RESET instead of @p RDY_OK.
* *
* @param[in] n the new value of the semaphore counter. The value must * @param[in] n the new value of the semaphore counter. The value
* be non-negative. * must be non-negative.
* *
* @api * @api
*/ */
@ -831,18 +837,18 @@ namespace chibios_rt {
/** /**
* @brief Performs a reset operation on the semaphore. * @brief Performs a reset operation on the semaphore.
* @post After invoking this function all the threads waiting on the * @post After invoking this function all the threads waiting on the
* semaphore, if any, are released and the semaphore counter is set * semaphore, if any, are released and the semaphore counter is
* to the specified, non negative, value. * set to the specified, non negative, value.
* @post This function does not reschedule so a call to a rescheduling * @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that * function must be performed before unlocking the kernel. Note
* interrupt handlers always reschedule on exit so an explicit * that interrupt handlers always reschedule on exit so an
* reschedule must not be performed in ISRs. * explicit reschedule must not be performed in ISRs.
* @note The released threads can recognize they were waked up by a reset * @note The released threads can recognize they were waked up by a
* rather than a signal because the @p chSemWait() will return * reset rather than a signal because the @p chSemWait() will
* @p RDY_RESET instead of @p RDY_OK. * return @p RDY_RESET instead of @p RDY_OK.
* *
* @param[in] n the new value of the semaphore counter. The value must * @param[in] n the new value of the semaphore counter. The value
* be non-negative. * must be non-negative.
* *
* @iclass * @iclass
*/ */
@ -851,11 +857,12 @@ namespace chibios_rt {
/** /**
* @brief Performs a wait operation on a semaphore. * @brief Performs a wait operation on a semaphore.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the thread has not stopped on the semaphore or the * @retval RDY_OK if the thread has not stopped on the semaphore or
* semaphore has been signaled. * the semaphore has been signaled.
* @retval RDY_RESET if the semaphore has been reset using @p chSemReset(). * @retval RDY_RESET if the semaphore has been reset using
* @p chSemReset().
* *
* @api * @api
*/ */
@ -864,51 +871,56 @@ namespace chibios_rt {
/** /**
* @brief Performs a wait operation on a semaphore. * @brief Performs a wait operation on a semaphore.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the thread has not stopped on the semaphore or the * @retval RDY_OK if the thread has not stopped on the semaphore or
* semaphore has been signaled. * the semaphore has been signaled.
* @retval RDY_RESET if the semaphore has been reset using @p chSemReset(). * @retval RDY_RESET if the semaphore has been reset using
* @p chSemReset().
* *
* @sclass * @sclass
*/ */
msg_t waitS(void); msg_t waitS(void);
/** /**
* @brief Performs a wait operation on a semaphore with timeout specification. * @brief Performs a wait operation on a semaphore with timeout
* specification.
* *
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed: * the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the thread has not stopped on the semaphore or the * @retval RDY_OK if the thread has not stopped on the semaphore or
* semaphore has been signaled. * the semaphore has been signaled.
* @retval RDY_RESET if the semaphore has been reset using @p chSemReset(). * @retval RDY_RESET if the semaphore has been reset using
* @retval RDY_TIMEOUT if the semaphore has not been signaled or reset within * @p chSemReset().
* the specified timeout. * @retval RDY_TIMEOUT if the semaphore has not been signaled or reset
* within the specified timeout.
* *
* @api * @api
*/ */
msg_t waitTimeout(systime_t time); msg_t waitTimeout(systime_t time);
/** /**
* @brief Performs a wait operation on a semaphore with timeout specification. * @brief Performs a wait operation on a semaphore with timeout
* specification.
* *
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed: * the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the thread has not stopped on the semaphore or the * @retval RDY_OK if the thread has not stopped on the semaphore or
* semaphore has been signaled. * the semaphore has been signaled.
* @retval RDY_RESET if the semaphore has been reset using @p chSemReset(). * @retval RDY_RESET if the semaphore has been reset using
* @retval RDY_TIMEOUT if the semaphore has not been signaled or reset within * @p chSemReset().
* the specified timeout. * @retval RDY_TIMEOUT if the semaphore has not been signaled or reset
* within the specified timeout.
* *
* @sclass * @sclass
*/ */
@ -924,9 +936,9 @@ namespace chibios_rt {
/** /**
* @brief Performs a signal operation on a semaphore. * @brief Performs a signal operation on a semaphore.
* @post This function does not reschedule so a call to a rescheduling * @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that * function must be performed before unlocking the kernel. Note
* interrupt handlers always reschedule on exit so an explicit * that interrupt handlers always reschedule on exit so an
* reschedule must not be performed in ISRs. * explicit reschedule must not be performed in ISRs.
* *
* @iclass * @iclass
*/ */
@ -935,12 +947,12 @@ namespace chibios_rt {
/** /**
* @brief Adds the specified value to the semaphore counter. * @brief Adds the specified value to the semaphore counter.
* @post This function does not reschedule so a call to a rescheduling * @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that * function must be performed before unlocking the kernel. Note
* interrupt handlers always reschedule on exit so an explicit * that interrupt handlers always reschedule on exit so an explicit
* reschedule must not be performed in ISRs. * reschedule must not be performed in ISRs.
* *
* @param[in] n value to be added to the semaphore counter. The value * @param[in] n value to be added to the semaphore counter. The
* must be positive. * value must be positive.
* *
* @iclass * @iclass
*/ */
@ -949,6 +961,8 @@ namespace chibios_rt {
/** /**
* @brief Returns the semaphore counter value. * @brief Returns the semaphore counter value.
* *
* @return The semaphore counter value.
*
* @iclass * @iclass
*/ */
cnt_t getCounterI(void); cnt_t getCounterI(void);
@ -959,11 +973,12 @@ namespace chibios_rt {
* *
* @param[in] ssem @p Semaphore object to be signaled * @param[in] ssem @p Semaphore object to be signaled
* @param[in] wsem @p Semaphore object to wait on * @param[in] wsem @p Semaphore object to wait on
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread
* released from the semaphore. * has been released from the semaphore.
* @retval RDY_OK if the thread has not stopped on the semaphore or the * @retval RDY_OK if the thread has not stopped on the semaphore
* semaphore has been signaled. * or the semaphore has been signaled.
* @retval RDY_RESET if the semaphore has been reset using @p chSemReset(). * @retval RDY_RESET if the semaphore has been reset using
* @p chSemReset().
* *
* @api * @api
*/ */
@ -1000,9 +1015,10 @@ namespace chibios_rt {
/** /**
* @brief Wait operation on the binary semaphore. * @brief Wait operation on the binary semaphore.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the binary semaphore has been successfully taken. * @retval RDY_OK if the binary semaphore has been successfully
* taken.
* @retval RDY_RESET if the binary semaphore has been reset using * @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset(). * @p bsemReset().
* *
@ -1013,9 +1029,10 @@ namespace chibios_rt {
/** /**
* @brief Wait operation on the binary semaphore. * @brief Wait operation on the binary semaphore.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the binary semaphore has been successfully taken. * @retval RDY_OK if the binary semaphore has been successfully
* taken.
* @retval RDY_RESET if the binary semaphore has been reset using * @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset(). * @p bsemReset().
* *
@ -1031,13 +1048,14 @@ namespace chibios_rt {
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the binary semaphore has been successfully taken. * @retval RDY_OK if the binary semaphore has been successfully
* taken.
* @retval RDY_RESET if the binary semaphore has been reset using * @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset(). * @p bsemReset().
* @retval RDY_TIMEOUT if the binary semaphore has not been signaled or reset * @retval RDY_TIMEOUT if the binary semaphore has not been signaled
* within the specified timeout. * or reset within the specified timeout.
* *
* @api * @api
*/ */
@ -1051,13 +1069,14 @@ namespace chibios_rt {
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the semaphore. * been released from the semaphore.
* @retval RDY_OK if the binary semaphore has been successfully taken. * @retval RDY_OK if the binary semaphore has been successfully
* taken.
* @retval RDY_RESET if the binary semaphore has been reset using * @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset(). * @p bsemReset().
* @retval RDY_TIMEOUT if the binary semaphore has not been signaled or reset * @retval RDY_TIMEOUT if the binary semaphore has not been signaled
* within the specified timeout. * or reset within the specified timeout.
* *
* @sclass * @sclass
*/ */
@ -1065,9 +1084,9 @@ namespace chibios_rt {
/** /**
* @brief Reset operation on the binary semaphore. * @brief Reset operation on the binary semaphore.
* @note The released threads can recognize they were waked up by a reset * @note The released threads can recognize they were waked up by a
* rather than a signal because the @p bsemWait() will return * reset rather than a signal because the @p bsemWait() will
* @p RDY_RESET instead of @p RDY_OK. * return @p RDY_RESET instead of @p RDY_OK.
* *
* @param[in] taken new state of the binary semaphore * @param[in] taken new state of the binary semaphore
* - @a FALSE, the new state is not taken. * - @a FALSE, the new state is not taken.
@ -1080,9 +1099,9 @@ namespace chibios_rt {
/** /**
* @brief Reset operation on the binary semaphore. * @brief Reset operation on the binary semaphore.
* @note The released threads can recognize they were waked up by a reset * @note The released threads can recognize they were waked up by a
* rather than a signal because the @p bsemWait() will return * reset rather than a signal because the @p bsemWait() will
* @p RDY_RESET instead of @p RDY_OK. * return @p RDY_RESET instead of @p RDY_OK.
* @note This function does not reschedule. * @note This function does not reschedule.
* *
* @param[in] taken new state of the binary semaphore * @param[in] taken new state of the binary semaphore
@ -1147,9 +1166,10 @@ namespace chibios_rt {
/** /**
* @brief Tries to lock a mutex. * @brief Tries to lock a mutex.
* @details This function attempts to lock a mutex, if the mutex is already * @details This function attempts to lock a mutex, if the mutex is already
* locked by another thread then the function exits without waiting. * locked by another thread then the function exits without
* @post The mutex is locked and inserted in the per-thread stack of owned * waiting.
* mutexes. * @post The mutex is locked and inserted in the per-thread stack of
* owned mutexes.
* @note This function does not have any overhead related to the * @note This function does not have any overhead related to the
* priority inheritance mechanism because it does not try to * priority inheritance mechanism because it does not try to
* enter a sleep state. * enter a sleep state.
@ -1165,9 +1185,10 @@ namespace chibios_rt {
/** /**
* @brief Tries to lock a mutex. * @brief Tries to lock a mutex.
* @details This function attempts to lock a mutex, if the mutex is already * @details This function attempts to lock a mutex, if the mutex is already
* taken by another thread then the function exits without waiting. * taken by another thread then the function exits without
* @post The mutex is locked and inserted in the per-thread stack of owned * waiting.
* mutexes. * @post The mutex is locked and inserted in the per-thread stack of
* owned mutexes.
* @note This function does not have any overhead related to the * @note This function does not have any overhead related to the
* priority inheritance mechanism because it does not try to * priority inheritance mechanism because it does not try to
* enter a sleep state. * enter a sleep state.
@ -1182,8 +1203,8 @@ namespace chibios_rt {
/** /**
* @brief Locks the specified mutex. * @brief Locks the specified mutex.
* @post The mutex is locked and inserted in the per-thread stack of owned * @post The mutex is locked and inserted in the per-thread stack of
* mutexes. * owned mutexes.
* *
* @api * @api
*/ */
@ -1191,8 +1212,8 @@ namespace chibios_rt {
/** /**
* @brief Locks the specified mutex. * @brief Locks the specified mutex.
* @post The mutex is locked and inserted in the per-thread stack of owned * @post The mutex is locked and inserted in the per-thread stack of
* mutexes. * owned mutexes.
* *
* @sclass * @sclass
*/ */
@ -1231,9 +1252,9 @@ namespace chibios_rt {
/** /**
* @brief Signals one thread that is waiting on the condition variable. * @brief Signals one thread that is waiting on the condition variable.
* @post This function does not reschedule so a call to a rescheduling * @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that * function must be performed before unlocking the kernel. Note
* interrupt handlers always reschedule on exit so an explicit * that interrupt handlers always reschedule on exit so an
* reschedule must not be performed in ISRs. * explicit reschedule must not be performed in ISRs.
* *
* @iclass * @iclass
*/ */
@ -1249,9 +1270,9 @@ namespace chibios_rt {
/** /**
* @brief Signals all threads that are waiting on the condition variable. * @brief Signals all threads that are waiting on the condition variable.
* @post This function does not reschedule so a call to a rescheduling * @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that * function must be performed before unlocking the kernel. Note
* interrupt handlers always reschedule on exit so an explicit * that interrupt handlers always reschedule on exit so an
* reschedule must not be performed in ISRs. * explicit reschedule must not be performed in ISRs.
* *
* @iclass * @iclass
*/ */
@ -1260,12 +1281,12 @@ namespace chibios_rt {
/** /**
* @brief Waits on the condition variable releasing the mutex lock. * @brief Waits on the condition variable releasing the mutex lock.
* @details Releases the currently owned mutex, waits on the condition * @details Releases the currently owned mutex, waits on the condition
* variable, and finally acquires the mutex again. All the sequence * variable, and finally acquires the mutex again. All the
* is performed atomically. * sequence is performed atomically.
* @pre The invoking thread <b>must</b> have at least one owned mutex. * @pre The invoking thread <b>must</b> have at least one owned mutex.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the condition variable. * been released from the condition variable.
* @retval RDY_OK if the condvar has been signaled using * @retval RDY_OK if the condvar has been signaled using
* @p chCondSignal(). * @p chCondSignal().
* @retval RDY_RESET if the condvar has been signaled using * @retval RDY_RESET if the condvar has been signaled using
@ -1278,12 +1299,12 @@ namespace chibios_rt {
/** /**
* @brief Waits on the condition variable releasing the mutex lock. * @brief Waits on the condition variable releasing the mutex lock.
* @details Releases the currently owned mutex, waits on the condition * @details Releases the currently owned mutex, waits on the condition
* variable, and finally acquires the mutex again. All the sequence * variable, and finally acquires the mutex again. All the
* is performed atomically. * sequence is performed atomically.
* @pre The invoking thread <b>must</b> have at least one owned mutex. * @pre The invoking thread <b>must</b> have at least one owned mutex.
* *
* @return A message specifying how the invoking thread has been * @return A message specifying how the invoking thread has
* released from the condition variable. * been released from the condition variable.
* @retval RDY_OK if the condvar has been signaled using * @retval RDY_OK if the condvar has been signaled using
* @p chCondSignal(). * @p chCondSignal().
* @retval RDY_RESET if the condvar has been signaled using * @retval RDY_RESET if the condvar has been signaled using
@ -1316,7 +1337,7 @@ namespace chibios_rt {
#if CH_USE_EVENTS || defined(__DOXYGEN__) #if CH_USE_EVENTS || defined(__DOXYGEN__)
/*------------------------------------------------------------------------* /*------------------------------------------------------------------------*
* chibios_rt::EvtListener * * chibios_rt::EvtListener *
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
/** /**
* @brief Class encapsulating an event listener. * @brief Class encapsulating an event listener.
@ -1324,14 +1345,13 @@ namespace chibios_rt {
class EvtListener { class EvtListener {
public: public:
/** /**
* @brief Embedded @p ::EvtListener structure. * @brief Embedded @p ::EventListener structure.
*/ */
struct ::EventListener ev_listener; struct ::EventListener ev_listener;
/** /**
* @brief Returns the pending flags from the listener and clears them. * @brief Returns the pending flags from the listener and clears them.
* *
* @param[in] flags the events to be cleared
* @return The flags added to the listener by the * @return The flags added to the listener by the
* associated event source. * associated event source.
* *
@ -1353,7 +1373,7 @@ namespace chibios_rt {
}; };
/*------------------------------------------------------------------------* /*------------------------------------------------------------------------*
* chibios_rt::EvtSource * * chibios_rt::EvtSource *
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
/** /**
* @brief Class encapsulating an event source. * @brief Class encapsulating an event source.
@ -1361,13 +1381,13 @@ namespace chibios_rt {
class EvtSource { class EvtSource {
public: public:
/** /**
* @brief Embedded @p ::EvtSource structure. * @brief Embedded @p ::EventSource structure.
*/ */
struct ::EventSource ev_source; struct ::EventSource ev_source;
/** /**
* @brief EvtSource object constructor. * @brief EvtSource object constructor.
* @details The embedded @p ::EvtSource structure is initialized. * @details The embedded @p ::EventSource structure is initialized.
* *
* @init * @init
*/ */
@ -1454,7 +1474,8 @@ namespace chibios_rt {
* @param[in] bp pointer to a memory area allocated as queue buffer * @param[in] bp pointer to a memory area allocated as queue buffer
* @param[in] size size of the queue buffer * @param[in] size size of the queue buffer
* @param[in] infy pointer to a callback function that is invoked when * @param[in] infy pointer to a callback function that is invoked when
* data is read from the queue. The value can be @p NULL. * data is read from the queue. The value can be
* @p NULL.
* @param[in] link application defined pointer * @param[in] link application defined pointer
* *
* @init * @init
@ -1529,9 +1550,9 @@ namespace chibios_rt {
/** /**
* @brief Input queue read. * @brief Input queue read.
* @details This function reads a byte value from an input queue. If the queue * @details This function reads a byte value from an input queue. If the
* is empty then the calling thread is suspended until a byte arrives * queue is empty then the calling thread is suspended until a
* in the queue. * byte arrives in the queue.
* *
* @return A byte value from the queue. * @return A byte value from the queue.
* @retval Q_RESET if the queue has been reset. * @retval Q_RESET if the queue has been reset.
@ -1542,9 +1563,9 @@ namespace chibios_rt {
/** /**
* @brief Input queue read with timeout. * @brief Input queue read with timeout.
* @details This function reads a byte value from an input queue. If the queue * @details This function reads a byte value from an input queue. If the
* is empty then the calling thread is suspended until a byte arrives * queue is empty then the calling thread is suspended until a
* in the queue or a timeout occurs. * byte arrives in the queue or a timeout occurs.
* @note The callback is invoked before reading the character from the * @note The callback is invoked before reading the character from the
* buffer or before entering the state @p THD_STATE_WTQUEUE. * buffer or before entering the state @p THD_STATE_WTQUEUE.
* *
@ -1567,8 +1588,8 @@ namespace chibios_rt {
* operation completes when the specified amount of data has been * operation completes when the specified amount of data has been
* transferred or after the specified timeout or if the queue has * transferred or after the specified timeout or if the queue has
* been reset. * been reset.
* @note The function is not atomic, if you need atomicity it is suggested * @note The function is not atomic, if you need atomicity it is
* to use a semaphore or a mutex for mutual exclusion. * suggested to use a semaphore or a mutex for mutual exclusion.
* @note The callback is invoked before reading each character from the * @note The callback is invoked before reading each character from the
* buffer or before entering the state @p THD_STATE_WTQUEUE. * buffer or before entering the state @p THD_STATE_WTQUEUE.
* *
@ -1604,6 +1625,9 @@ namespace chibios_rt {
/** /**
* @brief InQueueBuffer constructor. * @brief InQueueBuffer constructor.
* *
* @param[in] infy input notify callback function
* @param[in] link parameter to be passed to the callback
*
* @init * @init
*/ */
InQueueBuffer(qnotify_t infy, void *link) : InQueue(iq_buf, N, InQueueBuffer(qnotify_t infy, void *link) : InQueue(iq_buf, N,
@ -1631,7 +1655,8 @@ namespace chibios_rt {
* @param[in] bp pointer to a memory area allocated as queue buffer * @param[in] bp pointer to a memory area allocated as queue buffer
* @param[in] size size of the queue buffer * @param[in] size size of the queue buffer
* @param[in] onfy pointer to a callback function that is invoked when * @param[in] onfy pointer to a callback function that is invoked when
* data is written to the queue. The value can be @p NULL. * data is written to the queue. The value can be
* @p NULL.
* @param[in] link application defined pointer * @param[in] link application defined pointer
* *
* @init * @init
@ -1682,10 +1707,10 @@ namespace chibios_rt {
/** /**
* @brief Resets an output queue. * @brief Resets an output queue.
* @details All the data in the output queue is erased and lost, any waiting * @details All the data in the output queue is erased and lost, any
* thread is resumed with status @p Q_RESET. * waiting thread is resumed with status @p Q_RESET.
* @note A reset operation can be used by a low level driver in order to * @note A reset operation can be used by a low level driver in order
* obtain immediate attention from the high level layers. * to obtain immediate attention from the high level layers.
* *
* @iclass * @iclass
*/ */
@ -1693,9 +1718,9 @@ namespace chibios_rt {
/** /**
* @brief Output queue write. * @brief Output queue write.
* @details This function writes a byte value to an output queue. If the queue * @details This function writes a byte value to an output queue. If the
* is full then the calling thread is suspended until there is space * queue is full then the calling thread is suspended until there
* in the queue. * is space in the queue.
* *
* @param[in] b the byte value to be written in the queue * @param[in] b the byte value to be written in the queue
* @return The operation status. * @return The operation status.
@ -1708,9 +1733,9 @@ namespace chibios_rt {
/** /**
* @brief Output queue write with timeout. * @brief Output queue write with timeout.
* @details This function writes a byte value to an output queue. If the queue * @details This function writes a byte value to an output queue. If the
* is full then the calling thread is suspended until there is space * queue is full then the calling thread is suspended until there
* in the queue or a timeout occurs. * is space in the queue or a timeout occurs.
* @note The callback is invoked after writing the character into the * @note The callback is invoked after writing the character into the
* buffer. * buffer.
* *
@ -1746,8 +1771,8 @@ namespace chibios_rt {
* operation completes when the specified amount of data has been * operation completes when the specified amount of data has been
* transferred or after the specified timeout or if the queue has * transferred or after the specified timeout or if the queue has
* been reset. * been reset.
* @note The function is not atomic, if you need atomicity it is suggested * @note The function is not atomic, if you need atomicity it is
* to use a semaphore or a mutex for mutual exclusion. * suggested to use a semaphore or a mutex for mutual exclusion.
* @note The callback is invoked after writing each character into the * @note The callback is invoked after writing each character into the
* buffer. * buffer.
* *
@ -1783,6 +1808,9 @@ namespace chibios_rt {
/** /**
* @brief OutQueueBuffer constructor. * @brief OutQueueBuffer constructor.
* *
* @param[in] onfy output notify callback function
* @param[in] link parameter to be passed to the callback
*
* @init * @init
*/ */
OutQueueBuffer(qnotify_t onfy, void *link) : OutQueue(oq_buf, N, OutQueueBuffer(qnotify_t onfy, void *link) : OutQueue(oq_buf, N,
@ -1819,8 +1847,8 @@ namespace chibios_rt {
/** /**
* @brief Resets a Mailbox object. * @brief Resets a Mailbox object.
* @details All the waiting threads are resumed with status @p RDY_RESET and * @details All the waiting threads are resumed with status @p RDY_RESET
* the queued messages are lost. * and the queued messages are lost.
* *
* @api * @api
*/ */
@ -1828,8 +1856,8 @@ namespace chibios_rt {
/** /**
* @brief Posts a message into a mailbox. * @brief Posts a message into a mailbox.
* @details The invoking thread waits until a empty slot in the mailbox becomes * @details The invoking thread waits until a empty slot in the mailbox
* available or the specified time runs out. * becomes available or the specified time runs out.
* *
* @param[in] msg the message to be posted on the mailbox * @param[in] msg the message to be posted on the mailbox
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
@ -1848,8 +1876,8 @@ namespace chibios_rt {
/** /**
* @brief Posts a message into a mailbox. * @brief Posts a message into a mailbox.
* @details The invoking thread waits until a empty slot in the mailbox becomes * @details The invoking thread waits until a empty slot in the mailbox
* available or the specified time runs out. * becomes available or the specified time runs out.
* *
* @param[in] msg the message to be posted on the mailbox * @param[in] msg the message to be posted on the mailbox
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
@ -1883,8 +1911,8 @@ namespace chibios_rt {
/** /**
* @brief Posts an high priority message into a mailbox. * @brief Posts an high priority message into a mailbox.
* @details The invoking thread waits until a empty slot in the mailbox becomes * @details The invoking thread waits until a empty slot in the mailbox
* available or the specified time runs out. * becomes available or the specified time runs out.
* *
* @param[in] msg the message to be posted on the mailbox * @param[in] msg the message to be posted on the mailbox
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
@ -1903,8 +1931,8 @@ namespace chibios_rt {
/** /**
* @brief Posts an high priority message into a mailbox. * @brief Posts an high priority message into a mailbox.
* @details The invoking thread waits until a empty slot in the mailbox becomes * @details The invoking thread waits until a empty slot in the mailbox
* available or the specified time runs out. * becomes available or the specified time runs out.
* *
* @param[in] msg the message to be posted on the mailbox * @param[in] msg the message to be posted on the mailbox
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time the number of ticks before the operation timeouts,
@ -1938,12 +1966,12 @@ namespace chibios_rt {
/** /**
* @brief Retrieves a message from a mailbox. * @brief Retrieves a message from a mailbox.
* @details The invoking thread waits until a message is posted in the mailbox * @details The invoking thread waits until a message is posted in the
* or the specified time runs out. * mailbox or the specified time runs out.
* *
* @param[out] msgp pointer to a message variable for the received message * @param[out] msgp pointer to a message variable for the received
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time message the number of ticks before the operation
* the following special values are allowed: * timeouts, the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
@ -1958,12 +1986,12 @@ namespace chibios_rt {
/** /**
* @brief Retrieves a message from a mailbox. * @brief Retrieves a message from a mailbox.
* @details The invoking thread waits until a message is posted in the mailbox * @details The invoking thread waits until a message is posted in the
* or the specified time runs out. * mailbox or the specified time runs out.
* *
* @param[out] msgp pointer to a message variable for the received message * @param[out] msgp pointer to a message variable for the received
* @param[in] time the number of ticks before the operation timeouts, * @param[in] time message the number of ticks before the operation
* the following special values are allowed: * timeouts, the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout. * - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout. * - @a TIME_INFINITE no timeout.
* . * .
@ -1981,7 +2009,8 @@ namespace chibios_rt {
* @details This variant is non-blocking, the function returns a timeout * @details This variant is non-blocking, the function returns a timeout
* condition if the queue is empty. * condition if the queue is empty.
* *
* @param[out] msgp pointer to a message variable for the received message * @param[out] msgp pointer to a message variable for the received
* message
* @return The operation status. * @return The operation status.
* @retval RDY_OK if a message has been correctly fetched. * @retval RDY_OK if a message has been correctly fetched.
* @retval RDY_TIMEOUT if the mailbox is empty and a message cannot be * @retval RDY_TIMEOUT if the mailbox is empty and a message cannot be
@ -2034,9 +2063,9 @@ namespace chibios_rt {
/** /**
* @brief MemoryPool constructor. * @brief MemoryPool constructor.
* *
* @param[in] size the size of the objects contained in this memory pool, * @param[in] size the size of the objects contained in this memory
* the minimum accepted size is the size of a pointer to * pool, the minimum accepted size is the size of
* void. * a pointer to void.
* @param[in] provider memory provider function for the memory pool or * @param[in] provider memory provider function for the memory pool or
* @p NULL if the pool is not allowed to grow * @p NULL if the pool is not allowed to grow
* automatically * automatically
@ -2048,9 +2077,9 @@ namespace chibios_rt {
/** /**
* @brief MemoryPool constructor. * @brief MemoryPool constructor.
* *
* @param[in] size the size of the objects contained in this memory pool, * @param[in] size the size of the objects contained in this memory
* the minimum accepted size is the size of a pointer to * pool, the minimum accepted size is the size of
* void. * a pointer to void.
* @param[in] provider memory provider function for the memory pool or * @param[in] provider memory provider function for the memory pool or
* @p NULL if the pool is not allowed to grow * @p NULL if the pool is not allowed to grow
* automatically * automatically
@ -2102,7 +2131,8 @@ namespace chibios_rt {
* @pre The memory pool must be already been initialized. * @pre The memory pool must be already been initialized.
* @pre The freed object must be of the right size for the specified * @pre The freed object must be of the right size for the specified
* memory pool. * memory pool.
* @pre The object must be properly aligned to contain a pointer to void. * @pre The object must be properly aligned to contain a pointer to
* void.
* *
* @param[in] objp the pointer to the object to be released * @param[in] objp the pointer to the object to be released
* *
@ -2173,9 +2203,9 @@ namespace chibios_rt {
* *
* @param[in] bp pointer to the data buffer * @param[in] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred * @param[in] n the maximum amount of data to be transferred
* @return The number of bytes transferred. The return value can * @return The number of bytes transferred. The return value
* be less than the specified number of bytes if an * can be less than the specified number of bytes if
* end-of-file condition has been met. * an end-of-file condition has been met.
* *
* @api * @api
*/ */
@ -2187,9 +2217,9 @@ namespace chibios_rt {
* *
* @param[out] bp pointer to the data buffer * @param[out] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred * @param[in] n the maximum amount of data to be transferred
* @return The number of bytes transferred. The return value can * @return The number of bytes transferred. The return value
* be less than the specified number of bytes if an * can be less than the specified number of bytes if
* end-of-file condition has been met. * an end-of-file condition has been met.
* *
* @api * @api
*/ */
@ -2198,7 +2228,8 @@ namespace chibios_rt {
/** /**
* @brief Sequential Stream blocking byte write. * @brief Sequential Stream blocking byte write.
* @details This function writes a byte value to a channel. If the channel * @details This function writes a byte value to a channel. If the channel
* is not ready to accept data then the calling thread is suspended. * is not ready to accept data then the calling thread is
* suspended.
* *
* @param[in] b the byte value to be written to the channel * @param[in] b the byte value to be written to the channel
* *