i2c slave无法进入中断

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

i2c slave无法进入中断

2,082 Views
yangzj208
Contributor I

运行s32ds中的例子:lpi2c_slave_s32k144,无法进入中断,请问这个例子是否有问题,如何修改,谢谢!

波形如下,ACK已发出,SSR寄存器已有中断标记,但是中断处理函数没有被调用,以致数据没发出

pastedImage_1.png

pastedImage_2.png

配置如下:

lpi2c_slave_user_config_t lpi2c1_SlaveConfig0 = {
.slaveAddress = 104U,
.is10bitAddr = false,
.slaveListening = true,
.operatingMode = LPI2C_STANDARD_MODE,
.transferType = LPI2C_USING_INTERRUPTS,
.dmaChannel = 0U,
.slaveCallback = lpi2c1_SlaveCallback0,
.callbackParam = NULL,
};

lpi2c1_SlaveConfig0.callbackParam = (uint32_t *)INST_LPI2C1;

LPI2C_DRV_SlaveInit(INST_LPI2C1, &lpi2c1_SlaveConfig0, &lpi2c1SlaveState);

pastedImage_1.png

0 Kudos
2 Replies

1,799 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello yangzj208@qq.com,

I just tested the example (SDK RTM 3.0.2)

The only thing I changed was the transfer size.

/* Definition of the data transfer size */
#define TRANSFER_SIZE (1u)

The slave clearly sends the data 

pastedImage_2.png

I think that some comments in the example are confusing.

Because when the master requests data, the TX_REQ event is generated.

But it works.

pastedImage_3.png

The interrupt handler is managed by the driver.

The user should use the callbacks only.

From the captured signal that you posted, I see that the address is acknowledged but the master does not read the data.

Regards,

Daniel

0 Kudos

1,799 Views
yangzj208
Contributor I

ssr寄存器上都有中断标记了,但是中断处理函数没被调用

0 Kudos