<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LPC82X to be a slave device in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578912#M19911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shujun,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; It is the LPC82X I2C feature, this I2C module can support multiple I2C slave addresses.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can find more details from the L&lt;A href="http://www.nxp.com/documents/user_manual/UM10800.pdf?fasp=1&amp;amp;WT_TYPE=Users%20Guides&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf"&gt;PC82X user manual&lt;/A&gt;​, page 227.&lt;/P&gt;&lt;P&gt;&amp;nbsp; It can support 4 slave addresses, if you just want to use one slave address, you can just configure one.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The slvNum is define the salve address number in the following API.&lt;/P&gt;&lt;P&gt;/**&lt;/P&gt;&lt;P&gt;* @brief&amp;nbsp;&amp;nbsp;&amp;nbsp; Set a I2C slave address for slave operation&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; pI2C&amp;nbsp;&amp;nbsp;&amp;nbsp; : Pointer to selected I2C peripheral&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;slvNum&amp;nbsp;&amp;nbsp;&amp;nbsp; : Possible slave address number, between 0 - 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; slvAddr&amp;nbsp;&amp;nbsp;&amp;nbsp; : Slave Address for the index (7-bits, bit 7 = 0)&lt;/P&gt;&lt;P&gt;* @return&amp;nbsp;&amp;nbsp;&amp;nbsp; Nothing&lt;/P&gt;&lt;P&gt;* @note&amp;nbsp;&amp;nbsp;&amp;nbsp; Setting a slave address also enables the slave address. Do&lt;/P&gt;&lt;P&gt;* not 'pre-shift' the slave address.&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_I2CS_SetSlaveAddr(LPC_I2C_T *pI2C, uint8_t slvNum, uint8_t slvAddr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pI2C-&amp;gt;SLVADR[slvNum] = (uint32_t) (slvAddr &amp;lt;&amp;lt; 1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Aug 2016 06:27:36 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2016-08-09T06:27:36Z</dc:date>
    <item>
      <title>LPC82X to be a slave device</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578911#M19910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I want to make LPC82X to be a slave device.But when I study the the sample code I download,I Can't unstand the API function "Chip_I2CS_SetSlaveAddr".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The following is sample code: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;static void setupI2CSlave(void)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Some common I2C init was performed in setupI2CMaster(), so it doesn't need to be done again for the slave setup. */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Emulated EEPROM 0 is on slave index 0 */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: #e23d39;"&gt;&lt;EM&gt;&amp;nbsp; &lt;STRONG&gt;Chip_I2CS_SetSlaveAddr(LPC_I2C_PORT, 0, EEPROM0SLVADD);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Disable Qualifier for Slave Address 0 */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2CS_SetSlaveQual0(LPC_I2C_PORT, false, 0);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Enable Slave Address 0 */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2CS_EnableSlaveAddr(LPC_I2C_PORT, 0);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Emulated EEPROM 1 is on slave index 1 */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2CS_SetSlaveAddr(LPC_I2C_PORT, 1, EEPROM1SLVADD);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Enable Slave Address 1 */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;Chip_I2CS_EnableSlaveAddr(LPC_I2C_PORT, 1);&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Clear interrupt status and enable slave interrupts */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2CS_ClearStatus(LPC_I2C_PORT, I2C_STAT_SLVDESEL);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2C_EnableInt(LPC_I2C_PORT, I2C_INTENSET_SLVPENDING | I2C_INTENSET_SLVDESEL);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; /* Enable I2C slave interface */&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; Chip_I2CS_Enable(LPC_I2C_PORT);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;My confusion is that one I2C port can be used as two slave devices?Just only set two different slave addresses?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338058"&gt;periph_i2cs_interrupt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 03:02:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578911#M19910</guid>
      <dc:creator>shujunding</dc:creator>
      <dc:date>2016-08-08T03:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC82X to be a slave device</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578912#M19911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shujun,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; It is the LPC82X I2C feature, this I2C module can support multiple I2C slave addresses.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can find more details from the L&lt;A href="http://www.nxp.com/documents/user_manual/UM10800.pdf?fasp=1&amp;amp;WT_TYPE=Users%20Guides&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;fileExt=.pdf"&gt;PC82X user manual&lt;/A&gt;​, page 227.&lt;/P&gt;&lt;P&gt;&amp;nbsp; It can support 4 slave addresses, if you just want to use one slave address, you can just configure one.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The slvNum is define the salve address number in the following API.&lt;/P&gt;&lt;P&gt;/**&lt;/P&gt;&lt;P&gt;* @brief&amp;nbsp;&amp;nbsp;&amp;nbsp; Set a I2C slave address for slave operation&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; pI2C&amp;nbsp;&amp;nbsp;&amp;nbsp; : Pointer to selected I2C peripheral&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;slvNum&amp;nbsp;&amp;nbsp;&amp;nbsp; : Possible slave address number, between 0 - 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* @param&amp;nbsp;&amp;nbsp;&amp;nbsp; slvAddr&amp;nbsp;&amp;nbsp;&amp;nbsp; : Slave Address for the index (7-bits, bit 7 = 0)&lt;/P&gt;&lt;P&gt;* @return&amp;nbsp;&amp;nbsp;&amp;nbsp; Nothing&lt;/P&gt;&lt;P&gt;* @note&amp;nbsp;&amp;nbsp;&amp;nbsp; Setting a slave address also enables the slave address. Do&lt;/P&gt;&lt;P&gt;* not 'pre-shift' the slave address.&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_I2CS_SetSlaveAddr(LPC_I2C_T *pI2C, uint8_t slvNum, uint8_t slvAddr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pI2C-&amp;gt;SLVADR[slvNum] = (uint32_t) (slvAddr &amp;lt;&amp;lt; 1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2016 06:27:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578912#M19911</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-08-09T06:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: LPC82X to be a slave device</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578913#M19912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have another question related to Chip_I2CS_SetSlaveAddr&lt;/P&gt;&lt;P&gt;Assuming SetSlaveAddr[0] is for the LPC82x, can SetSlaveAddr[1:3] be linked somehow to I2C2, I2C3 &amp;amp; I2C4 so that an I2C master can talk 'through' the LPC82x to I2C devices connected as slaves to the other 3 I2C ports?&lt;/P&gt;&lt;P&gt;Is that what pI2C is used for?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2018 20:43:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578913#M19912</guid>
      <dc:creator>sirdigbychicken</dc:creator>
      <dc:date>2018-05-24T20:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC82X to be a slave device</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578914#M19913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you have the question, please create the question post for your own question, please don't follow the old post which is closed.&lt;/P&gt;&lt;P&gt;&amp;nbsp; After you create the question post, we will help you in your own post.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks a lot for your understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2018 08:53:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC82X-to-be-a-slave-device/m-p/578914#M19913</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-05-29T08:53:30Z</dc:date>
    </item>
  </channel>
</rss>

