Changed examples to new rcc definitions.

This commit is contained in:
Thomas Otto
2010-05-11 14:50:55 +02:00
parent b2bca1f1a4
commit d08ee7e333
12 changed files with 29 additions and 29 deletions

View File

@@ -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);