hellonsn 发表于 2018-8-15 10:22:54

Can DMA be enabled for I2C slave mode in STM32

STM32 supports DMA operation in I2C master and SPI master mode obviously. However , can weenable DMA in I2C slave or SPI slave mode to transfer user data ?


bargagebaobei 发表于 2018-8-15 11:57:58

我认为应该是可以的

zhangxu56726 发表于 2018-8-15 13:48:58

ok,STM32 transfer data use DMA, I used ,long long ago.

feixiang20 发表于 2018-8-15 23:23:21

可以的吧,在主模式(SPI_InitStructure.SPI_Mode = SPI_Mode_Master;)接收数据可以用DMA.能使I2C从或从SPI从属模式中的DMA传输用户数据

hellonsn 发表于 2018-8-16 12:53:32

feixiang20 发表于 2018-8-15 23:23
可以的吧,在主模式(SPI_InitStructure.SPI_Mode = SPI_Mode_Master;)接收数据可以用DMA.能使I2C从或从SPI ...

I use I2C slave mode to receive data by DMA , is that possible ? if yes ,how to count the number of bytes it received by DMA ?

hellonsn 发表于 2018-8-16 12:54:33

zhangxu56726 发表于 2018-8-15 13:48
ok,STM32 transfer data use DMA, I used ,long long ago.

I2C slave mode to get data by DMA mode , not the I2C master mode,is that possible ?????

hellonsn 发表于 2018-8-16 14:17:42

bargagebaobei 发表于 2018-8-15 11:57
我认为应该是可以的

One question is that in slave mode , the I2C receiver dont know in advance how many bytes it is to receive because the number of bytes transferred is determined by the i2c maset? In that case , seems the DMA cannot be used.

but DMA can be enable in transmitter in slave mode , since it knows how many bytes it is going to transfer.

Is that right ?thanks.

zhangxu56726 发表于 2018-8-16 17:23:55

hellonsn 发表于 2018-8-16 12:54
I2C slave mode to get data by DMA mode , not the I2C master mode,is that possible ?????

yes, I use I2C slave in DMA mode,please scan the example in library.
页: [1]
查看完整版本: Can DMA be enabled for I2C slave mode in STM32