diff options
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 |