@@ -471,7 +471,7 @@ STATIC mp_obj_t pyb_i2c_send(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
471471 // if IRQs are enabled then we can use DMA
472472 DMA_HandleTypeDef tx_dma ;
473473 if (query_irq () == IRQ_STATE_ENABLED ) {
474- dma_init (& tx_dma , self -> tx_dma_stream , self -> tx_dma_channel , DMA_MEMORY_TO_PERIPH , self -> i2c );
474+ dma_init (& tx_dma , self -> tx_dma_stream , & dma_init_struct_spi_i2c , self -> tx_dma_channel , DMA_MEMORY_TO_PERIPH , self -> i2c );
475475 self -> i2c -> hdmatx = & tx_dma ;
476476 self -> i2c -> hdmarx = NULL ;
477477 }
@@ -545,7 +545,7 @@ STATIC mp_obj_t pyb_i2c_recv(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
545545 // if IRQs are enabled then we can use DMA
546546 DMA_HandleTypeDef rx_dma ;
547547 if (query_irq () == IRQ_STATE_ENABLED ) {
548- dma_init (& rx_dma , self -> rx_dma_stream , self -> rx_dma_channel , DMA_PERIPH_TO_MEMORY , self -> i2c );
548+ dma_init (& rx_dma , self -> rx_dma_stream , & dma_init_struct_spi_i2c , self -> rx_dma_channel , DMA_PERIPH_TO_MEMORY , self -> i2c );
549549 self -> i2c -> hdmatx = NULL ;
550550 self -> i2c -> hdmarx = & rx_dma ;
551551 }
@@ -639,7 +639,7 @@ STATIC mp_obj_t pyb_i2c_mem_read(mp_uint_t n_args, const mp_obj_t *pos_args, mp_
639639 status = HAL_I2C_Mem_Read (self -> i2c , i2c_addr , mem_addr , mem_addr_size , (uint8_t * )vstr .buf , vstr .len , args [3 ].u_int );
640640 } else {
641641 DMA_HandleTypeDef rx_dma ;
642- dma_init (& rx_dma , self -> rx_dma_stream , self -> rx_dma_channel , DMA_PERIPH_TO_MEMORY , self -> i2c );
642+ dma_init (& rx_dma , self -> rx_dma_stream , & dma_init_struct_spi_i2c , self -> rx_dma_channel , DMA_PERIPH_TO_MEMORY , self -> i2c );
643643 self -> i2c -> hdmatx = NULL ;
644644 self -> i2c -> hdmarx = & rx_dma ;
645645 status = HAL_I2C_Mem_Read_DMA (self -> i2c , i2c_addr , mem_addr , mem_addr_size , (uint8_t * )vstr .buf , vstr .len );
@@ -703,7 +703,7 @@ STATIC mp_obj_t pyb_i2c_mem_write(mp_uint_t n_args, const mp_obj_t *pos_args, mp
703703 status = HAL_I2C_Mem_Write (self -> i2c , i2c_addr , mem_addr , mem_addr_size , bufinfo .buf , bufinfo .len , args [3 ].u_int );
704704 } else {
705705 DMA_HandleTypeDef tx_dma ;
706- dma_init (& tx_dma , self -> tx_dma_stream , self -> tx_dma_channel , DMA_MEMORY_TO_PERIPH , self -> i2c );
706+ dma_init (& tx_dma , self -> tx_dma_stream , & dma_init_struct_spi_i2c , self -> tx_dma_channel , DMA_MEMORY_TO_PERIPH , self -> i2c );
707707 self -> i2c -> hdmatx = & tx_dma ;
708708 self -> i2c -> hdmarx = NULL ;
709709 status = HAL_I2C_Mem_Write_DMA (self -> i2c , i2c_addr , mem_addr , mem_addr_size , bufinfo .buf , bufinfo .len );
0 commit comments