diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-08 14:42:18 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-08 14:42:18 +0000 |
commit | 1442e62637fa138626671be49b51d5329c6536c3 (patch) | |
tree | 37cca4e1b7020da95999bce0c162a6ba2069305c /nuttx/configs/stm32f3discovery/src/up_spi.c | |
parent | 0017d65ee25f15e67e5376ac59340e5835032867 (diff) | |
download | px4-nuttx-1442e62637fa138626671be49b51d5329c6536c3.tar.gz px4-nuttx-1442e62637fa138626671be49b51d5329c6536c3.tar.bz2 px4-nuttx-1442e62637fa138626671be49b51d5329c6536c3.zip |
More stm32f3discovery updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5624 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm32f3discovery/src/up_spi.c')
-rw-r--r-- | nuttx/configs/stm32f3discovery/src/up_spi.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/nuttx/configs/stm32f3discovery/src/up_spi.c b/nuttx/configs/stm32f3discovery/src/up_spi.c index ce14ea73a..c5eb9779e 100644 --- a/nuttx/configs/stm32f3discovery/src/up_spi.c +++ b/nuttx/configs/stm32f3discovery/src/up_spi.c @@ -96,16 +96,9 @@ void weak_function stm32_spiinitialize(void) { #ifdef CONFIG_STM32_SPI1 - (void)stm32_configgpio(GPIO_CS_MEMS); /* MEMS chip select */ -#endif -#if defined(CONFIG_LCD_UG2864AMBAG01) || defined(CONFIG_LCD_UG2864HSWEG01) - (void)stm32_configgpio(GPIO_OLED_CS); /* OLED chip select */ -# if defined(CONFIG_LCD_UG2864AMBAG01) - (void)stm32_configgpio(GPIO_OLED_A0); /* OLED Command/Data */ -# endif -# if defined(CONFIG_LCD_UG2864HSWEG01) - (void)stm32_configgpio(GPIO_OLED_DC); /* OLED Command/Data */ -# endif + (void)stm32_configgpio(GPIO_MEMS_CS); /* MEMS chip select */ + (void)stm32_configgpio(GPIO_MEMS_INT1); /* MEMS interrupts */ + (void)stm32_configgpio(GPIO_MEMS_INT2); #endif } @@ -139,16 +132,7 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool sele { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); -#if defined(CONFIG_LCD_UG2864AMBAG01) || defined(CONFIG_LCD_UG2864HSWEG01) - if (devid == SPIDEV_DISPLAY) - { - stm32_gpiowrite(GPIO_OLED_CS, !selected); - } - else -#endif - { - stm32_gpiowrite(GPIO_CS_MEMS, !selected); - } + stm32_gpiowrite(GPIO_MEMS_CS, !selected); } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) @@ -208,27 +192,6 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #ifdef CONFIG_STM32_SPI1 int stm32_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd) { -#if defined(CONFIG_LCD_UG2864AMBAG01) || defined(CONFIG_LCD_UG2864HSWEG01) - if (devid == SPIDEV_DISPLAY) - { - /* "This is the Data/Command control pad which determines whether the - * data bits are data or a command. - * - * A0 = "H": the inputs at D0 to D7 are treated as display data. - * A0 = "L": the inputs at D0 to D7 are transferred to the command - * registers." - */ - -# if defined(CONFIG_LCD_UG2864AMBAG01) - (void)stm32_gpiowrite(GPIO_OLED_A0, !cmd); -# endif -# if defined(CONFIG_LCD_UG2864HSWEG01) - (void)stm32_gpiowrite(GPIO_OLED_DC, !cmd); -# endif - return OK; - } -#endif - return -ENODEV; } #endif |