Updated to use the new rcc_periph_clock_enable code
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
ae9c116e30
commit
e4d106dce6
@@ -193,7 +193,7 @@ int console_gets(char *s, int len) {
|
||||
void console_setup(void) {
|
||||
|
||||
/* MUST enable the GPIO clock in ADDITION to the USART clock */
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
|
||||
/* This example uses PD5 and PD6 for Tx and Rx respectively
|
||||
* but other pins are available for this role on USART2 (our chosen
|
||||
@@ -215,7 +215,7 @@ void console_setup(void) {
|
||||
* attach to different buses, and even some UARTS are attached to
|
||||
* APB1 and some to APB2, again the data sheet is useful here.
|
||||
*/
|
||||
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN);
|
||||
rcc_periph_clock_enable(RCC_USART2);
|
||||
|
||||
/* Set up USART/UART parameters using the libopencm3 helper functions */
|
||||
usart_set_baudrate(CONSOLE_UART, 115200);
|
||||
|
||||
@@ -73,12 +73,15 @@ sdram_init(void) {
|
||||
/*
|
||||
* First all the GPIO pins that end up as SDRAM pins
|
||||
*/
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPBEN);
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN);
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPEEN);
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPFEN);
|
||||
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPGEN);
|
||||
rcc_periph_clock_enable(RCC_GPIOB | RCC_GPIOC | RCC_GPIOD |
|
||||
RCC_GPIOE | RCC_GPIOF | RCC_GPIOG);
|
||||
/*
|
||||
rcc_periph_clock_enable(RCC_GPIOC);
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
rcc_periph_clock_enable(RCC_GPIOE);
|
||||
rcc_periph_clock_enable(RCC_GPIOF);
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
*/
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
gpio_mode_setup(sdram_pins[i].gpio, GPIO_MODE_AF, GPIO_PUPD_NONE,
|
||||
@@ -89,7 +92,7 @@ sdram_init(void) {
|
||||
}
|
||||
|
||||
/* Enable the SDRAM Controller */
|
||||
rcc_peripheral_enable_clock(&RCC_AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
rcc_periph_clock_enable(RCC_FSMC);
|
||||
|
||||
/* Note the STM32F429-DISCO board has the ram attached to bank 2 */
|
||||
/* Timing parameters computed for a 168Mhz clock */
|
||||
|
||||
Reference in New Issue
Block a user