<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to disable SPI to save power - nRF51822 on MBED</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35248/how-to-disable-spi-to-save-power---nrf51822-on-mbed</link><description>Hi, 
 I have a SPI sensor on an nRF51822, developed in mBED. To save battery power, I want to disable SPI while in ble.waitForEvent(). The only reference I could find is an nRF call: 
 NRF_SPI0-&amp;gt;ENABLE = 0 ; 
 When I do that, two things happen: 
 1) Sensor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jun 2018 14:22:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35248/how-to-disable-spi-to-save-power---nrf51822-on-mbed" /><item><title>RE: How to disable SPI to save power - nRF51822 on MBED</title><link>https://devzone.nordicsemi.com/thread/135617?ContentTypeID=1</link><pubDate>Mon, 11 Jun 2018 14:22:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a8e1ccf-23de-49c6-9751-d38b7b22e162</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Eric,&lt;/p&gt;
&lt;p&gt;I am not familiar with the mBed API, &lt;em&gt;and from my experience it does not support well for Low power.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It does not seem that there is any disable functions in the mBed SPI API, so maybe you could delete the SPI object to get the current down?&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c#L192" target="_blank" rel="noopener noreferrer"&gt;spi_free()&lt;/a&gt;&amp;nbsp;function that you could try, but I am not 100% sure how it&amp;#39;s called since I could not find it in the API documentation for mbed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="text-decoration:underline;"&gt;I have two recommendations for you:&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;- You could&amp;nbsp;use our &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v12.x.x/" target="_blank" rel="noopener noreferrer"&gt;SDK &lt;/a&gt;instead, and utilize the tips in&amp;nbsp;the thread &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/1657/how-to-minimize-current-consumption-for-ble-application-on-nrf51822" target="_blank" rel="noopener noreferrer"&gt;&amp;quot;How to minimize current consumption for BLE application on nRF51822&amp;quot;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;- Check out the &lt;a href="https://github.com/zephyrproject-rtos/zephyr" target="_blank" rel="noopener noreferrer"&gt;Zephyr project&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>