Hello Kan_Li,
Thank you for the reply.
I am transmitting around 30 bytes of data through MOSI.While transmitting i don't want the water level interrupt to be called.
I need the water level callback while i receive the data only.
In my case its hitting callback even when i am transmitting data.
say for Example i need to receive 6 bytes ,below is the way i am testing the receive part of SPIM.
can you just validate it whether i am doing it right or wrong?
Step1: phhalSPIM_Init(PH_EXHIF_HW_SPIM_TIMEOUT);
Step2: phhalSPIM_Configure(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_MSB_FIRST, \
E_SPIM_MODE1, 0, \
0, PH_EXHIF_HW_SPIM_NSSPOL);
Step3: phhalSPIM_SetWaterLevel(6, Water_level _callback); //6 Number of bytes i want to receive
Step4: Water_level _callback(){
phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE,PH_EXHIF_HW_SPIM_INIT_CRC,PH_EXHIF_HW_SPIM_CRC_INIT,6,rxspibuf,PH_EXHIF_HW_SPIM_CRC_OFFSET);
}
i am calling Receive function inside the water level callback function so that after i receive i can use the data for comparison and use in my application.
Is that the right way?
In function phhalSPIM_SetWaterLevel,How to differentiate between number of bytes of data need to be transmitted and received? Are there separate settings for that?
Regards,
Sanath Rai