Examples updated to use new rcc_periph_clock_enable function
This commit is contained in:
@@ -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: */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user