I2C Block/No-Block, polling

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Block/No-Block, polling

Jump to solution
1,032 Views
kent_gu
Contributor III

HI,

Use Kinetis K22F to read/write I2C E2PROM, found there are Block, no Block, polling, call back examples. From the examples code, I can't find what difference, don't know which source code for my application. My understanding base on term meaning is the following for communication, 

   -Block,  means that the function does not return until the transmit is complete, the flowing code can't run until the block function finish Tx or Rx.

   -No-block, the function returns immediately after initiating the transmit function, the flowing code can run without No-block function finish Tx or Rx.

   -Polling & callback, should be used  for no-block Tx and Rx, to check the state of Tx and Rx.

But seems that my explain are not right, could you please help me the below question,

   -What meaning of Block, no Block, polling, call back?

   -Which example I should use to make K22F read/write I2C E2PROM?

Best Regards,

Kent

Tags (1)
0 Kudos
1 Solution
703 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Blocking: Related functions perform a blocking transaction/receive, which means that the function does not return until all data is sent/received OR a time out occurs.
no Blocking: Related send/receive function returns immediately when set buffer pointer and length to transfer/receive buffer and transfer/receive Size. The user must check the status of I2C to know the whether transmission/receiving is finished or not.

Polling: Checking I2C status flag using polling way, not interrupt.

Callback: Using I2C interrupt way to do I2C transfer.

I would recommend customer to refer the latest KSDK V2.0 I2C driver examples with below examples:

pastedImage_5.png

Customer want to do I2C EEPROM operation could refer KSDK V2.0 provided examples.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
704 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Blocking: Related functions perform a blocking transaction/receive, which means that the function does not return until all data is sent/received OR a time out occurs.
no Blocking: Related send/receive function returns immediately when set buffer pointer and length to transfer/receive buffer and transfer/receive Size. The user must check the status of I2C to know the whether transmission/receiving is finished or not.

Polling: Checking I2C status flag using polling way, not interrupt.

Callback: Using I2C interrupt way to do I2C transfer.

I would recommend customer to refer the latest KSDK V2.0 I2C driver examples with below examples:

pastedImage_5.png

Customer want to do I2C EEPROM operation could refer KSDK V2.0 provided examples.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
703 Views
kent_gu
Contributor III

Hui,

Sorry to reply late because I am busy for the other urgent work. 

Great, you let me be more clear about the concept.

Now I am using V1.3 KSDK for my project, also download V2.0 KSDK for the processor, seems that they have big difference, and have the below question:

   #1, How do I switch V1.3KSDK project to V2.KSDK project? Because current many project using the driver from V1.3 KSDK?

   #2,V2.0 KSDK download just for one processor or one board?

Have a good Day!

Kent

0 Kudos
703 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

#1 For the KSDK V2.0 software architecture with big modification with KSDK V1.3 software, I would recommend customer to refer KSDK V2.0 software and related examples to redesign related project.

#2 Yes, the KSDK V2.0 doesn't provide the whole Kinetis product software package, which only provide single processor or single board related software package downloaded. Sorry for that may bring any inconvenience to you.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos