diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-08-19 16:51:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-08-19 16:51:04 +0000 |
commit | aae0c1e888d173b7a850a3e0023b8c352f657f62 (patch) | |
tree | 4e52eff7f4adf0570b819f68b3a4351987266ec8 /nuttx/drivers | |
parent | ba6253aecb0d018c0deb40b233d76cb2f9a67bb0 (diff) | |
download | px4-nuttx-aae0c1e888d173b7a850a3e0023b8c352f657f62.tar.gz px4-nuttx-aae0c1e888d173b7a850a3e0023b8c352f657f62.tar.bz2 px4-nuttx-aae0c1e888d173b7a850a3e0023b8c352f657f62.zip |
Add support for multiplexed SDIO pins from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3898 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r-- | nuttx/drivers/mmcsd/mmcsd_sdio.c | 32 | ||||
-rwxr-xr-x | nuttx/drivers/wireless/cc1101/cc1101.c | 39 |
2 files changed, 68 insertions, 3 deletions
diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c index 1434c440c..27232983e 100644 --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c @@ -148,7 +148,10 @@ struct mmcsd_state_s /* Misc Helpers *************************************************************/ static void mmcsd_takesem(FAR struct mmcsd_state_s *priv); -#define mmcsd_givesem(p) sem_post(&priv->sem); + +#ifndef CONFIG_SDIO_MUXBUS +# define mmcsd_givesem(p) sem_post(&priv->sem); +#endif /* Command/response helpers *************************************************/ @@ -261,18 +264,41 @@ static const struct block_operations g_bops = static void mmcsd_takesem(FAR struct mmcsd_state_s *priv) { - /* Take the semaphore (perhaps waiting) */ + /* Take the semaphore, giving exclusive access to the driver (perhaps + * waiting) + */ while (sem_wait(&priv->sem) != 0) { - /* The only case that an error should occr here is if the wait was + /* The only case that an error should occur here is if the wait was * awakened by a signal. */ ASSERT(errno == EINTR); } + + /* Lock the bus if mutually exclusive access to the SDIO bus is required + * on this platform. + */ + +#ifdef CONFIG_SDIO_MUXBUS + SDIO_LOCK(priv->dev, TRUE); +#endif } +#ifdef CONFIG_SDIO_MUXBUS +static void mmcsd_givesem(FAR struct mmcsd_state_s *priv) +{ + /* Release the SDIO bus lock, then the MMC/SD driver semaphore in the + * opposite order that they were taken to assure that no deadlock + * conditions will arise. + */ + + SDIO_LOCK(priv->dev, FALSE); + sem_post(&priv->sem); +} +#endif + /**************************************************************************** * Command/Response Helpers ****************************************************************************/ diff --git a/nuttx/drivers/wireless/cc1101/cc1101.c b/nuttx/drivers/wireless/cc1101/cc1101.c index e2fae9620..a35575690 100755 --- a/nuttx/drivers/wireless/cc1101/cc1101.c +++ b/nuttx/drivers/wireless/cc1101/cc1101.c @@ -55,6 +55,45 @@ * - Power up/down modes * - Sequencing between states or add protection for correct termination of * various different state (so that CC1101 does not block in case of improper use) + * + * \par RSSI and LQI value interpretation + * + * The LQI can be read from the LQI status register or it can be appended + * to the received packet in the RX FIFO. LQI is a metric of the current + * quality of the received signal. The LQI gives an estimate of how easily + * a received signal can be demodulated by accumulating the magnitude of + * the error between ideal constellations and the received signal over + * the 64 symbols immediately following the sync word. LQI is best used + * as a relative measurement of the link quality (a high value indicates + * a better link than what a low value does), since the value is dependent + * on the modulation format. + * + * To simplify: If the received modulation is FSK or GFSK, the receiver + * will measure the frequency of each "bit" and compare it with the + * expected frequency based on the channel frequency and the deviation + * and the measured frequency offset. If other modulations are used, the + * error of the modulated parameter (frequency for FSK/GFSK, phase for + * MSK, amplitude for ASK etc) will be measured against the expected + * ideal value + * + * RSSI (Received Signal Strength Indicator) is a signal strength + * indication. It does not care about the "quality" or "correctness" of + * the signal. LQI does not care about the actual signal strength, but + * the signal quality often is linked to signal strength. This is because + * a strong signal is likely to be less affected by noise and thus will + * be seen as "cleaner" or more "correct" by the receiver. + * + * There are four to five "extreme cases" that can be used to illustrate + * how RSSI and LQI work: + * 1. A weak signal in the presence of noise may give low RSSI and low LQI. + * 2. A weak signal in "total" absence of noise may give low RSSI and high LQI. + * 3. Strong noise (usually coming from an interferer) may give high RSSI and low LQI. + * 4. A strong signal without much noise may give high RSSI and high LQI. + * 5. A very strong signal that causes the receiver to saturate may give + * high RSSI and low LQI. + * + * Note that both RSSI and LQI are best used as relative measurements since + * the values are dependent on the modulation format. **/ #include <nuttx/config.h> |