aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Otto2010-05-11 14:50:55 +0200
committerThomas Otto2010-05-11 14:50:55 +0200
commitd08ee7e33315e21d7b1d6ade1cabbcdf4616108c (patch)
tree6d82d8274604a3aadf31d5d3cde02ca8707e365c
parentb2bca1f1a413b3e6b7527445f89d3a802e4bab76 (diff)
Changed examples to new rcc definitions.
-rw-r--r--examples/mb525/fancyblink/fancyblink.c2
-rw-r--r--examples/mb525/pwmleds/pwmleds.c4
-rw-r--r--examples/other/adc_temperature_sensor/adc.c8
-rw-r--r--examples/other/dma_mem2mem/dma.c8
-rw-r--r--examples/other/dogm128/main.c4
-rw-r--r--examples/other/i2c_stts75_sensor/i2c_stts75_sensor.c10
-rw-r--r--examples/other/rtc/rtc.c6
-rw-r--r--examples/other/systick/systick.c2
-rw-r--r--examples/other/timer_interrupt/timer.c4
-rw-r--r--examples/stm32-h103/fancyblink/fancyblink.c2
-rw-r--r--examples/stm32-h103/miniblink/miniblink.c2
-rw-r--r--examples/stm32-h103/usart/usart.c6
12 files changed, 29 insertions, 29 deletions
diff --git a/examples/mb525/fancyblink/fancyblink.c b/examples/mb525/fancyblink/fancyblink.c
index 8e7a5b6..b10d138 100644
--- a/examples/mb525/fancyblink/fancyblink.c
+++ b/examples/mb525/fancyblink/fancyblink.c
@@ -26,7 +26,7 @@ void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOC clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
}
diff --git a/examples/mb525/pwmleds/pwmleds.c b/examples/mb525/pwmleds/pwmleds.c
index 4502d11..282ae61 100644
--- a/examples/mb525/pwmleds/pwmleds.c
+++ b/examples/mb525/pwmleds/pwmleds.c
@@ -241,10 +241,10 @@ void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable TIM3 clock. */
- rcc_peripheral_enable_clock(&RCC_APB1ENR, TIM3EN);
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_TIM3EN);
/* Enable GPIOC, Alternate Function clocks. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN | AFIOEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN | RCC_APB2ENR_AFIOEN);
}
void gpio_setup(void)
diff --git a/examples/other/adc_temperature_sensor/adc.c b/examples/other/adc_temperature_sensor/adc.c
index be89225..7445399 100644
--- a/examples/other/adc_temperature_sensor/adc.c
+++ b/examples/other/adc_temperature_sensor/adc.c
@@ -26,8 +26,8 @@
void usart_setup(void)
{
/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPAEN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, USART1EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);
/* Setup GPIO pin GPIO_USART1_TX/GPIO9 on GPIO port A for transmit. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
@@ -48,7 +48,7 @@ void usart_setup(void)
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
@@ -60,7 +60,7 @@ void gpio_setup(void)
void adc_setup(void)
{
int i;
- rcc_peripheral_enable_clock(&RCC_APB2ENR, ADC1EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_ADC1EN);
/* make shure it didnt run during config */
adc_off(ADC1);
diff --git a/examples/other/dma_mem2mem/dma.c b/examples/other/dma_mem2mem/dma.c
index 726687c..e85e06f 100644
--- a/examples/other/dma_mem2mem/dma.c
+++ b/examples/other/dma_mem2mem/dma.c
@@ -26,8 +26,8 @@
void usart_setup(void)
{
/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPAEN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, USART1EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);
/* Setup GPIO pin GPIO_USART1_TX/GPIO9 on GPIO port A for transmit. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
@@ -48,7 +48,7 @@ void usart_setup(void)
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
@@ -82,7 +82,7 @@ int main(void)
my_usart_print_string(USART1, "s1 ");
my_usart_print_string(USART1, s1);
- rcc_peripheral_enable_clock(&RCC_AHBENR, DMA1EN);
+ rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_DMA1EN);
/* MEM2MEM mode for channel 1. */
dma_enable_mem2mem_mode(DMA1, DMA_CHANNEL1);
diff --git a/examples/other/dogm128/main.c b/examples/other/dogm128/main.c
index f9453bb..3cea060 100644
--- a/examples/other/dogm128/main.c
+++ b/examples/other/dogm128/main.c
@@ -29,7 +29,7 @@
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
@@ -57,7 +57,7 @@ void spi_setup()
{
/* the DOGM128 display is connected to SPI2, so initialise it correctly */
- rcc_peripheral_enable_clock(&RCC_APB1ENR, SPI2EN);
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_SPI2EN);
spi_set_unidirectional_mode(DOGM128_SPI); /* we want to send only */
spi_disable_crc(DOGM128_SPI); /* no CRC for this slave */
diff --git a/examples/other/i2c_stts75_sensor/i2c_stts75_sensor.c b/examples/other/i2c_stts75_sensor/i2c_stts75_sensor.c
index fe70f8f..1227fd1 100644
--- a/examples/other/i2c_stts75_sensor/i2c_stts75_sensor.c
+++ b/examples/other/i2c_stts75_sensor/i2c_stts75_sensor.c
@@ -27,8 +27,8 @@
void usart_setup(void)
{
/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPAEN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, USART1EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);
/* Setup GPIO pin GPIO_USART1_TX/GPIO9 on GPIO port A for transmit. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
@@ -49,7 +49,7 @@ void usart_setup(void)
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
@@ -61,8 +61,8 @@ void gpio_setup(void)
void i2c_setup(void)
{
/* Enable clocks for I2C2 and AFIO. */
- rcc_peripheral_enable_clock(&RCC_APB1ENR, I2C2EN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, AFIOEN);
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_I2C2EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN);
/* Set alternate functions for the SCL and SDA pins of I2C2. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
diff --git a/examples/other/rtc/rtc.c b/examples/other/rtc/rtc.c
index cf40072..d3c4bcb 100644
--- a/examples/other/rtc/rtc.c
+++ b/examples/other/rtc/rtc.c
@@ -29,11 +29,11 @@ void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOC clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPAEN);
- rcc_peripheral_enable_clock(&RCC_APB2ENR, USART1EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN);
}
void usart_setup(void)
diff --git a/examples/other/systick/systick.c b/examples/other/systick/systick.c
index 329218b..68120d2 100644
--- a/examples/other/systick/systick.c
+++ b/examples/other/systick/systick.c
@@ -28,7 +28,7 @@ u32 temp32;
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
diff --git a/examples/other/timer_interrupt/timer.c b/examples/other/timer_interrupt/timer.c
index 5c9791c..d1f2bbb 100644
--- a/examples/other/timer_interrupt/timer.c
+++ b/examples/other/timer_interrupt/timer.c
@@ -26,7 +26,7 @@
void gpio_setup(void)
{
/* Enable GPIOB clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
/* Set GPIO6/7 (in GPIO port B) to 'output push-pull' for the LEDs. */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_2_MHZ,
@@ -60,7 +60,7 @@ int main(void)
gpio_clear(GPIOB, GPIO7); /* LED1 on */
gpio_set(GPIOB, GPIO6); /* LED2 off */
- rcc_peripheral_enable_clock(&RCC_APB1ENR, TIM2EN);
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_TIM2EN);
/* the goal is to let the LED2 glow for a second and then be off for a second */
diff --git a/examples/stm32-h103/fancyblink/fancyblink.c b/examples/stm32-h103/fancyblink/fancyblink.c
index 39652ec..014ae90 100644
--- a/examples/stm32-h103/fancyblink/fancyblink.c
+++ b/examples/stm32-h103/fancyblink/fancyblink.c
@@ -26,7 +26,7 @@ void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOC clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
}
diff --git a/examples/stm32-h103/miniblink/miniblink.c b/examples/stm32-h103/miniblink/miniblink.c
index 21575f6..dc48200 100644
--- a/examples/stm32-h103/miniblink/miniblink.c
+++ b/examples/stm32-h103/miniblink/miniblink.c
@@ -26,7 +26,7 @@ void gpio_setup(void)
/* Manually: */
// RCC_APB2ENR |= IOPCEN;
/* Using API functions: */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
/* Set GPIO12 (in GPIO port C) to 'output push-pull'. */
/* Manually: */
diff --git a/examples/stm32-h103/usart/usart.c b/examples/stm32-h103/usart/usart.c
index 3776f84..d8ffe3d 100644
--- a/examples/stm32-h103/usart/usart.c
+++ b/examples/stm32-h103/usart/usart.c
@@ -26,11 +26,11 @@ void clock_setup(void)
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOC clock. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPCEN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
/* Enable clocks for GPIO port B (for GPIO_USART3_TX) and USART3. */
- rcc_peripheral_enable_clock(&RCC_APB2ENR, IOPBEN);
- rcc_peripheral_enable_clock(&RCC_APB1ENR, USART3EN);
+ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
+ rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART3EN);
}
void usart_setup(void)