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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

808件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
1 返信

673件の閲覧回数
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 件の賞賛
返信