This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

spi master reconfigure

Hi

i have an application where 3 SPI devices are connected. Each of the devices have a different CPHA/CPOL configuration. This means that, in order to make this work properly, I need to reconfigure the SPI configuration between the different peripherals. Also, i need to tell the spi master instance to use a different chip select pin.

Now: what is the most lightweight way of doing this? Should I implement a function myself in which I reconfigure 1 particular register? Can that register (Config) be changed on the fly or should I disable/enable the interface module before/after altering the register? Or should I just use spi_master_close/open, and if so, what are the side effects on the bus that I should take into account?

Parents Reply
  • Most likely the hack suggested by wizath will work, in that case you directly access the peripheral and can change the SPI configuration on the fly between SPI transactions. There is no need to disable or re-enable the driver in such case. The alternative is to disable and re-enable with new setting between transactions that require change in configuration.

Children
No Data
Related