<?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>C advice with app_twi peripheral configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10958/c-advice-with-app_twi-peripheral-configuration</link><description>I&amp;#39;ve been trying to wrap my head around the app_twi library by looking at the examples, and I&amp;#39;m slowly getting there.
However, for my application I need to send multiple default configuration commands to my accelerometer. 
 So I was wondering, what</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Dec 2015 15:54:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10958/c-advice-with-app_twi-peripheral-configuration" /><item><title>RE: C advice with app_twi peripheral configuration</title><link>https://devzone.nordicsemi.com/thread/40989?ContentTypeID=1</link><pubDate>Tue, 22 Dec 2015 15:54:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7b91fe3-490c-40bd-965f-8ea252fb363a</guid><dc:creator>Sensors</dc:creator><description>&lt;p&gt;I was sort of looking for a way to expand the configuration array neatly, I think I found a way that works okay by using a 3d array:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void LSM303_config(app_twi_t *m_app_twi)
{
	// Default configuration array
	uint8_t default_config[][2] = {
		{LSM303_ACC_CTRL_REG1_A, ODR_10Hz | Acc_X_EN | Acc_Y_EN | Acc_Z_EN},
		{LSM303_ACC_CTRL_REG2_A, 0x00}
	};

	// Queue transfers
	app_twi_transfer_t const lsm303_cfg_transfers[2] = {
		APP_TWI_WRITE(LSM303_ADDRESS_ACCEL, default_config[0], 2, 0),
		APP_TWI_WRITE(LSM303_ADDRESS_ACCEL, default_config[1], 2, 0)
	};
	
	APP_ERROR_CHECK( app_twi_perform(m_app_twi, lsm303_cfg_transfers, 2, NULL) );
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C advice with app_twi peripheral configuration</title><link>https://devzone.nordicsemi.com/thread/40990?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2015 15:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9a8a1bb-0d01-4da8-9598-8b521c23e78c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I don&amp;#39;t know of any neater way, it seems you have found the TWI Transaction Manager Example, I would follow the implementation used there.&lt;/p&gt;
&lt;p&gt;For how to send multiple commands you can have a look at the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_app_twi.html?cp=4_0_0_3_27"&gt;TWI transaction manager library documentation&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>