aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stm32')
-rw-r--r--lib/stm32/f4/adc.c10
-rw-r--r--lib/stm32/usart.c21
2 files changed, 23 insertions, 8 deletions
diff --git a/lib/stm32/f4/adc.c b/lib/stm32/f4/adc.c
index 7475fac..aef49a4 100644
--- a/lib/stm32/f4/adc.c
+++ b/lib/stm32/f4/adc.c
@@ -435,17 +435,12 @@ void adc_set_right_aligned(u32 adc)
/*-----------------------------------------------------------------------------*/
/** @brief ADC Enable DMA Transfers
-Only available for ADC1 through DMA1 channel1, and ADC3 through DMA2 channel5.
-ADC2 will use DMA if it is set as slave in dual mode with ADC1 in DMA transfer
-mode.
-
@param[in] adc Unsigned int32. ADC block register address base @ref adc_reg_base
*/
void adc_enable_dma(u32 adc)
{
- if ((adc == ADC1) | (adc == ADC3))
- ADC_CR2(adc) |= ADC_CR2_DMA;
+ ADC_CR2(adc) |= ADC_CR2_DMA;
}
/*-----------------------------------------------------------------------------*/
@@ -456,8 +451,7 @@ void adc_enable_dma(u32 adc)
void adc_disable_dma(u32 adc)
{
- if ((adc == ADC1) | (adc == ADC3))
- ADC_CR2(adc) &= ~ADC_CR2_DMA;
+ ADC_CR2(adc) &= ~ADC_CR2_DMA;
}
/*-----------------------------------------------------------------------------*/
diff --git a/lib/stm32/usart.c b/lib/stm32/usart.c
index 1faf486..cb46db8 100644
--- a/lib/stm32/usart.c
+++ b/lib/stm32/usart.c
@@ -400,6 +400,27 @@ void usart_disable_tx_interrupt(u32 usart)
USART_CR1(usart) &= ~USART_CR1_TXEIE;
}
+/*-----------------------------------------------------------------------------*/
+/** @brief USART Error Interrupt Enable.
+
+@param[in] usart unsigned 32 bit. USART block register address base @ref usart_reg_base
+*/
+
+void usart_enable_error_interrupt(u32 usart)
+{
+ USART_CR3(usart) |= USART_CR3_EIE;
+}
+
+/*-----------------------------------------------------------------------------*/
+/** @brief USART Error Interrupt Disable.
+
+@param[in] usart unsigned 32 bit. USART block register address base @ref usart_reg_base
+*/
+
+void usart_disable_error_interrupt(u32 usart)
+{
+ USART_CR3(usart) &= ~USART_CR3_EIE;
+}
/*---------------------------------------------------------------------------*/
/** @brief USART Read a Status Flag.