<?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 can I disable a device in order to achieve lower power consumption on nrf9160?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52966/how-can-i-disable-a-device-in-order-to-achieve-lower-power-consumption-on-nrf9160</link><description>Dear All, 
 
 I am trying to minimize the current consumption of my device. I am using several peripherals, such as UART, I2C and ADC. 
 
 When I run a very simple sample that will just configure the modem, I am reading about 6uA on the device. But when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Oct 2019 08:53:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52966/how-can-i-disable-a-device-in-order-to-achieve-lower-power-consumption-on-nrf9160" /><item><title>RE: How can I disable a device in order to achieve lower power consumption on nrf9160?</title><link>https://devzone.nordicsemi.com/thread/214298?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 08:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0618b59-0889-4f2e-9b5b-2ce84faf0ba4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="80274" url="~/f/nordic-q-a/52966/how-can-i-disable-a-device-in-order-to-achieve-lower-power-consumption-on-nrf9160"]I am using several peripherals, such as UART, I2C and ADC.[/quote]
&lt;p&gt;UART and I2C should have the power managment hooks in place. See &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/master/drivers/serial/uart_nrfx_uarte.c#L1268"&gt;this &lt;/a&gt;and this &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/master/drivers/i2c/i2c_nrfx_twim.c#L165"&gt;link&lt;/a&gt;. Seems like it&amp;#39;s not yet implemented for the ADC driver.&lt;/p&gt;
&lt;p&gt;When you are done using the &lt;span&gt;peripheral, you could t&lt;/span&gt;hen you could call&amp;nbsp;&lt;span&gt;device_set_power_state(), snippet:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct device *peripheral_dev;

static void peripheral_disable(void)
{

#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
	int err = device_set_power_state(peripheral_dev,
					 DEVICE_PM_OFF_STATE,
					 NULL, NULL);
	if (err) {
		LOG_ERR(&amp;quot;peripheral disable failed&amp;quot;);
	}
#endif
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Alternatively, you might be able to call the nrfx uninit function for the peripheral directly.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>