Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 7:a069c1750fbc
- Parent:
- 6:37fb696395d7
- Child:
- 9:b7c6e7303df5
diff -r 37fb696395d7 -r a069c1750fbc main.cpp
--- a/main.cpp Fri Jul 03 22:42:45 2015 +0000
+++ b/main.cpp Sun Jul 05 22:18:04 2015 +0000
@@ -52,7 +52,7 @@
#include "httpserverapp.h"
//#include "stm32f4xx_hal.h"
-//#include "stm32f4xx_hal_rcc.h"
+#include "stm32f4xx_hal_rcc.h"
/* Free-RTOS includes */
#include "osi.h"
@@ -64,34 +64,9 @@
using namespace mbed_cc3100;
static void SystemClock_Config(void);
-static void MX_DMA_Init(void);
-static void MX_DCMI_Init(void);
void DCMI_IRQHandler(void);
void DMA2_Stream1_IRQHandler(void);
-
- /**
- * Initializes the Global MSP.
- */
-//void HAL_MspInit(void)
-//{
- /* USER CODE BEGIN MspInit 0 */
-
- /* USER CODE END MspInit 0 */
-
-// HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
-
- /* System interrupt init*/
-/* SysTick_IRQn interrupt configuration */
-// HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
-
- /* USER CODE BEGIN MspInit 1 */
-
- /* USER CODE END MspInit 1 */
-//}
-
-//DCMI_HandleTypeDef hdcmi;
-//DMA_HandleTypeDef hdma_dcmi;
/** System Clock Configuration
*/
@@ -102,10 +77,10 @@
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
-// RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;//Used for ov7670 test
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;//Used for ov7670 test
__PWR_CLK_ENABLE();
-
+// __GPIOH_CLK_ENABLE(); //Enable HSE Clock 8MHz
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
@@ -127,24 +102,27 @@
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
//Used for ov7670 test
-// PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S;
-// PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
-// PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
-// HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S;
+ PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
+ PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
+ HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
- /* RCC_MCODIV_5 33.6MHz mco output on pin PC_9 (cam xclk) */
- /* RCC_MCODIV_4 42MHz mco output on pin PC_9 (cam xclk) */
- /* RCC_MCODIV_3 56MHz mco output on pin PC_9 (cam xclk) */
-// HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_3);
+ /* RCC_MCODIV_5 33.6MHz mco2 output on pin PC_9 (cam xclk) */
+ /* RCC_MCODIV_4 42MHz mco2 output on pin PC_9 (cam xclk) */
+ /* RCC_MCODIV_3 56MHz mco2 output on pin PC_9 (cam xclk) */
+// HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_SYSCLK, RCC_MCODIV_4);
- /* RCC_MCODIV_1 8MHz mco output on pin PC_9 (cam xclk) */
- /* RCC_MCODIV_2 4MHz mco output on pin PC_9 (cam xclk) */
- /* RCC_MCODIV_4 2MHz mco output on pin PC_9 (cam xclk) */
- HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_HSE, RCC_MCODIV_4);
+ /* RCC_MCODIV_1 16MHz mco1 output on pin PA_8 (cam xclk) */
+ HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1);
+
+ /* RCC_MCODIV_1 8MHz mco2 output on pin PC_9 (cam xclk) */
+ /* RCC_MCODIV_2 4MHz mco2 output on pin PC_9 (cam xclk) */
+ /* RCC_MCODIV_4 2MHz mco2 output on pin PC_9 (cam xclk) */
+// HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_HSE, RCC_MCODIV_1);
//Used for ov7670 test
- /* RCC_MCODIV_4 24MHz mco output on pin PC_9 (cam xclk) */
-// HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_PLLI2SCLK, RCC_MCODIV_4);
+ /* RCC_MCODIV_4 24MHz mco2 output on pin PC_9 (cam xclk) */
+ HAL_RCC_MCOConfig(RCC_MCO2, RCC_MCO2SOURCE_PLLI2SCLK, RCC_MCODIV_4);
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
@@ -158,43 +136,6 @@
// }
}
-
-void MX_DCMI_Init()
-{
- DCMI_HandleTypeDef hdcmi;
- DMA_HandleTypeDef hdma_dcmi;
-
- hdcmi.Instance = DCMI;
- hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
- hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;//FALLING
- hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_LOW;
- hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_LOW;
- hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;
- hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
-#ifdef ENABLE_JPEG
- hdcmi.Init.JPEGMode = DCMI_JPEG_ENABLE;
-#else
- hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;
-#endif
-
- HAL_DCMI_MspInit(&hdcmi);
- HAL_DCMI_Init(&hdcmi);
-
-}
-
-/**
- * Enable DMA controller clock
- */
-void MX_DMA_Init(void)
-{
- /* DMA controller clock enable */
- __DMA2_CLK_ENABLE();
-
- /* DMA interrupt init */
- HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 5, 5);
-// HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
-
-}
/* Warning if pin changes are made below then the same changes have to be made in the following files.
* httpserverapp.cpp
@@ -280,11 +221,7 @@
// Configuring UART
//
CLI_Configure();
-
-/* Initialize all configured peripherals */
-// MX_DMA_Init();
-// MX_DCMI_Init();
-// initLEDs();
+ initLEDs();
// toggleLed(1);
//#ifndef NOTERM