| Index: platforms/stm/disco_fletch/generated/Src/mx_init.c
|
| diff --git a/platforms/stm/disco_fletch/generated/Src/mx_init.c b/platforms/stm/disco_fletch/generated/Src/mx_init.c
|
| deleted file mode 100755
|
| index d67e78c76fc1cc25c36dbae04fdfedc91fa56a31..0000000000000000000000000000000000000000
|
| --- a/platforms/stm/disco_fletch/generated/Src/mx_init.c
|
| +++ /dev/null
|
| @@ -1,811 +0,0 @@
|
| -/**
|
| - ******************************************************************************
|
| - * File Name : main.c
|
| - * Description : Main program body
|
| - ******************************************************************************
|
| - *
|
| - * COPYRIGHT(c) 2016 STMicroelectronics
|
| - *
|
| - * Redistribution and use in source and binary forms, with or without modification,
|
| - * are permitted provided that the following conditions are met:
|
| - * 1. Redistributions of source code must retain the above copyright notice,
|
| - * this list of conditions and the following disclaimer.
|
| - * 2. Redistributions in binary form must reproduce the above copyright notice,
|
| - * this list of conditions and the following disclaimer in the documentation
|
| - * and/or other materials provided with the distribution.
|
| - * 3. Neither the name of STMicroelectronics nor the names of its contributors
|
| - * may be used to endorse or promote products derived from this software
|
| - * without specific prior written permission.
|
| - *
|
| - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
| - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| - *
|
| - ******************************************************************************
|
| - */
|
| -/* Includes ------------------------------------------------------------------*/
|
| -#include "stm32f7xx_hal.h"
|
| -#include "cmsis_os.h"
|
| -
|
| -/* USER CODE BEGIN Includes */
|
| -#include "fletch_entry.h"
|
| -/* USER CODE END Includes */
|
| -
|
| -/* Private variables ---------------------------------------------------------*/
|
| -
|
| -DCMI_HandleTypeDef hdcmi;
|
| -
|
| -DMA2D_HandleTypeDef hdma2d;
|
| -
|
| -ETH_HandleTypeDef heth;
|
| -
|
| -I2C_HandleTypeDef hi2c1;
|
| -
|
| -LTDC_HandleTypeDef hltdc;
|
| -
|
| -QSPI_HandleTypeDef hqspi;
|
| -
|
| -SD_HandleTypeDef hsd1;
|
| -HAL_SD_CardInfoTypedef SDCardInfo1;
|
| -
|
| -SPDIFRX_HandleTypeDef hspdif;
|
| -
|
| -UART_HandleTypeDef huart1;
|
| -
|
| -SDRAM_HandleTypeDef hsdram1;
|
| -osThreadId defaultTaskHandle;
|
| -
|
| -/* USER CODE BEGIN PV */
|
| -/* Private variables ---------------------------------------------------------*/
|
| -
|
| -/* USER CODE END PV */
|
| -
|
| -/* Private function prototypes -----------------------------------------------*/
|
| -void SystemClock_Config(void);
|
| -void MX_GPIO_Init(void);
|
| -void MX_DCMI_Init(void);
|
| -void MX_DMA2D_Init(void);
|
| -void MX_ETH_Init(void);
|
| -void MX_FMC_Init(void);
|
| -void MX_I2C1_Init(void);
|
| -void MX_LTDC_Init(void);
|
| -void MX_QUADSPI_Init(void);
|
| -void MX_SDMMC1_SD_Init(void);
|
| -void MX_SPDIFRX_Init(void);
|
| -void MX_USART1_UART_Init(void);
|
| -void StartDefaultTask(void const * argument);
|
| -
|
| -/* USER CODE BEGIN PFP */
|
| -/* Private function prototypes -----------------------------------------------*/
|
| -
|
| -/* USER CODE END PFP */
|
| -
|
| -/* USER CODE BEGIN 0 */
|
| -
|
| -/* USER CODE END 0 */
|
| -
|
| -int _not_using_this_main(void)
|
| -{
|
| -
|
| - /* USER CODE BEGIN 1 */
|
| -
|
| - /* USER CODE END 1 */
|
| -
|
| - /* MCU Configuration----------------------------------------------------------*/
|
| -
|
| - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
| - HAL_Init();
|
| -
|
| - /* Configure the system clock */
|
| - SystemClock_Config();
|
| -
|
| - /* Initialize all configured peripherals */
|
| - MX_GPIO_Init();
|
| - MX_DCMI_Init();
|
| - MX_DMA2D_Init();
|
| - MX_ETH_Init();
|
| - MX_FMC_Init();
|
| - MX_I2C1_Init();
|
| - MX_LTDC_Init();
|
| - MX_QUADSPI_Init();
|
| - MX_SDMMC1_SD_Init();
|
| - MX_SPDIFRX_Init();
|
| - MX_USART1_UART_Init();
|
| -
|
| - /* USER CODE BEGIN 2 */
|
| -
|
| - /* USER CODE END 2 */
|
| -
|
| - /* USER CODE BEGIN RTOS_MUTEX */
|
| - /* add mutexes, ... */
|
| - /* USER CODE END RTOS_MUTEX */
|
| -
|
| - /* USER CODE BEGIN RTOS_SEMAPHORES */
|
| - /* add semaphores, ... */
|
| - /* USER CODE END RTOS_SEMAPHORES */
|
| -
|
| - /* USER CODE BEGIN RTOS_TIMERS */
|
| - /* start timers, add new ones, ... */
|
| - /* USER CODE END RTOS_TIMERS */
|
| -
|
| - /* Create the thread(s) */
|
| - /* definition and creation of defaultTask */
|
| - osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
|
| - defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
| -
|
| - /* USER CODE BEGIN RTOS_THREADS */
|
| - /* add threads, ... */
|
| - /* USER CODE END RTOS_THREADS */
|
| -
|
| - /* USER CODE BEGIN RTOS_QUEUES */
|
| - /* add queues, ... */
|
| - /* USER CODE END RTOS_QUEUES */
|
| -
|
| -
|
| - /* Start scheduler */
|
| - osKernelStart();
|
| -
|
| - /* We should never get here as control is now taken by the scheduler */
|
| -
|
| - /* Infinite loop */
|
| - /* USER CODE BEGIN WHILE */
|
| - while (1)
|
| - {
|
| - /* USER CODE END WHILE */
|
| -
|
| - /* USER CODE BEGIN 3 */
|
| -
|
| - }
|
| - /* USER CODE END 3 */
|
| -
|
| -}
|
| -
|
| -/** System Clock Configuration
|
| -*/
|
| -void SystemClock_Config(void)
|
| -{
|
| -
|
| - RCC_OscInitTypeDef RCC_OscInitStruct;
|
| - RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
| - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
| -
|
| - __PWR_CLK_ENABLE();
|
| -
|
| - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
| -
|
| - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
| - RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
| - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
| - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
| - RCC_OscInitStruct.PLL.PLLM = 25;
|
| - RCC_OscInitStruct.PLL.PLLN = 400;
|
| - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
| - RCC_OscInitStruct.PLL.PLLQ = 2;
|
| - HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
| -
|
| - HAL_PWREx_ActivateOverDrive();
|
| -
|
| - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
| - |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
| - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
| - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
| - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
| - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
| - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_6);
|
| -
|
| - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SPDIFRX|RCC_PERIPHCLK_LTDC
|
| - |RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_I2C1
|
| - |RCC_PERIPHCLK_SDMMC1;
|
| - PeriphClkInitStruct.PLLI2S.PLLI2SN = 100;
|
| - PeriphClkInitStruct.PLLI2S.PLLI2SP = 0;
|
| - PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
|
| - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 2;
|
| - PeriphClkInitStruct.PLLSAI.PLLSAIN = 384;
|
| - PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
|
| - PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2;
|
| - PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV8;
|
| - PeriphClkInitStruct.PLLI2SDivQ = 1;
|
| - PeriphClkInitStruct.PLLSAIDivQ = 1;
|
| - PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
|
| - PeriphClkInitStruct.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
|
| - PeriphClkInitStruct.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
|
| - PeriphClkInitStruct.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_SYSCLK;
|
| - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
|
| -
|
| - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
|
| -
|
| - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
|
| -
|
| - /* SysTick_IRQn interrupt configuration */
|
| - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
|
| -}
|
| -
|
| -/* DCMI init function */
|
| -void MX_DCMI_Init(void)
|
| -{
|
| -
|
| - hdcmi.Instance = DCMI;
|
| - hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
|
| - hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_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;
|
| - hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;
|
| - hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;
|
| - hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;
|
| - hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;
|
| - hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;
|
| - HAL_DCMI_Init(&hdcmi);
|
| -
|
| -}
|
| -
|
| -/* DMA2D init function */
|
| -void MX_DMA2D_Init(void)
|
| -{
|
| -
|
| - hdma2d.Instance = DMA2D;
|
| - hdma2d.Init.Mode = DMA2D_M2M;
|
| - hdma2d.Init.ColorMode = DMA2D_ARGB8888;
|
| - hdma2d.Init.OutputOffset = 0;
|
| - hdma2d.LayerCfg[1].InputOffset = 0;
|
| - hdma2d.LayerCfg[1].InputColorMode = CM_ARGB8888;
|
| - hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
| - hdma2d.LayerCfg[1].InputAlpha = 0;
|
| - HAL_DMA2D_Init(&hdma2d);
|
| -
|
| - HAL_DMA2D_ConfigLayer(&hdma2d, 1);
|
| -
|
| -}
|
| -
|
| -/* ETH init function */
|
| -void MX_ETH_Init(void)
|
| -{
|
| -
|
| - uint8_t MACAddr[6] ;
|
| -
|
| - heth.Instance = ETH;
|
| - heth.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
|
| - heth.Init.PhyAddress = 1;
|
| - MACAddr[0] = 0x00;
|
| - MACAddr[1] = 0x80;
|
| - MACAddr[2] = 0xE1;
|
| - MACAddr[3] = 0x00;
|
| - MACAddr[4] = 0x00;
|
| - MACAddr[5] = 0x00;
|
| - heth.Init.MACAddr = &MACAddr[0];
|
| - heth.Init.RxMode = ETH_RXPOLLING_MODE;
|
| - heth.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;
|
| - heth.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
|
| - HAL_ETH_Init(&heth);
|
| -
|
| -}
|
| -
|
| -/* I2C1 init function */
|
| -void MX_I2C1_Init(void)
|
| -{
|
| -
|
| - hi2c1.Instance = I2C1;
|
| - hi2c1.Init.Timing = 0x00C0EFFF;
|
| - hi2c1.Init.OwnAddress1 = 0;
|
| - hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
| - hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
| - hi2c1.Init.OwnAddress2 = 0;
|
| - hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
|
| - hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
| - hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
| - HAL_I2C_Init(&hi2c1);
|
| -
|
| - /**Configure Analogue filter
|
| - */
|
| - HAL_I2CEx_AnalogFilter_Config(&hi2c1, I2C_ANALOGFILTER_ENABLE);
|
| -
|
| -}
|
| -
|
| -/* LTDC init function */
|
| -void MX_LTDC_Init(void)
|
| -{
|
| -
|
| - LTDC_LayerCfgTypeDef pLayerCfg;
|
| - LTDC_LayerCfgTypeDef pLayerCfg1;
|
| -
|
| - hltdc.Instance = LTDC;
|
| - hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
|
| - hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
|
| - hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
|
| - hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
|
| - hltdc.Init.HorizontalSync = 7;
|
| - hltdc.Init.VerticalSync = 3;
|
| - hltdc.Init.AccumulatedHBP = 14;
|
| - hltdc.Init.AccumulatedVBP = 5;
|
| - hltdc.Init.AccumulatedActiveW = 654;
|
| - hltdc.Init.AccumulatedActiveH = 485;
|
| - hltdc.Init.TotalWidth = 660;
|
| - hltdc.Init.TotalHeigh = 487;
|
| - hltdc.Init.Backcolor.Blue = 0;
|
| - hltdc.Init.Backcolor.Green = 0;
|
| - hltdc.Init.Backcolor.Red = 0;
|
| - HAL_LTDC_Init(&hltdc);
|
| -
|
| - pLayerCfg.WindowX0 = 0;
|
| - pLayerCfg.WindowX1 = 0;
|
| - pLayerCfg.WindowY0 = 0;
|
| - pLayerCfg.WindowY1 = 0;
|
| - pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
|
| - pLayerCfg.Alpha = 0;
|
| - pLayerCfg.Alpha0 = 0;
|
| - pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
| - pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
| - pLayerCfg.FBStartAdress = 0;
|
| - pLayerCfg.ImageWidth = 0;
|
| - pLayerCfg.ImageHeight = 0;
|
| - pLayerCfg.Backcolor.Blue = 0;
|
| - pLayerCfg.Backcolor.Green = 0;
|
| - pLayerCfg.Backcolor.Red = 0;
|
| - HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0);
|
| -
|
| - pLayerCfg1.WindowX0 = 0;
|
| - pLayerCfg1.WindowX1 = 0;
|
| - pLayerCfg1.WindowY0 = 0;
|
| - pLayerCfg1.WindowY1 = 0;
|
| - pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
|
| - pLayerCfg1.Alpha = 0;
|
| - pLayerCfg1.Alpha0 = 0;
|
| - pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
|
| - pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
|
| - pLayerCfg1.FBStartAdress = 0;
|
| - pLayerCfg1.ImageWidth = 0;
|
| - pLayerCfg1.ImageHeight = 0;
|
| - pLayerCfg1.Backcolor.Blue = 0;
|
| - pLayerCfg1.Backcolor.Green = 0;
|
| - pLayerCfg1.Backcolor.Red = 0;
|
| - HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1);
|
| -
|
| -}
|
| -
|
| -/* QUADSPI init function */
|
| -void MX_QUADSPI_Init(void)
|
| -{
|
| -
|
| - hqspi.Instance = QUADSPI;
|
| - hqspi.Init.ClockPrescaler = 255;
|
| - hqspi.Init.FifoThreshold = 1;
|
| - hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
|
| - hqspi.Init.FlashSize = 1;
|
| - hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
|
| - hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
|
| - HAL_QSPI_Init(&hqspi);
|
| -
|
| -}
|
| -
|
| -/* SDMMC1 init function */
|
| -void MX_SDMMC1_SD_Init(void)
|
| -{
|
| -
|
| - hsd1.Instance = SDMMC1;
|
| - hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
|
| - hsd1.Init.ClockBypass = SDMMC_CLOCK_BYPASS_DISABLE;
|
| - hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
|
| - hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B;
|
| - hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
|
| - hsd1.Init.ClockDiv = 0;
|
| - HAL_SD_Init(&hsd1, &SDCardInfo1);
|
| -
|
| - HAL_SD_WideBusOperation_Config(&hsd1, SDMMC_BUS_WIDE_4B);
|
| -
|
| -}
|
| -
|
| -/* SPDIFRX init function */
|
| -void MX_SPDIFRX_Init(void)
|
| -{
|
| -
|
| - hspdif.Instance = SPDIFRX;
|
| - hspdif.Init.InputSelection = SPDIFRX_INPUT_IN0;
|
| - hspdif.Init.Retries = SPDIFRX_MAXRETRIES_NONE;
|
| - hspdif.Init.WaitForActivity = SPDIFRX_WAITFORACTIVITY_OFF;
|
| - hspdif.Init.ChannelSelection = SPDIFRX_CHANNEL_A;
|
| - hspdif.Init.DataFormat = SPDIFRX_DATAFORMAT_LSB;
|
| - hspdif.Init.StereoMode = SPDIFRX_STEREOMODE_DISABLE;
|
| - hspdif.Init.PreambleTypeMask = SPDIFRX_PREAMBLETYPEMASK_OFF;
|
| - hspdif.Init.ChannelStatusMask = SPDIFRX_CHANNELSTATUS_OFF;
|
| - hspdif.Init.ValidityBitMask = SPDIFRX_VALIDITYMASK_OFF;
|
| - hspdif.Init.ParityErrorMask = SPDIFRX_PARITYERRORMASK_OFF;
|
| - HAL_SPDIFRX_Init(&hspdif);
|
| -
|
| -}
|
| -
|
| -/* USART1 init function */
|
| -void MX_USART1_UART_Init(void)
|
| -{
|
| -
|
| - huart1.Instance = USART1;
|
| - huart1.Init.BaudRate = 115200;
|
| - huart1.Init.WordLength = UART_WORDLENGTH_8B;
|
| - huart1.Init.StopBits = UART_STOPBITS_1;
|
| - huart1.Init.Parity = UART_PARITY_NONE;
|
| - huart1.Init.Mode = UART_MODE_TX_RX;
|
| - huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
| - huart1.Init.OverSampling = UART_OVERSAMPLING_16;
|
| - huart1.Init.OneBitSampling = UART_ONEBIT_SAMPLING_DISABLED;
|
| - huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
|
| - HAL_UART_Init(&huart1);
|
| -
|
| -}
|
| -/* FMC initialization function */
|
| -void MX_FMC_Init(void)
|
| -{
|
| - FMC_SDRAM_TimingTypeDef SdramTiming;
|
| -
|
| - /** Perform the SDRAM1 memory initialization sequence
|
| - */
|
| - hsdram1.Instance = FMC_SDRAM_DEVICE;
|
| - /* hsdram1.Init */
|
| - hsdram1.Init.SDBank = FMC_SDRAM_BANK1;
|
| - hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
| - hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
| - hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_8;
|
| - hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
| - hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;
|
| - hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
|
| - hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_DISABLE;
|
| - hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
|
| - hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;
|
| - /* SdramTiming */
|
| - SdramTiming.LoadToActiveDelay = 16;
|
| - SdramTiming.ExitSelfRefreshDelay = 16;
|
| - SdramTiming.SelfRefreshTime = 16;
|
| - SdramTiming.RowCycleDelay = 16;
|
| - SdramTiming.WriteRecoveryTime = 16;
|
| - SdramTiming.RPDelay = 16;
|
| - SdramTiming.RCDDelay = 16;
|
| -
|
| - HAL_SDRAM_Init(&hsdram1, &SdramTiming);
|
| -
|
| -}
|
| -
|
| -/** Configure pins as
|
| - * Analog
|
| - * Input
|
| - * Output
|
| - * EVENT_OUT
|
| - * EXTI
|
| - PB5 ------> USB_OTG_HS_ULPI_D7
|
| - PB4 ------> S_TIM3_CH1
|
| - PA15 ------> S_TIM2_CH1_ETR
|
| - PA12 ------> USB_OTG_FS_DP
|
| - PI4 ------> SAI2_MCLK_A
|
| - PG10 ------> SAI2_SD_B
|
| - PA11 ------> USB_OTG_FS_DM
|
| - PI5 ------> SAI2_SCK_A
|
| - PI7 ------> SAI2_FS_A
|
| - PI6 ------> SAI2_SD_A
|
| - PI1 ------> SPI2_SCK
|
| - PA10 ------> USB_OTG_FS_ID
|
| - PI0 ------> S_TIM5_CH4
|
| - PA8 ------> S_TIM1_CH1
|
| - PC7 ------> USART6_RX
|
| - PH4 ------> USB_OTG_HS_ULPI_NXT
|
| - PC6 ------> USART6_TX
|
| - PF7 ------> ADC3_IN5
|
| - PF6 ------> ADC3_IN4
|
| - PB13 ------> USB_OTG_HS_ULPI_D6
|
| - PF10 ------> ADC3_IN8
|
| - PF9 ------> ADC3_IN7
|
| - PF8 ------> ADC3_IN6
|
| - PB12 ------> USB_OTG_HS_ULPI_D5
|
| - PC0 ------> USB_OTG_HS_ULPI_STP
|
| - PC2 ------> USB_OTG_HS_ULPI_DIR
|
| - PA0/WKUP ------> ADCx_IN0
|
| - PH7 ------> I2C3_SCL
|
| - PA5 ------> USB_OTG_HS_ULPI_CK
|
| - PB10 ------> USB_OTG_HS_ULPI_D3
|
| - PH6 ------> S_TIM12_CH1
|
| - PH8 ------> I2C3_SDA
|
| - PA3 ------> USB_OTG_HS_ULPI_D0
|
| - PB1 ------> USB_OTG_HS_ULPI_D2
|
| - PB0 ------> USB_OTG_HS_ULPI_D1
|
| - PB11 ------> USB_OTG_HS_ULPI_D4
|
| - PB14 ------> SPI2_MISO
|
| - PB15 ------> SPI2_MOSI
|
| -*/
|
| -void MX_GPIO_Init(void)
|
| -{
|
| -
|
| - GPIO_InitTypeDef GPIO_InitStruct;
|
| -
|
| - /* GPIO Ports Clock Enable */
|
| - __GPIOE_CLK_ENABLE();
|
| - __GPIOG_CLK_ENABLE();
|
| - __GPIOB_CLK_ENABLE();
|
| - __GPIOD_CLK_ENABLE();
|
| - __GPIOC_CLK_ENABLE();
|
| - __GPIOA_CLK_ENABLE();
|
| - __GPIOJ_CLK_ENABLE();
|
| - __GPIOI_CLK_ENABLE();
|
| - __GPIOK_CLK_ENABLE();
|
| - __GPIOF_CLK_ENABLE();
|
| - __GPIOH_CLK_ENABLE();
|
| -
|
| - /*Configure GPIO pin : OTG_HS_OverCurrent_Pin */
|
| - GPIO_InitStruct.Pin = OTG_HS_OverCurrent_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(OTG_HS_OverCurrent_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ULPI_D7_Pin ULPI_D6_Pin ULPI_D5_Pin ULPI_D3_Pin
|
| - ULPI_D2_Pin ULPI_D1_Pin ULPI_D4_Pin */
|
| - GPIO_InitStruct.Pin = ULPI_D7_Pin|ULPI_D6_Pin|ULPI_D5_Pin|ULPI_D3_Pin
|
| - |ULPI_D2_Pin|ULPI_D1_Pin|ULPI_D4_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
|
| - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_PWM_D3_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_PWM_D3_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
|
| - HAL_GPIO_Init(ARDUINO_PWM_D3_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_PWM_D9_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_PWM_D9_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF1_TIM2;
|
| - HAL_GPIO_Init(ARDUINO_PWM_D9_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : OTG_FS_VBUS_Pin */
|
| - GPIO_InitStruct.Pin = OTG_FS_VBUS_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(OTG_FS_VBUS_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : Audio_INT_Pin */
|
| - GPIO_InitStruct.Pin = Audio_INT_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(Audio_INT_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : OTG_FS_P_Pin OTG_FS_N_Pin OTG_FS_ID_Pin */
|
| - GPIO_InitStruct.Pin = OTG_FS_P_Pin|OTG_FS_N_Pin|OTG_FS_ID_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
|
| - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : SAI2_MCLKA_Pin SAI2_SCKA_Pin SAI2_FSA_Pin SAI2_SDA_Pin */
|
| - GPIO_InitStruct.Pin = SAI2_MCLKA_Pin|SAI2_SCKA_Pin|SAI2_FSA_Pin|SAI2_SDA_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_SAI2;
|
| - HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : SAI2_SDB_Pin */
|
| - GPIO_InitStruct.Pin = SAI2_SDB_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_SAI2;
|
| - HAL_GPIO_Init(SAI2_SDB_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : OTG_FS_PowerSwitchOn_Pin */
|
| - GPIO_InitStruct.Pin = OTG_FS_PowerSwitchOn_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - HAL_GPIO_Init(OTG_FS_PowerSwitchOn_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ARDUINO_D7_Pin ARDUINO_D8_Pin LCD_DISP_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_D7_Pin|ARDUINO_D8_Pin|LCD_DISP_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : uSD_Detect_Pin */
|
| - GPIO_InitStruct.Pin = uSD_Detect_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(uSD_Detect_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : LCD_BL_CTRL_Pin */
|
| - GPIO_InitStruct.Pin = LCD_BL_CTRL_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - HAL_GPIO_Init(LCD_BL_CTRL_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : OTG_FS_OverCurrent_Pin */
|
| - GPIO_InitStruct.Pin = OTG_FS_OverCurrent_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(OTG_FS_OverCurrent_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : TP3_Pin NC2_Pin */
|
| - GPIO_InitStruct.Pin = TP3_Pin|NC2_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_SCK_D13_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_SCK_D13_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
|
| - HAL_GPIO_Init(ARDUINO_SCK_D13_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : DCMI_PWR_EN_Pin */
|
| - GPIO_InitStruct.Pin = DCMI_PWR_EN_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - HAL_GPIO_Init(DCMI_PWR_EN_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_PWM_CS_D10_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_PWM_CS_D10_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF2_TIM5;
|
| - HAL_GPIO_Init(ARDUINO_PWM_CS_D10_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_PWM_D5_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_PWM_D5_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
|
| - HAL_GPIO_Init(ARDUINO_PWM_D5_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : LCD_INT_Pin */
|
| - GPIO_InitStruct.Pin = LCD_INT_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(LCD_INT_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ARDUINO_RX_D0_Pin ARDUINO_TX_D1_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_RX_D0_Pin|ARDUINO_TX_D1_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF8_USART6;
|
| - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ULPI_NXT_Pin */
|
| - GPIO_InitStruct.Pin = ULPI_NXT_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
|
| - HAL_GPIO_Init(ULPI_NXT_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ARDUINO_D4_Pin ARDUINO_D2_Pin EXT_RST_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_D4_Pin|ARDUINO_D2_Pin|EXT_RST_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ARDUINO_A4_Pin ARDUINO_A5_Pin ARDUINO_A1_Pin ARDUINO_A2_Pin
|
| - ARDUINO_A3_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_A4_Pin|ARDUINO_A5_Pin|ARDUINO_A1_Pin|ARDUINO_A2_Pin
|
| - |ARDUINO_A3_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ULPI_STP_Pin ULPI_DIR_Pin */
|
| - GPIO_InitStruct.Pin = ULPI_STP_Pin|ULPI_DIR_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
|
| - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : RMII_RXER_Pin */
|
| - GPIO_InitStruct.Pin = RMII_RXER_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(RMII_RXER_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_A0_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_A0_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - HAL_GPIO_Init(ARDUINO_A0_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : LCD_SCL_Pin LCD_SDA_Pin */
|
| - GPIO_InitStruct.Pin = LCD_SCL_Pin|LCD_SDA_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
|
| - GPIO_InitStruct.Pull = GPIO_PULLUP;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF4_I2C3;
|
| - HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ULPI_CLK_Pin ULPI_D0_Pin */
|
| - GPIO_InitStruct.Pin = ULPI_CLK_Pin|ULPI_D0_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
|
| - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_HS;
|
| - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pin : ARDUINO_PWM_D6_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_PWM_D6_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF9_TIM12;
|
| - HAL_GPIO_Init(ARDUINO_PWM_D6_GPIO_Port, &GPIO_InitStruct);
|
| -
|
| - /*Configure GPIO pins : ARDUINO_MISO_D12_Pin ARDUINO_MOSI_PWM_D11_Pin */
|
| - GPIO_InitStruct.Pin = ARDUINO_MISO_D12_Pin|ARDUINO_MOSI_PWM_D11_Pin;
|
| - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
| - GPIO_InitStruct.Pull = GPIO_NOPULL;
|
| - GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
|
| - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
|
| - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
| -
|
| -}
|
| -
|
| -/* USER CODE BEGIN 4 */
|
| -
|
| -/* USER CODE END 4 */
|
| -
|
| -/* StartDefaultTask function */
|
| -void StartDefaultTask(void const * argument)
|
| -{
|
| -
|
| - /* USER CODE BEGIN 5 */
|
| - FletchEntry(argument);
|
| - /* Infinite loop */
|
| - for(;;)
|
| - {
|
| - osDelay(1);
|
| - }
|
| - /* USER CODE END 5 */
|
| -}
|
| -
|
| -#ifdef USE_FULL_ASSERT
|
| -
|
| -/**
|
| - * @brief Reports the name of the source file and the source line number
|
| - * where the assert_param error has occurred.
|
| - * @param file: pointer to the source file name
|
| - * @param line: assert_param error line source number
|
| - * @retval None
|
| - */
|
| -void assert_failed(uint8_t* file, uint32_t line)
|
| -{
|
| - /* USER CODE BEGIN 6 */
|
| - /* User can add his own implementation to report the file name and line number,
|
| - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
| - /* USER CODE END 6 */
|
| -
|
| -}
|
| -
|
| -#endif
|
| -
|
| -/**
|
| - * @}
|
| - */
|
| -
|
| -/**
|
| - * @}
|
| -*/
|
| -
|
| -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
|