aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-30 14:41:51 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-30 14:41:51 +0000
commitbfa477e96da26b31d6907260b72037c67cd30d3d (patch)
tree2952bac38e26a0d2afa235127c6bdf975c08856c /os/hal/include
parent503e05816d39e931a363bdc981e07715e6bfa57e (diff)
downloadChibiOS-bfa477e96da26b31d6907260b72037c67cd30d3d.tar.gz
ChibiOS-bfa477e96da26b31d6907260b72037c67cd30d3d.tar.bz2
ChibiOS-bfa477e96da26b31d6907260b72037c67cd30d3d.zip
Fixed few newly introduced documentation errors. Improved card detection.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4364 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/io_block.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/os/hal/include/io_block.h b/os/hal/include/io_block.h
index 90b17be13..b079ac847 100644
--- a/os/hal/include/io_block.h
+++ b/os/hal/include/io_block.h
@@ -113,17 +113,39 @@ typedef struct {
*/
/**
* @brief Returns the driver state.
+ * @note Can be called in ISR context.
*
* @param[in] ip pointer to a @p BaseBlockDevice or derived class
*
* @return The driver state.
*
- * @api
+ * @special
*/
#define blkGetDriverState(ip) ((ip)->state)
/**
+ * @brief Determines if the device is transferring data.
+ * @note Can be called in ISR context.
+ *
+ * @param[in] ip pointer to a @p BaseBlockDevice or derived class
+ *
+ * @return The driver state.
+ * @retval FALSE the device is not transferring data.
+ * @retval TRUE the device not transferring data.
+ *
+ * @special
+ */
+#define blkIsTransferring(ip) ((((ip)->state) == BLK_CONNECTING) || \
+ (((ip)->state) == BLK_DISCONNECTING) || \
+ (((ip)->state) == BLK_READING) || \
+ (((ip)->state) == BLK_WRITING))
+
+/**
* @brief Returns the media insertion status.
+ * @note On some implementations this function can only be called if the
+ * device is not transferring data.
+ * The function @p blkIsTransferring() should be used before calling
+ * this function.
*
* @param[in] ip pointer to a @p BaseBlockDevice or derived class
*
@@ -157,8 +179,8 @@ typedef struct {
* @param[in] ip pointer to a @p BaseBlockDevice or derived class
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/
@@ -171,8 +193,8 @@ typedef struct {
* @param[in] ip pointer to a @p BaseBlockDevice or derived class
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/
@@ -187,8 +209,8 @@ typedef struct {
* @param[in] n number of blocks to read
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/
@@ -204,8 +226,8 @@ typedef struct {
* @param[in] n number of blocks to write
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/
@@ -218,8 +240,8 @@ typedef struct {
* @param[in] ip pointer to a @p BaseBlockDevice or derived class
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/
@@ -232,8 +254,8 @@ typedef struct {
* @param[out] bdip pointer to a @p BlockDeviceInfo structure
*
* @return The operation status.
- * @retval FALSE operation succeeded.
- * @retval TRUE operation failed.
+ * @retval CH_SUCCESS operation succeeded.
+ * @retval CH_FAILED operation failed.
*
* @api
*/