Added USB example for stm32f4.

Moved clock enable for OTG_FS back into applications.  This and gpio config
are the only differences between f107 and f2xx/f4xx.
This commit is contained in:
Gareth McMullin
2011-12-17 14:11:39 +13:00
parent d630d83972
commit 651917aeb4
10 changed files with 275 additions and 2 deletions

View File

@@ -237,6 +237,7 @@ int main(void)
rcc_clock_setup_in_hsi_out_48mhz();
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN);
gpio_set(GPIOC, GPIO2);
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,

View File

@@ -239,6 +239,7 @@ int main(void)
rcc_clock_setup_in_hsi_out_48mhz();
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN);
gpio_set(GPIOC, GPIO2);
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,

View File

@@ -291,6 +291,7 @@ int main(void)
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_SPI2EN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN);
/* Configure SPI2: PB13(SCK), PB14(MISO), PB15(MOSI). */
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_10_MHZ,

View File

@@ -99,6 +99,7 @@ int main(void)
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
rcc_peripheral_enable_clock(&RCC_AHBENR, RCC_AHBENR_OTGFSEN);
/* LED output */
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,