运行s32ds中的例子:lpi2c_slave_s32k144,无法进入中断,请问这个例子是否有问题,如何修改,谢谢!
波形如下,ACK已发出,SSR寄存器已有中断标记,但是中断处理函数没有被调用,以致数据没发出
配置如下:
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);
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
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.
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
ssr寄存器上都有中断标记了,但是中断处理函数没被调用