summaryrefslogtreecommitdiff
path: root/nuttx/configs/mikroe-stm32f4/src/up_spi.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-21 13:13:05 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-21 13:13:05 -0600
commit801977de7c84d03616329795e1c59929ab948906 (patch)
treeb9d9220000c01cf9aca8e010f43fc488ccc26f26 /nuttx/configs/mikroe-stm32f4/src/up_spi.c
parent3895e0ec4c2c3057935bbeb7558fa4b815385334 (diff)
downloadpx4-nuttx-801977de7c84d03616329795e1c59929ab948906.tar.gz
px4-nuttx-801977de7c84d03616329795e1c59929ab948906.tar.bz2
px4-nuttx-801977de7c84d03616329795e1c59929ab948906.zip
Audio subystem update from Ken Pettit. Plus moved some header files
Diffstat (limited to 'nuttx/configs/mikroe-stm32f4/src/up_spi.c')
-rw-r--r--nuttx/configs/mikroe-stm32f4/src/up_spi.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/nuttx/configs/mikroe-stm32f4/src/up_spi.c b/nuttx/configs/mikroe-stm32f4/src/up_spi.c
index 08fa89a9c..448ed966a 100644
--- a/nuttx/configs/mikroe-stm32f4/src/up_spi.c
+++ b/nuttx/configs/mikroe-stm32f4/src/up_spi.c
@@ -114,8 +114,10 @@ void weak_function stm32_spiinitialize(void)
#endif
#ifdef CONFIG_AUDIO_MP3_CODEC
- (void)stm32_configgpio(GPIO_CS_MP3); /* MP3 codec chip select */
- stm32_gpiowrite(GPIO_CS_MP3, 1); /* Ensure the CS is inactive */
+ (void)stm32_configgpio(GPIO_CS_MP3_DATA); /* MP3 codec chip select for DATA */
+ (void)stm32_configgpio(GPIO_CS_MP3_CMD); /* MP3 codec chip select for CMD */
+ stm32_gpiowrite(GPIO_CS_MP3_DATA, 1); /* Ensure the CS is inactive */
+ stm32_gpiowrite(GPIO_CS_MP3_CMD, 1); /* Ensure the CS is inactive */
#endif
/* Configure the EXP I/O cs for SPI3 */
@@ -172,11 +174,16 @@ void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sele
#endif
#if defined(CONFIG_AUDIO_MP3_CODEC)
- if (devid == SPIDEV_AUDIO)
+ if (devid == SPIDEV_AUDIO_DATA)
{
- stm32_gpiowrite(GPIO_CS_MP3, !selected);
+ stm32_gpiowrite(GPIO_CS_MP3_DATA, !selected);
+ }
+ else if (devid == SPIDEV_AUDIO_CTRL)
+ {
+ stm32_gpiowrite(GPIO_CS_MP3_CMD, !selected);
}
else
+
#endif
/* Must be the expansion header device */