From 14c5c981145991a86366544bc11dbb9d410feecf Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Sep 2012 14:07:13 +0000 Subject: Misc STM32 wildfire and ENC28J60 driver updates git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5133 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/fire-stm32v2/src/fire-internal.h | 8 ++++++-- nuttx/configs/fire-stm32v2/src/up_spi.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'nuttx/configs/fire-stm32v2/src') diff --git a/nuttx/configs/fire-stm32v2/src/fire-internal.h b/nuttx/configs/fire-stm32v2/src/fire-internal.h index ee3c3486f..f51bd0ef9 100644 --- a/nuttx/configs/fire-stm32v2/src/fire-internal.h +++ b/nuttx/configs/fire-stm32v2/src/fire-internal.h @@ -192,7 +192,7 @@ */ #ifndef CONFIG_ENC28J60 -# define GPIO_ENC28J60_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ +# define GPIO_FLASH_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) #endif @@ -214,11 +214,15 @@ # warning "TFT LCD and ENCJ2860 shared PE1" #endif +/* CS and Reset are active low. Initial states are not selected and not in + * reset (driver does a soft reset). + */ + #ifdef CONFIG_ENC28J60 # define GPIO_ENC28J60_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) # define GPIO_ENC28J60_RESET (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN1) + GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN1) # define GPIO_ENC28J60_INTR (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|\ GPIO_EXTI|GPIO_PORTE|GPIO_PIN5) #endif diff --git a/nuttx/configs/fire-stm32v2/src/up_spi.c b/nuttx/configs/fire-stm32v2/src/up_spi.c index 329274b7f..b2ef301b6 100644 --- a/nuttx/configs/fire-stm32v2/src/up_spi.c +++ b/nuttx/configs/fire-stm32v2/src/up_spi.c @@ -163,11 +163,11 @@ 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 0 /* Need to study this */ - if (devid == SPIDEV_FLASH) + if (devid == SPIDEV_LCD) { /* Set the GPIO low to select and high to de-select */ - stm32_gpiowrite(GPIO_FLASH_CS, !selected); + stm32_gpiowrite(GPIO_LCD_CS, !selected); } else #endif -- cgit v1.2.3