I am interfacing with an IR sensor that uses an SMBus. How is I2C_HAL_SetSMBusAddressCmd() used?

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

I am interfacing with an IR sensor that uses an SMBus. How is I2C_HAL_SetSMBusAddressCmd() used?

367 Views
johnelliott
Contributor I


There seem to be several other SMBus specific functions in the fsl_i2c_hal.c file as well and no documentation I can find to explain how to use it. Any help would be apprecieated.

Labels (1)
0 Kudos
1 Reply

232 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi John,

    For the detail fsl_i2c_hal.c function description, you can read the fsl_i2c_hal.c directly.

  Do you just don't know how to call it? You can see the function defination:

  Function I2C_HAL_SetSMBusAddressCmd

/*FUNCTION**********************************************************************

*

* Function Name : I2C_HAL_SetSMBusAddressCmd

* Description  : Enables/Disables SMBus device default address.

*

*END**************************************************************************/

void I2C_HAL_SetSMBusAddressCmd(I2C_Type *base, bool enable, uint8_t address)

{

    I2C_BWR_SMB_SIICAEN(base, enable);

    I2C_BWR_A2_SAD(base, address);

}

If you want to enable the SMBUS device default address:I2C address register 2 matching is enabled, you can call it like this:

I2C_HAL_SetSMBusAddressCmd(I2C0, 1,0XA0);

More details, you also can refer to the chip reference manual, I2C chapter.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos