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/15 06:19:20 UTC

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

raiden00pl commented on pull request #1788:
URL: https://github.com/apache/incubator-nuttx/pull/1788#issuecomment-692492026


   This seems to be a problem with the SPI itself, not the GPIO. 
   We should add a configuration option to select SPIM in half-duplex mode.
   Add `bool halfduplex;` field to the 'struct nrf52_spidev_s' and set it up according to the configuration
   
   ```
   #if defined(CONFIG_NRF52_SPIM0_HALFDUPLEX) || defined(CONFIG_NRF52_SPIM1_HALFDUPLEX) || ...
   #  define NRF52_SPIM_HAVE_HALFDUPLEX 1
   #endif
   
   
   struct nrf52_spidev_s
   {
   ...
   
   #ifdef NRF52_SPIM_HAVE_HALFDUPLEX
     bool halfduplex;
   #endif
   };
   
   
   static struct nrf52_spidev_s g_spi0dev =
   {
      ...
   
   #ifdef CONFIG_NRF52_SPIM0_HALFDUPLEX
     .halfduplex = true,
   #endif
   }
   
   static int nrf52_spi_init(FAR struct nrf52_spidev_s *priv)
   {
      ...
   
     if (priv->halfduplex == false)
       {
         /* Select MISO pins */
   
         ...
       }
   }
   
   ```
   
   
   


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