Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tm_stm32_i2c_dma.c #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 00-STM32_LIBRARIES/tm_stm32_i2c_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ uint8_t TM_I2C_DMA_SendByte(I2C_TypeDef* I2Cx, uint8_t value, uint16_t count) {
TM_DMA_Start(&DMA_InitStruct, (uint32_t) &Settings->Dummy32, (uint32_t) &I2Cx->DR, count);

/* Enable I2C TX DMA */
I2Cx->CR2 |= I2C_CR2_TXDMAEN;
I2Cx->CR2 |= I2C_CR2_DMAEN;

/* Return OK */
return 1;
Expand Down Expand Up @@ -273,7 +273,7 @@ uint8_t TM_I2C_DMA_SendHalfWord(I2C_TypeDef* I2Cx, uint16_t value, uint16_t coun
TM_DMA_Start(&DMA_InitStruct, (uint32_t) &Settings->Dummy16, (uint32_t) &I2Cx->DR, count);

/* Enable I2C TX DMA */
I2Cx->CR2 |= I2C_CR2_TXDMAEN;
I2Cx->CR2 |= I2C_CR2_DMAEN;

/* Return OK */
return 1;
Expand All @@ -287,7 +287,7 @@ uint8_t TM_I2C_DMA_Transmitting(I2C_TypeDef* I2Cx) {
return (
Settings->RX_Stream->NDTR || /*!< RX is working */
Settings->TX_Stream->NDTR || /*!< TX is working */
I2C_IS_BUSY(I2Cx) /*!< I2C is busy */
I2C_SR2_BUSY(I2Cx) /*!< I2C is busy */
);
}

Expand Down