<?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>S32KのトピックRe: s32k144 about i2c read/write api</title>
    <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676723#M24437</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i find this api can't used under freertos task,&lt;/P&gt;&lt;P&gt;when used without freertos it can get the slave i2c data.&lt;/P&gt;&lt;P&gt;even i use&amp;nbsp;LPI2C_DRV_MasterSendData still can't used with freertos&lt;/P&gt;&lt;P&gt;it will stock with&amp;nbsp;while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;can you help to check it how to used in freertos ?&lt;/P&gt;&lt;DIV&gt;int test_tmf882x_i2c_read(uint32_t slave_addr, uint8_t reg, uint8_t *buf, int len)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//return read_i2c_block(slave_addr, reg, buf, len);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; int ret1,ret2;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32_t bytesRemain = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret1 = LPI2C_DRV_MasterSendData(INST_LPI2C1, &amp;amp;reg, 1, false);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;// while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS &amp;amp;&amp;amp; bytesRemain != 0);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret2 = LPI2C_DRV_MasterReceiveData(INST_LPI2C1, buf, 1, true);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; //&amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS &amp;amp;&amp;amp; bytesRemain != 0);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; AMS_TOF_LOG("test_i2c000 tmf882x_i2c_read,fisrt ret1=%d,second ret2=%d,recv=%d\n",ret1,ret2,*buf);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return ret2;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 07:05:23 GMT</pubDate>
    <dc:creator>alice_th</dc:creator>
    <dc:date>2023-06-27T07:05:23Z</dc:date>
    <item>
      <title>s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1675876#M24377</link>
      <description>&lt;P&gt;does the i2c read/write function is correct below, because when read is always return 2, seems when write i2c is always busy, can you help to check whether&amp;nbsp;test_tmf882x_i2c_read is correct ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i2c_test11,TMF882X_STAT=0&lt;BR /&gt;tmf882x_i2c_write ret=0&lt;BR /&gt;tmf882x_i2c_read,fisrt ret1=0,second ret2=2,recv=0&lt;BR /&gt;i2c_test11,TMF882X_STAT=0&lt;BR /&gt;tmf882x_i2c_write ret=0&lt;BR /&gt;tmf882x_i2c_read,fisrt ret1=0,second ret2=2,recv=0&lt;BR /&gt;i2c_test11,TMF882X_STAT=0&lt;BR /&gt;tmf882x_i2c_write ret=0&lt;BR /&gt;tmf882x_i2c_read,fisrt ret1=0,second ret2=2,recv=0&lt;BR /&gt;i2c_test11,TMF882X_STAT=0&lt;BR /&gt;tmf882x_i2c_write ret=0&lt;BR /&gt;tmf882x_i2c_read,fisrt ret1=0,second ret2=2,recv=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void delay_test11(int count)&lt;BR /&gt;{&lt;BR /&gt;while(count--)&lt;BR /&gt;NOP();&lt;BR /&gt;}&lt;BR /&gt;int test_tmf882x_i2c_read(uint32_t slave_addr, uint8_t reg, uint8_t *buf, int len)&lt;BR /&gt;{&lt;BR /&gt;//return read_i2c_block(slave_addr, reg, buf, len);&lt;BR /&gt;int ret1,ret2;&lt;BR /&gt;ret1 = LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C1, reg, 1, false, I2C_TIME_OUT);&lt;BR /&gt;&lt;BR /&gt;ret2 = LPI2C_DRV_MasterReceiveDataBlocking(INST_LPI2C1, buf, len, true,I2C_TIME_OUT);&lt;BR /&gt;AMS_TOF_LOG("tmf882x_i2c_read,fisrt ret1=%d,second ret2=%d,recv=%d\n",ret1,ret2,*buf);&lt;BR /&gt;return ret2;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int test_tmf882x_i2c_write(uint32_t slave_addr, uint8_t reg, uint8_t *buf, int len)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;int i,ret;&lt;BR /&gt;uint8_t send[len+1];&lt;BR /&gt;send[0] = reg;&lt;BR /&gt;if(len == 1)&lt;BR /&gt;send[len] = *buf;&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;for(i=0;i&amp;lt;len;i++)&lt;BR /&gt;send[i+1] = buf[i];&lt;BR /&gt;}&lt;BR /&gt;ret = LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C1, send, len+1, true,I2C_TIME_OUT);&lt;BR /&gt;AMS_TOF_LOG("tmf882x_i2c_write ret=%d\n",ret);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;void i2c_test11()&lt;BR /&gt;{&lt;BR /&gt;uint8_t send[2];&lt;BR /&gt;uint8_t recv[2];&lt;BR /&gt;recv[0] = 0x80;&lt;BR /&gt;recv[1] = 0x90;&lt;BR /&gt;uint8_t regval = 0;&lt;BR /&gt;LPI2C_DRV_MasterSetSlaveAddr(INST_LPI2C1,0x39,false);&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;regval = 0x03;&lt;BR /&gt;test_tmf882x_i2c_write(0x39,0x80,&amp;amp;regval, 1);&lt;BR /&gt;regval = 0x00;&lt;BR /&gt;test_tmf882x_i2c_read(0x39,0x80, &amp;amp;regval, 1);&lt;BR /&gt;printf("i2c_test11,TMF882X_STAT=%x\n",regval);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt;//initialize System&lt;BR /&gt;lpi2c_master_state_t lpi2c1MasterState;&lt;BR /&gt;init_sys ();&lt;BR /&gt;//WDOG_disable();&lt;BR /&gt;// sensor_interface_init();&lt;BR /&gt;LPSPI_DRV_MasterInit(LPSPICOM1,&amp;amp;lpspiCom1State,&amp;amp;lpspiCom1_MasterConfig0);&lt;BR /&gt;LPUART_DRV_Init(INST_LPUART1, &amp;amp;lpuart1_State, &amp;amp;lpuart1_InitConfig0);&lt;BR /&gt;LPI2C_DRV_MasterInit(INST_LPI2C1, &amp;amp;lpi2c1_MasterConfig0,&amp;amp;lpi2c1MasterState);&lt;BR /&gt;enable_fault_handlers(); // If not set, all fault are handled by HardFault_Handler&lt;BR /&gt;set_fault_handlers_priority(); // priority: MemManage (1), BusFault (1), UsageFault(1)&lt;BR /&gt;LPI2C_DRV_MasterSetSlaveAddr(INST_LPI2C1,I2C_SLAVEADDR,false);&lt;BR /&gt;//while(1)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;i2c_test11();&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;return exit_code;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 09:01:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1675876#M24377</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-26T09:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676624#M24431</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@alice_thanks" target="_blank"&gt;Hi@alice_thanks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I didn't see any problem. I simply looked at the data sheet of this chip. I suggest you try to read the value of the 0x0E register correctly to ensure that your circuit is ok.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 06:12:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676624#M24431</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-06-27T06:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676723#M24437</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i find this api can't used under freertos task,&lt;/P&gt;&lt;P&gt;when used without freertos it can get the slave i2c data.&lt;/P&gt;&lt;P&gt;even i use&amp;nbsp;LPI2C_DRV_MasterSendData still can't used with freertos&lt;/P&gt;&lt;P&gt;it will stock with&amp;nbsp;while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;can you help to check it how to used in freertos ?&lt;/P&gt;&lt;DIV&gt;int test_tmf882x_i2c_read(uint32_t slave_addr, uint8_t reg, uint8_t *buf, int len)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//return read_i2c_block(slave_addr, reg, buf, len);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; int ret1,ret2;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32_t bytesRemain = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret1 = LPI2C_DRV_MasterSendData(INST_LPI2C1, &amp;amp;reg, 1, false);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;// while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS &amp;amp;&amp;amp; bytesRemain != 0);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret2 = LPI2C_DRV_MasterReceiveData(INST_LPI2C1, buf, 1, true);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; //&amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS &amp;amp;&amp;amp; bytesRemain != 0);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPI2C_DRV_MasterGetTransferStatus(INST_LPI2C1,&amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; AMS_TOF_LOG("test_i2c000 tmf882x_i2c_read,fisrt ret1=%d,second ret2=%d,recv=%d\n",ret1,ret2,*buf);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return ret2;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:05:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676723#M24437</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-27T07:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676829#M24444</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@alice_thanks" target="_blank"&gt;Hi@alice_thanks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;please take a look this post, it seems same question with your's&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/S32K142-lpi2c-is-not-working-with-freeRTOS-integration/m-p/875028" target="_self"&gt;https://community.nxp.com/t5/S32K/S32K142-lpi2c-is-not-working-with-freeRTOS-integration/m-p/875028&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:27:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676829#M24444</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-06-27T08:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676858#M24449</link>
      <description>&lt;P&gt;i try it , but it doesn't work, can share the worked project, i can test it, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:48:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676858#M24449</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-27T08:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676861#M24450</link>
      <description>&lt;P&gt;i use lpi2c&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt;//initialize System&lt;BR /&gt;lpi2c_master_state_t lpi2c1MasterState;&lt;BR /&gt;init_sys ();&lt;BR /&gt;//WDOG_disable();&lt;BR /&gt;// sensor_interface_init();&lt;BR /&gt;/* Initialize Interrupt priority for LP I2C driver as bus master */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LPSPI_DRV_MasterInit(LPSPICOM1,&amp;amp;lpspiCom1State,&amp;amp;lpspiCom1_MasterConfig0);&lt;BR /&gt;LPUART_DRV_Init(INST_LPUART1, &amp;amp;lpuart1_State, &amp;amp;lpuart1_InitConfig0);&lt;BR /&gt;LPI2C_DRV_MasterInit(INST_LPI2C1, &amp;amp;lpi2c1_MasterConfig0,&amp;amp;lpi2c1MasterState);&lt;BR /&gt;LPI2C_DRV_MasterSetSlaveAddr(INST_LPI2C1,0x39,false);&lt;BR /&gt;// enable_fault_handlers(); // If not set, all fault are handled by HardFault_Handler&lt;BR /&gt;// set_fault_handlers_priority(); // priority: MemManage (1), BusFault (1), UsageFault(1)&lt;BR /&gt;INT_SYS_SetPriority( LPI2C0_Master_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );&lt;BR /&gt;//LPI2C_DRV_MasterSetSlaveAddr(INST_LPI2C1,I2C_SLAVEADDR,false);&lt;BR /&gt;//while(1)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;//tof882x_init();&lt;BR /&gt;// i2c_test11();&lt;BR /&gt;//flash_read_write_test();&lt;BR /&gt;}&lt;BR /&gt;rtos_start();&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:49:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676861#M24450</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-27T08:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676915#M24456</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@alice_thanks" target="_blank"&gt;Hi@alice_thanks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sorry, I didn't find any I2C demos based on FreeRTOS, I'm not familiar with FreeRTOS issues.&lt;BR /&gt;Please create a new topic for your question, enter keywords such as FreeRTOS + I2C.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 09:50:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676915#M24456</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-06-27T09:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: s32k144 about i2c read/write api</title>
      <link>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676943#M24461</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 10:26:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k144-about-i2c-read-write-api/m-p/1676943#M24461</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-27T10:26:09Z</dc:date>
    </item>
  </channel>
</rss>

