Hi Louie:
A single callback function for CS handling may be registered per SPI device. The callback function registration is performed by the IO_IOCTL_SPI_SET_CS_CALLBACK_IOCTL command. The parameter of the command is SPI_CS_CALLBACK_STRUCT which contains a pointer to the callback function and a pointer to the arbitrary context data for the callback function.
SPI driver then calls the function any time when a change of the CS signals state is necessary. Besides the context data, the function is also passed a desired state of the CS signals. The callback function is then responsible for changing the state of the CS by any method (e.g., using LWGPIO)
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct or helpful button. Thank you!
-----------------------------------------------------------------------------------------------------------------------