paolovolpi opened a new issue, #16610:
URL: https://github.com/apache/nuttx/issues/16610

   ### Is your feature request related to a problem? Please describe.
   
   As done by Pico Sdk would be better to unset SSPCR1.SSE bit  before to 
modify Spi parameters (Mode, Frequency and Bits).
   
   
https://github.com/raspberrypi/pico-sdk/blob/ee68c78d0afae2b69c03ae1a72bf5cc267a2d94c/src/rp2_common/hardware_spi/spi.c#L47
   
   ### Describe the solution you'd like
   
   In functions spi_setfrequency, spi_setmode, spi_setbits before to call 
spi_putreg on  SSPCR0 SSPCR1 registries disable the PrimeCell SSP peripheral:
   ```
   regval = spi_getreg(priv, RP23XX_SPI_SSPCR1_OFFSET);
   regval &= ~RP23XX_SPI_SSPCR1_SSE;
   spi_putreg(priv, RP23XX_SPI_SSPCR1_OFFSET, regval);
   ```
   After the SSPCR0 SSPCR1 registries modification, re-enable  the PrimeCell 
SSP peripheral:
   ```
   regval = spi_getreg(priv, RP23XX_SPI_SSPCR1_OFFSET);
   regval |= RP23XX_SPI_SSPCR1_SSE;
   spi_putreg(priv, RP23XX_SPI_SSPCR1_OFFSET, regval);
   ```
   
   
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Verification
   
   - [x] I have verified before submitting the report.


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

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org.apache.org

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

Reply via email to