This is related to the customized SPI driver developed by NXP for Veoneer. We are looking for a possible optimization idea and we would like to consult with you to confirm whether you would agree to this concept.
In the routine Spi_HwTransfer, a while loop is executed for every channel of the requested sequence. Per our understanding, the process that takes place within this loop is not something that needs to be achieved every time a sequence is requested. We believe this process can be achieved one time within the context of the Spi_Init for all the sequences and their associated channels. If we can put this logic in the Spi_Init instead of the Spi_HwTransfer, this could be a significant chronometrics optimization as this operation is done 12 times every 1ms. Potentially could be a total saving of ~4%.
Can you please let us know if moving this while loop to Spi_Init would suffice the functional need for SPI to operate correctly.
A snippet of the while loop is attached to this question as well