What's with the i2c_freertos driver?

cancel
Showing results for 
Search instead for 
Did you mean: 

What's with the i2c_freertos driver?

489 Views
scottm
Senior Contributor II

I've been through all of the documentation I know of, and there is no mention of the intent or purpose of the i2c_freertos driver.  Not a word of explanation in the SDK docs, the example, or the code itself.  No discussion of its interaction with the RTOS, nothing about why you'd want to use it.

This function performs the I2C transfer according to the data given in the transfer structure.

That's the entire explanation given for the I2C_RTOS_Transfer() function.  From a look through the code, it appears to be a wrapper for the regular I2C driver that uses a mutex to implement a blocking I2C transfer.  Which means I can't use it directly for this application, because most of my I2C traffic is done by a state machine in an ISR that reads a set of registers in the background.

I'm not complaining that the driver doesn't have more functionality than that - it's fine as far as it goes and I expected to have to handle this part myself anyway - it's just that the lack of even a brief summary of so much of this stuff means that I'm wasting time reading through undocumented code just to figure out if I should bother using it.

 

Labels (1)
3 Replies

342 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Scott:

Yes , you are right. 

The FreeRTOS driver is a wrapper built on top of standard SDK peripheral drivers.

The wrappers provide an API which blocks the calling task until the I/O operation completes and allows other tasks to run. This is achieved by using the asynchronous API of the underlying driver along with RTOS task synchronization object.

Please refer to the demo

SDK_2.5.0_FRDM-K22F\boards\frdmk22f\rtos_examples\freertos_i2c

Regards

Daniel

0 Kudos

342 Views
scottm
Senior Contributor II

Hi Daniel,

Do you understand my concern about the documentation?  Where should I be looking for documentation on these APIs?  I can't find anything that gives a decent overview of most of them.  Take the FTM API - it has no function for setting the timer modulo value and the examples all set FTMn->MOD directly, yet other registers have mutator functions for the same kind of register assignment.  In other words, there's no guarantee the API alone provides what you need for even basic use cases.

Is the SDK still under active development?  Am I working with deprecated parts that have just been left behind in the process?

Thanks,

Scott

0 Kudos

342 Views
danielchen
NXP TechSupport
NXP TechSupport

HI Scott:

Yes, SDK is under active development.

Current verison is SDK_2.5.0, next version will be release at June.

Regards

Daniel

0 Kudos