<?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>Zephyr INA219 driver not transmitting any I2C</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95749/zephyr-ina219-driver-not-transmitting-any-i2c</link><description>Hi, 
 I am going through various sensors on my custom board and integrating them one by one. I&amp;#39;ve got &amp;quot;i2c0&amp;quot; peripheral setup and can talk with BME680, LIS2DS12 no problem. I am having some issues with LIS2DS12 but I am not troubleshooting it yet. 
 What</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Jan 2023 08:19:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95749/zephyr-ina219-driver-not-transmitting-any-i2c" /><item><title>RE: Zephyr INA219 driver not transmitting any I2C</title><link>https://devzone.nordicsemi.com/thread/405163?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 08:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5899279a-e4c4-4a79-80a3-710b9fd9f0a8</guid><dc:creator>robtic</dc:creator><description>&lt;p&gt;Marshall,&lt;/p&gt;
&lt;p&gt;Oh what a blunder, not sure how I&amp;#39;ve missed that. Thank you for the highlight.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr INA219 driver not transmitting any I2C</title><link>https://devzone.nordicsemi.com/thread/405136?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 01:04:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8006364-9868-49f2-93d8-7d8b2b320210</guid><dc:creator>Marshall</dc:creator><description>&lt;p&gt;Looks like you haven&amp;#39;t fetched the data first.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void initINA219(void){

	const struct device *const ina = DEVICE_DT_GET_ONE(ti_ina219);
	struct sensor_value v_bus, power, current;
	int rc;

	if (!device_is_ready(ina)) {
		LOG_ERR(&amp;quot;INA219  %s is not ready.&amp;quot;, ina-&amp;gt;name);
		return;
	}

//	while (true) {
		rc = sensor_sample_fetch(ina);      &amp;lt;---------------- HERE 
		if (rc) {
			LOG_ERR(&amp;quot;INA219 Could not fetch sensor data.&amp;quot;);
			return;
		}

		sensor_channel_get(ina, SENSOR_CHAN_VOLTAGE, &amp;amp;v_bus);
		sensor_channel_get(ina, SENSOR_CHAN_POWER, &amp;amp;power);
		sensor_channel_get(ina, SENSOR_CHAN_CURRENT, &amp;amp;current);

		LOG_INF(&amp;quot;INA219 Bus: %f [V] -- &amp;quot;
			&amp;quot;Power: %f [W] -- &amp;quot;
			&amp;quot;Current: %f [A]&amp;quot;,
		       sensor_value_to_double(&amp;amp;v_bus),
		       sensor_value_to_double(&amp;amp;power),
		       sensor_value_to_double(&amp;amp;current));
//		k_sleep(K_MSEC(2000));
//	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Mashall&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>