diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-16 17:38:22 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-16 17:38:22 +0000 |
commit | 3a94137eb38857d9780a5ef65be30736804dea46 (patch) | |
tree | 3f2742af90d08db7c09a6ba9d0304a49225000fd /os/hal/platforms/STM32F1xx | |
parent | 46538d795be83d1d54b132e7d57213cb6d975c51 (diff) | |
download | ChibiOS-3a94137eb38857d9780a5ef65be30736804dea46.tar.gz ChibiOS-3a94137eb38857d9780a5ef65be30736804dea46.tar.bz2 ChibiOS-3a94137eb38857d9780a5ef65be30736804dea46.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3320 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32F1xx')
-rw-r--r-- | os/hal/platforms/STM32F1xx/adc_lld.c | 8 | ||||
-rw-r--r-- | os/hal/platforms/STM32F1xx/hal_lld.c | 6 | ||||
-rw-r--r-- | os/hal/platforms/STM32F1xx/hal_lld.h | 3 |
3 files changed, 8 insertions, 9 deletions
diff --git a/os/hal/platforms/STM32F1xx/adc_lld.c b/os/hal/platforms/STM32F1xx/adc_lld.c index cc4d25ea1..ac74251f8 100644 --- a/os/hal/platforms/STM32F1xx/adc_lld.c +++ b/os/hal/platforms/STM32F1xx/adc_lld.c @@ -100,7 +100,7 @@ void adc_lld_init(void) { STM32_DMA_CR_TEIE | STM32_DMA_CR_EN;
/* Temporary activation.*/
- RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
+ rccEnableADC1(FALSE);
ADC1->CR1 = 0;
ADC1->CR2 = ADC_CR2_ADON;
@@ -116,7 +116,7 @@ void adc_lld_init(void) { /* Return the ADC in low power mode.*/
ADC1->CR2 = 0;
- RCC->APB2ENR &= ~RCC_APB2ENR_ADC1EN;
+ rccDisableADC1(FALSE);
#endif
}
@@ -140,7 +140,7 @@ void adc_lld_start(ADCDriver *adcp) { (void *)adcp);
chDbgAssert(!b, "adc_lld_start(), #1", "stream already allocated");
dmaStreamSetPeripheral(adcp->dmastp, &ADC1->DR);
- RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
+ rccEnableADC1(FALSE);
}
#endif
@@ -167,7 +167,7 @@ void adc_lld_stop(ADCDriver *adcp) { ADC1->CR1 = 0;
ADC1->CR2 = 0;
dmaStreamRelease(adcp->dmastp);
- RCC->APB2ENR &= ~RCC_APB2ENR_ADC1EN;
+ rccDisableADC1(FALSE);
}
#endif
}
diff --git a/os/hal/platforms/STM32F1xx/hal_lld.c b/os/hal/platforms/STM32F1xx/hal_lld.c index ba13544f4..6b5cc1459 100644 --- a/os/hal/platforms/STM32F1xx/hal_lld.c +++ b/os/hal/platforms/STM32F1xx/hal_lld.c @@ -59,10 +59,8 @@ void hal_lld_init(void) {
/* Reset of all peripherals.*/
- RCC->APB1RSTR = 0xFFFFFFFF;
- RCC->APB2RSTR = 0xFFFFFFFF;
- RCC->APB1RSTR = 0;
- RCC->APB2RSTR = 0;
+ rccResetAPB1(0xFFFFFFFF);
+ rccResetAPB2(0xFFFFFFFF);
/* SysTick initialization using the system clock.*/
SysTick->LOAD = STM32_HCLK / CH_FREQUENCY - 1;
diff --git a/os/hal/platforms/STM32F1xx/hal_lld.h b/os/hal/platforms/STM32F1xx/hal_lld.h index 77c954e9a..659fd3fb1 100644 --- a/os/hal/platforms/STM32F1xx/hal_lld.h +++ b/os/hal/platforms/STM32F1xx/hal_lld.h @@ -578,8 +578,9 @@ #define FALSE 0
#define TRUE (!FALSE)
-/* STM32 DMA support code.*/
+/* STM32 DMA and RCC helpers.*/
#include "stm32_dma.h"
+#include "stm32_rcc.h"
#ifdef __cplusplus
extern "C" {
|