You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/14 23:10:05 UTC

[GitHub] [incubator-nuttx] btashton commented on a change in pull request #1788: nRF: Allow configuration of non connected GPIO

btashton commented on a change in pull request #1788:
URL: https://github.com/apache/incubator-nuttx/pull/1788#discussion_r488287477



##########
File path: arch/arm/src/nrf52/nrf52_spi.c
##########
@@ -445,9 +456,13 @@ static int nrf52_spi_init(FAR struct nrf52_spidev_s *priv)
 
   pin   = GPIO_PIN_DECODE(priv->miso_pin);
   port  = GPIO_PORT_DECODE(priv->miso_pin);
+  regval = SPIM_PSELMISO_CONNECTED;  /* Disconnect */
+  if ((priv->miso_pin & GPIO_FUNC_MASK) != GPIO_DISABLED)
+    {
+      regval = (pin << SPIM_PSELMISO_PIN_SHIFT);
+      regval |= (port << SPIM_PSELMISO_PORT_SHIFT);
+    }

Review comment:
       You cannot do that and keep the same control function for all the drivers.  Here you just made the pin configuration tied to `BOARD_SPI1_*_PIN` for SPI{0,1,2,3}.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org