<?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>IO expander code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16093/io-expander-code</link><description>Dear Nordic Team, 
 Thanks for support. 
 I am using PCA10028 hardware, I want IO expander code for PCAL6408.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Aug 2016 11:55:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16093/io-expander-code" /><item><title>RE: IO expander code</title><link>https://devzone.nordicsemi.com/thread/61369?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 11:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d87068dc-3069-4bb5-9745-ac8c6322b7e0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That should be possible. Though I am not sure you gain much by adapting the code you refer to. It is anyway so few lines and a simple device, so I would think it was easier to implement something from scratch using our driver, perhaps looking at the file you refer to for inspiration (in addition to the datasheet).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: IO expander code</title><link>https://devzone.nordicsemi.com/thread/61368?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 11:28:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dce276f6-535a-4929-9558-57fcd491dc71</guid><dc:creator>Murugan</dc:creator><description>&lt;p&gt;Thanks for reply. I am going to use DS1307 RTC . I found one source file from internet. That file mainly contain 4 function.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;i2c_read();
2.i2c_write();
3.i2c_stop();
4.i2c_start();&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I want replace these function. It is possible using below function??
nrf_drv_twi_rx(),nrf_drv_twi_tx(),nrf_drv_twi_enable(),nrf_drv_twi_disable();&lt;/p&gt;
&lt;p&gt;Source file link:&lt;a href="http://picmania.garcia-cuervo.net/recursos/_ds1307.c"&gt;picmania.garcia-cuervo.net/.../_ds1307.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: IO expander code</title><link>https://devzone.nordicsemi.com/thread/61367?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 10:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e382327a-cb1f-4815-9538-e0d0e71be72b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;In order to read and write single bytes you specify a length of 1 in the calls to &lt;code&gt;nrf_drv_twi_rx()&lt;/code&gt; and &lt;code&gt;nrf_drv_twi_tx()&lt;/code&gt;. Refer to the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/group__nrf__drv__twi.html?cp=6_0_0_6_7_21_1_2"&gt;API documentation&lt;/a&gt; for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: IO expander code</title><link>https://devzone.nordicsemi.com/thread/61366?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 10:30:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8438ddd5-3684-4447-b2b6-9efa9927339c</guid><dc:creator>Murugan</dc:creator><description>&lt;p&gt;Thanks for answering. I want byte write and byte read function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: IO expander code</title><link>https://devzone.nordicsemi.com/thread/61365?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 08:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:097f04a8-0b75-4731-b575-ff433c30cdb9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;From looking at the PCAL6408A datasheet I see that it is controlled by I2C (TWI). We do not have any example of using that device specifically, but you can use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/hardware_driver_twi.html?cp=6_0_0_2_16"&gt;TWI master driver&lt;/a&gt;  to communicate with it. The &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/twi_sensor_example.html?cp=6_0_0_4_5_28"&gt;TWI Sensor Example&lt;/a&gt; has a practical example of using the driver. For the details of how to control the PCAL6408A, you have to refer to it&amp;#39;s &lt;a href="http://www.nxp.com/documents/data_sheet/PCAL6408A.pdf"&gt;datasheet&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>