Optimizing Power of sd card problem

Hi,

  In my project, I use SPIM4 to access sd card . It is worked well.    Then ,I optimizing power of sd card. The power of my sd card is controlled by LDO.The LDO is enabled by P0.12.

 When P0.12  output high level, LDO is enable.So SD card get the 3.3V power. After this step, I mount the SD card successfull. 

 Until now , there is no problem. But when  I set P0.12 to low level after unmount sd card, the sd card power pin still have 2.7 voltage.After debugging ,I found the reason is that sd card fetch the power source mosi and cs pin.But no matter how i set the GPIO register of MOSI and CS,  it  still can't solve. Then I tried to disable the SPIM4, the problem is solved.

So, I need to disable SDMMC driver when I goto sleep,enable SDMMC driver when i need use it. Therefore, my question : How to turn off the SPIM4 after unmount the sd card in zephyr? I use the nrf connect sdk.

Parents Reply Children
Related