Slave addressing as I2C Master

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

Slave addressing as I2C Master

1,697 Views
jeremiahg
Contributor III

I am looking for some clarification using the I2C component for the S32K144. I currently have my Component Inspector set to:

 

168505_168505.pngpastedImage_2.png

 

I have separately established communications with configuration 0 and configuration 1. I'm not exactly sure how NXP intended us to communicate to each slave when multiple slaves are present. It looks like the functions present in the Kinetis line of Processor Expert pass the Config along with the data for sending and receiving. That is not present on the S32K.

 

I have a semaphore set up which uses the LPI2C_DRV_MasterSetSlaveAddr function to switch the address so I can communicate with each slave. Another option would be to Deinit, then Init with the Config that contains the desired slave address. What was NXP intending to do here?

 

It is possible that the I2C module is still being development.

Labels (1)
Tags (1)
0 Kudos
1 Reply

1,250 Views
cristianzamfire
NXP Employee
NXP Employee

    Hello Jeremiah,

    You are right, in order to communicate with another slave you must call LPI2C_DRV_MasterSetSlaveAddr() with the new slave address. After this, all transfers will use this address, until the next call to LPI2C_DRV_MasterSetSlaveAddr().
    It is also possible to call Deinit and then Init again with a new configuration, but this would consume much more processing time.

    Best regards,
    Cristian

0 Kudos