Examples updated to use new rcc_periph_clock_enable function
This commit is contained in:
@@ -36,7 +36,7 @@ static void clock_setup(void)
|
||||
static void gpio_setup(void)
|
||||
{
|
||||
/* Enable GPIOC clock. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
||||
rcc_periph_clock_enable(RCC_GPIOC);
|
||||
|
||||
/* Set GPIO12 (in GPIO port C) to 'output push-pull'. */
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
|
||||
@@ -46,10 +46,10 @@ static void gpio_setup(void)
|
||||
static void exti_setup(void)
|
||||
{
|
||||
/* Enable GPIOA clock. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
|
||||
/* Enable AFIO clock. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN);
|
||||
rcc_periph_clock_enable(RCC_AFIO);
|
||||
|
||||
/* Enable EXTI0 interrupt. */
|
||||
nvic_enable_irq(NVIC_EXTI0_IRQ);
|
||||
@@ -83,12 +83,12 @@ void exti0_isr(void)
|
||||
static void tim_setup(void)
|
||||
{
|
||||
/* Enable TIM1 clock. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_TIM1EN);
|
||||
rcc_periph_clock_enable(RCC_TIM1);
|
||||
|
||||
/* Enable GPIOA, GPIOB and Alternate Function clocks. */
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR,
|
||||
RCC_APB2ENR_IOPAEN |
|
||||
RCC_APB2ENR_IOPBEN | RCC_APB2ENR_AFIOEN);
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
rcc_periph_clock_enable(RCC_AFIO);
|
||||
|
||||
/*
|
||||
* Set TIM1 channel output pins to
|
||||
|
||||
Reference in New Issue
Block a user