switch case statement within SPI interface
Hello Everyone,
I am using stm32f405VGTx mcu for my project. I connected an another MCU (as master) which talks with my stm32f405 mcu over SPI. With my 405 I have connected the external ADC(PCM 1808) and accelerometer over I2S and SPI respectively. Now I want to write a routine in my slave 405 mcu - like a switch case statement on spi so that when the master MCU gives command whether to get ADC value or accelerometer value or FFT value from my 405 mcu. But I am very confused how can I incorporate case statement in SPI routine.
Does anyone code before in this situation, a basic help will be appreciated.
Thank you.