aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/mmc_spi.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-06 16:17:30 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-06 16:17:30 +0000
commite3c7dc319ff582f9eb4a593950ac7bedb1d38b77 (patch)
tree7646d3700bef00d4ee01bafa24523ff9b6f2f4b5 /os/hal/src/mmc_spi.c
parentf362c3ceb4227d96532f24d7d20f215e2c488ec6 (diff)
downloadChibiOS-e3c7dc319ff582f9eb4a593950ac7bedb1d38b77.tar.gz
ChibiOS-e3c7dc319ff582f9eb4a593950ac7bedb1d38b77.tar.bz2
ChibiOS-e3c7dc319ff582f9eb4a593950ac7bedb1d38b77.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1571 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/mmc_spi.c')
-rw-r--r--os/hal/src/mmc_spi.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c
index f9f8eef5a..c1cb313ec 100644
--- a/os/hal/src/mmc_spi.c
+++ b/os/hal/src/mmc_spi.c
@@ -18,8 +18,9 @@
*/
/**
- * @file mmc_spi.c
- * @brief MMC over SPI driver code.
+ * @file mmc_spi.c
+ * @brief MMC over SPI driver code.
+ *
* @addtogroup MMC_SPI
* @{
*/
@@ -41,6 +42,11 @@
/* Driver local functions. */
/*===========================================================================*/
+/**
+ * @brief Inserion monitor timer callback function.
+ *
+ * @param[in] p pointer to the @p MMCDriver object
+ */
void tmrfunc(void *p) {
MMCDriver *mmcp = p;
@@ -65,7 +71,7 @@ void tmrfunc(void *p) {
}
/**
- * @brief Waits an idle condition.
+ * @brief Waits an idle condition.
*
* @param[in] mmcp pointer to the @p MMCDriver object
*/
@@ -91,7 +97,7 @@ static void wait(MMCDriver *mmcp) {
}
/**
- * @brief Sends a command header.
+ * @brief Sends a command header.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param cmd[in] the command id
@@ -113,11 +119,10 @@ static void send_hdr(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) {
}
/**
- * @brief Receives a single byte response.
+ * @brief Receives a single byte response.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- *
- * @return The response as an @p uint8_t value.
+ * @return The response as an @p uint8_t value.
* @retval 0xFF timed out.
*/
static uint8_t recvr1(MMCDriver *mmcp) {
@@ -133,13 +138,12 @@ static uint8_t recvr1(MMCDriver *mmcp) {
}
/**
- * @brief Sends a command an returns a single byte response.
+ * @brief Sends a command an returns a single byte response.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param cmd[in] the command id
* @param arg[in] the command argument
- *
- * @return The response as an @p uint8_t value.
+ * @return The response as an @p uint8_t value.
* @retval 0xFF timed out.
*/
static uint8_t send_command(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) {
@@ -153,7 +157,7 @@ static uint8_t send_command(MMCDriver *mmcp, uint8_t cmd, uint32_t arg) {
}
/**
- * @brief Waits that the card reaches an idle state.
+ * @brief Waits that the card reaches an idle state.
*
* @param[in] mmcp pointer to the @p MMCDriver object
*/
@@ -177,14 +181,14 @@ static void sync(MMCDriver *mmcp) {
/*===========================================================================*/
/**
- * @brief MMC over SPI driver initialization.
+ * @brief MMC over SPI driver initialization.
*/
void mmcInit(void) {
}
/**
- * @brief Initializes an instance.
+ * @brief Initializes an instance.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param[in] spip pointer to the SPI driver to be used as interface
@@ -211,7 +215,7 @@ void mmcObjectInit(MMCDriver *mmcp, SPIDriver *spip,
}
/**
- * @brief Configures and activates the MMC peripheral.
+ * @brief Configures and activates the MMC peripheral.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param[in] config pointer to the @p MMCConfig object
@@ -230,7 +234,7 @@ void mmcStart(MMCDriver *mmcp, const MMCConfig *config) {
}
/**
- * @brief Disables the MMC peripheral.
+ * @brief Disables the MMC peripheral.
*
* @param[in] mmcp pointer to the @p MMCDriver object
*/
@@ -253,16 +257,15 @@ void mmcStop(MMCDriver *mmcp) {
}
/**
- * @brief Performs the initialization procedure on the inserted card.
+ * @brief Performs the initialization procedure on the inserted card.
* @details This function should be invoked when a card is inserted and
* brings the driver in the @p MMC_READY state where it is possible
* to perform read and write operations.
- * @note It is possible to invoke this function from the insertion event
- * handler.
+ * @note It is possible to invoke this function from the insertion event
+ * handler.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- *
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful and the driver is now
* in the @p MMC_READY state.
* @retval TRUE the operation failed.
@@ -331,10 +334,10 @@ bool_t mmcConnect(MMCDriver *mmcp) {
}
/**
- * @brief Brings the driver in a state safe for card removal.
+ * @brief Brings the driver in a state safe for card removal.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful and the driver is now
* in the @p MMC_INSERTED state.
* @retval TRUE the operation failed.
@@ -363,12 +366,11 @@ bool_t mmcDisconnect(MMCDriver *mmcp) {
}
/**
- * @brief Starts a sequential read.
+ * @brief Starts a sequential read.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- * @param[in] startblk first block to read
- *
- * @return The operation status.
+ * @param[in] startblk first block to read
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/
@@ -398,12 +400,11 @@ bool_t mmcStartSequentialRead(MMCDriver *mmcp, uint32_t startblk) {
}
/**
- * @brief Reads a block within a sequential read operation.
+ * @brief Reads a block within a sequential read operation.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- * @param[out] buffer pointer to the read buffer
- *
- * @return The operation status.
+ * @param[out] buffer pointer to the read buffer
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/
@@ -438,11 +439,10 @@ bool_t mmcSequentialRead(MMCDriver *mmcp, uint8_t *buffer) {
}
/**
- * @brief Stops a sequential read gracefully.
+ * @brief Stops a sequential read gracefully.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- *
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/
@@ -471,12 +471,11 @@ bool_t mmcStopSequentialRead(MMCDriver *mmcp) {
}
/**
- * @brief Starts a sequential write.
+ * @brief Starts a sequential write.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param[in] startblk first block to write
- *
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/
@@ -506,12 +505,11 @@ bool_t mmcStartSequentialWrite(MMCDriver *mmcp, uint32_t startblk) {
}
/**
- * @brief Writes a block within a sequential write operation.
+ * @brief Writes a block within a sequential write operation.
*
* @param[in] mmcp pointer to the @p MMCDriver object
* @param[out] buffer pointer to the write buffer
- *
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/
@@ -545,11 +543,10 @@ bool_t mmcSequentialWrite(MMCDriver *mmcp, const uint8_t *buffer) {
}
/**
- * @brief Stops a sequential write gracefully.
+ * @brief Stops a sequential write gracefully.
*
* @param[in] mmcp pointer to the @p MMCDriver object
- *
- * @return The operation status.
+ * @return The operation status.
* @retval FALSE the operation was successful.
* @retval TRUE the operation failed.
*/