diff options
-rw-r--r-- | nuttx/configs/arduino-due/README.txt | 46 | ||||
-rw-r--r-- | nuttx/configs/arduino-due/src/arduino-due.h | 8 | ||||
-rwxr-xr-x | nuttx/drivers/spi/spi_bitbang.c | 3 |
3 files changed, 34 insertions, 23 deletions
diff --git a/nuttx/configs/arduino-due/README.txt b/nuttx/configs/arduino-due/README.txt index 5cb30b6e2..976322e43 100644 --- a/nuttx/configs/arduino-due/README.txt +++ b/nuttx/configs/arduino-due/README.txt @@ -122,6 +122,11 @@ ITEAD 2.4" TFT with Touch The Arduino 2.4" TFT Touch shield uses the S6D1121 controller , it supports 8-bit data interface. The touch IC is XPT2046. + NOTE: When used with the ITEAD shield, the power from the USB connector + seems to be inefficient (for example, I lose the USB connection when I + insert an SD card). I recommends using a 7-12V power supply with the + Arduino in this case. + Connector: ---------- --------------------------- ----------- --------------------------- ------------------ @@ -863,25 +868,28 @@ Configurations reconfiguration process. 2. Unless stated otherwise, all configurations generate console - output on UART1 which is available on J1 or J4 (see the - section "Serial Consoles" above). USART1 or the virtual COM - port on UART0 are options. The virtual COM port could - be used, for example, by reconfiguring to use UART0 like: - - System Type -> AT91SAM3/4 Peripheral Support - CONFIG_SAM_UART0=y - CONFIG_SAM_UART1=n - - Device Drivers -> Serial Driver Support -> Serial Console - CONFIG_UART0_SERIAL_CONSOLE=y - - Device Drivers -> Serial Driver Support -> UART0 Configuration - CONFIG_UART0_2STOP=0 - CONFIG_UART0_BAUD=115200 - CONFIG_UART0_BITS=8 - CONFIG_UART0_PARITY=0 - CONFIG_UART0_RXBUFSIZE=256 - CONFIG_UART0_TXBUFSIZE=256 + output on UART0 which is available both on the USB virtual COM port + and on the PWML connector (see the section "Serial Consoles" above). + + However, the pin usage by the ITEAD TFT shield conflict with the pin + usage for UART0. In this case you need to switch to USART0 by + modifying the configuration as follows: + + Board Selection -> Peripheral + CONFIG_SAM34_UART0=n : Disable UART0. Can't use with this shield + CONFIG_SAM34_USART0=y : Enable USART0 + CONFIG_USART0_ISUART=y + + Device Drivers -> Serial + CONFIG_USART0_SERIAL_CONSOLE=y : Configure the console on USART0 + CONFIG_USART0_RXBUFSIZE=256 + CONFIG_USART0_TXBUFSIZE=256 + CONFIG_USART0_BAUD=115200 + CONFIG_USART0_BITS=8 + CONFIG_USART0_PARITY=0 + CONFIG_USART0_2STOP=0 + + NOTE: USART0 TTL levels are available on COMM 5 (TXD0) and COMM 6 (RXD0). 3. Unless otherwise stated, the configurations are setup for Linux (or any other POSIX environment like Cygwin under Windows): diff --git a/nuttx/configs/arduino-due/src/arduino-due.h b/nuttx/configs/arduino-due/src/arduino-due.h index ae5198a13..0679f6ea4 100644 --- a/nuttx/configs/arduino-due/src/arduino-due.h +++ b/nuttx/configs/arduino-due/src/arduino-due.h @@ -205,8 +205,8 @@ # define GPIO_SD_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ GPIO_PORT_PIOB | GPIO_PIN27) -# define GPIO_SD_MISO (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ - GPIO_PORT_PIOD | GPIO_PIN8) +# define GPIO_SD_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOD | \ + GPIO_PIN8) # define GPIO_SD_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ GPIO_PORT_PIOD | GPIO_PIN7) @@ -241,8 +241,8 @@ # define GPIO_TSC_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ GPIO_PORT_PIOA | GPIO_PIN24) -# define GPIO_TSC_MISO (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ - GPIO_PORT_PIOC | GPIO_PIN22) +# define GPIO_TSC_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOC | \ + GPIO_PIN22) # define GPIO_TSC_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \ GPIO_PORT_PIOA | GPIO_PIN16) diff --git a/nuttx/drivers/spi/spi_bitbang.c b/nuttx/drivers/spi/spi_bitbang.c index 42d1fc530..b720266ee 100755 --- a/nuttx/drivers/spi/spi_bitbang.c +++ b/nuttx/drivers/spi/spi_bitbang.c @@ -238,6 +238,8 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { FAR struct spi_bitbang_s *priv = (FAR struct spi_bitbang_s *)dev; + + spivdbg("devid=%d selected=%d\n", devid, selected); DEBUGASSERT(priv && priv->low->select); priv->low->select(priv, devid, selected); } @@ -287,6 +289,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) { FAR struct spi_bitbang_s *priv = (FAR struct spi_bitbang_s *)dev; + DEBUGASSERT(priv && priv->low->setmode); priv->low->setmode(priv, mode); spivdbg("mode=%d exchange=%p\n", mode, priv->exchange); |