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

@@ -45,8 +45,8 @@
static void i2c_setup(void)
{
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_I2C1EN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_IOPBEN);
rcc_periph_clock_enable(RCC_I2C1);
rcc_periph_clock_enable(RCC_GPIOB);
rcc_set_i2c_clock_hsi(I2C1);
i2c_reset(I2C1);
@@ -70,8 +70,8 @@ static void i2c_setup(void)
static void usart_setup(void)
{
/* Enable clocks for GPIO port A (for GPIO_USART2_TX) and USART2. */
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_IOPAEN);
rcc_periph_clock_enable(RCC_USART2);
rcc_periph_clock_enable(RCC_GPIOA);
/* Setup GPIO pin GPIO_USART2_TX/GPIO9 on GPIO port A for transmit. */
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO2 | GPIO3);
@@ -91,7 +91,7 @@ static void usart_setup(void)
static void gpio_setup(void)
{
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_IOPEEN);
rcc_periph_clock_enable(RCC_GPIOE);
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
GPIO8 | GPIO9 | GPIO10 | GPIO11 | GPIO12 | GPIO13 |
GPIO14 | GPIO15);