aboutsummaryrefslogtreecommitdiffstats
path: root/os/io
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-09 20:47:08 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-09 20:47:08 +0000
commit727ba84c9b99c7a1e06bf344b58c55f24472e5ba (patch)
tree8d8707351f233c0b7bb668dacd69e92b9bd7418a /os/io
parent85cf8d37b5923dfa3e324c0e13e5e4d6efb884df (diff)
downloadChibiOS-727ba84c9b99c7a1e06bf344b58c55f24472e5ba.tar.gz
ChibiOS-727ba84c9b99c7a1e06bf344b58c55f24472e5ba.tar.bz2
ChibiOS-727ba84c9b99c7a1e06bf344b58c55f24472e5ba.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1278 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io')
-rw-r--r--os/io/io.dox2
-rw-r--r--os/io/mmc_spi.c9
-rw-r--r--os/io/spi.c6
3 files changed, 14 insertions, 3 deletions
diff --git a/os/io/io.dox b/os/io/io.dox
index 402c2e4ad..fa6a4e989 100644
--- a/os/io/io.dox
+++ b/os/io/io.dox
@@ -156,7 +156,9 @@
ready -> stop [label="spiStop()"];
stop -> stop [label="spiStop()"];
ready -> active [label="spiSelect()"];
+ active -> active [label="spiSelect()"];
active -> ready [label="spiUnselect()"];
+ ready -> ready [label="spiUnselect()"];
active -> active [label="spiExchange()\nspiSend()\nspiReceive()"];
}
* @enddot
diff --git a/os/io/mmc_spi.c b/os/io/mmc_spi.c
index 20d7162ec..009085ec8 100644
--- a/os/io/mmc_spi.c
+++ b/os/io/mmc_spi.c
@@ -184,7 +184,14 @@ void mmcInit(void) {
/**
* @brief Initializes an instance.
*
- * @param[in] mmcp pointer to the @p MMCDriver object
+ * @param[in] mmcp pointer to the @p MMCDriver object
+ * @param[in] spip pointer to the SPI driver to be used as interface
+ * @param[in] lscfg low speed configuration for the SPI driver
+ * @param[in] hscfg high speed configuration for the SPI driver
+ * @param[in] is_protected function that returns the card write protection
+ * setting
+ * @param[in] is_inserted function that returns the card insertion sensor
+ * status
*/
void mmcObjectInit(MMCDriver *mmcp, SPIDriver *spip,
const SPIConfig *lscfg, const SPIConfig *hscfg,
diff --git a/os/io/spi.c b/os/io/spi.c
index 11247f24a..5ece51b77 100644
--- a/os/io/spi.c
+++ b/os/io/spi.c
@@ -99,7 +99,8 @@ void spiSelect(SPIDriver *spip) {
chDbgCheck(spip != NULL, "spiSelect");
chSysLock();
- chDbgAssert(spip->spd_state == SPI_READY,
+ chDbgAssert((spip->spd_state == SPI_READY) ||
+ (spip->spd_state == SPI_ACTIVE),
"spiSelect(), #1",
"not idle");
spi_lld_select(spip);
@@ -118,7 +119,8 @@ void spiUnselect(SPIDriver *spip) {
chDbgCheck(spip != NULL, "spiUnselect");
chSysLock();
- chDbgAssert(spip->spd_state == SPI_ACTIVE,
+ chDbgAssert((spip->spd_state == SPI_READY) ||
+ (spip->spd_state == SPI_ACTIVE),
"spiUnselect(), #1",
"not locked");
spi_lld_unselect(spip);