Examples updated to use new rcc_periph_clock_enable function

This commit is contained in:
Frantisek Burian
2014-01-09 10:44:38 +01:00
parent 3f68a5ceef
commit 5bb4d47aae
103 changed files with 333 additions and 355 deletions

View File

@@ -26,7 +26,7 @@ static void gpio_setup(void)
/* Manually: */
// RCC_APB2ENR |= RCC_APB2ENR_IOPCEN;
/* Using API functions: */
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
rcc_periph_clock_enable(RCC_GPIOC);
/* Set GPIO5 (in GPIO port A) to 'output push-pull'. */
/* Manually: */

View File

@@ -26,10 +26,10 @@ static void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOA clock. */
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
rcc_periph_clock_enable(RCC_GPIOA);
/* Enable clocks for GPIO port A (for GPIO_USART2_TX) and USART2. */
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);
rcc_periph_clock_enable(RCC_USART2);
}
static void usart_setup(void)

View File

@@ -28,10 +28,10 @@ static void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOA clock. */
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
rcc_periph_clock_enable(RCC_GPIOA);
/* Enable clocks for GPIO port A (for LED GPIO_USART2_TX) and USART2. */
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);
rcc_periph_clock_enable(RCC_USART2);
}
static void usart_setup(void)

View File

@@ -243,8 +243,8 @@ int main(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN |
RCC_APB2ENR_IOPCEN);
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOC);
/* Setup GPIOC Pin 12 to pull up the D+ high, so autodect works
* with the bootloader. The circuit is active low. */