add calc project
This commit is contained in:
2539
.metadata/.ide.log
2539
.metadata/.ide.log
File diff suppressed because one or more lines are too long
566
.metadata/.ide.log-2025-09-08.log
Normal file
566
.metadata/.ide.log-2025-09-08.log
Normal file
File diff suppressed because one or more lines are too long
@@ -128,3 +128,90 @@ Command-line arguments: -os linux -ws gtk -arch x86_64
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2025-09-08 14:04:20.109
|
||||
!MESSAGE Started RMI Server, listening on port 41337
|
||||
!SESSION 2025-09-10 14:14:34.345 -----------------------------------------------
|
||||
eclipse.buildId=Version 1.19.0
|
||||
java.version=21.0.3
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2025-09-10 14:14:56.912
|
||||
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2025-09-10 14:14:56.913
|
||||
!MESSAGE Log4j2 initialized with config file /home/ja/st/Home/.metadata/.log4j2.xml
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2025-09-10 14:15:46.023
|
||||
!MESSAGE Started RMI Server, listening on port 41337
|
||||
!SESSION 2025-09-10 15:12:44.823 -----------------------------------------------
|
||||
eclipse.buildId=Version 1.19.0
|
||||
java.version=21.0.3
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2025-09-10 15:12:56.322
|
||||
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2025-09-10 15:12:56.323
|
||||
!MESSAGE Log4j2 initialized with config file /home/ja/st/Home/.metadata/.log4j2.xml
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2025-09-10 15:13:36.324
|
||||
!MESSAGE Started RMI Server, listening on port 41337
|
||||
!SESSION 2025-09-10 15:27:25.883 -----------------------------------------------
|
||||
eclipse.buildId=Version 1.19.0
|
||||
java.version=21.0.3
|
||||
java.vendor=Eclipse Adoptium
|
||||
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
|
||||
Command-line arguments: -os linux -ws gtk -arch x86_64
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2025-09-10 15:27:37.637
|
||||
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2025-09-10 15:27:37.637
|
||||
!MESSAGE Log4j2 initialized with config file /home/ja/st/Home/.metadata/.log4j2.xml
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2025-09-10 15:28:18.680
|
||||
!MESSAGE Started RMI Server, listening on port 41337
|
||||
|
||||
!ENTRY org.eclipse.cdt.core 1 0 2025-09-10 15:31:54.983
|
||||
!MESSAGE Indexed 'Calculator' (58 sources, 125 headers) in 4.56 sec: 12,712 declarations; 87,377 references; 0 unresolved inclusions; 1 syntax errors; 2 unresolved names (0.002%)
|
||||
|
||||
!ENTRY org.eclipse.ui 4 0 2025-09-10 16:17:36.787
|
||||
!MESSAGE Unhandled event loop exception
|
||||
!STACK 0
|
||||
java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.IWorkbenchWindow.getShell()" because the return value of "org.eclipse.ui.IWorkbench.getActiveWorkbenchWindow()" is null
|
||||
at com.st.stm32cube.common.mx.oss.core.awtswtbridge.AwtEnvironment.getShell(AwtEnvironment.java:281)
|
||||
at com.st.stm32cube.common.mx.oss.core.awtswtbridge.SwtInputBlocker.block(SwtInputBlocker.java:98)
|
||||
at com.st.stm32cube.common.mx.oss.core.awtswtbridge.AwtEnvironment.invokeAwt(AwtEnvironment.java:179)
|
||||
at com.st.stm32cube.common.mx.oss.core.awtswtbridge.EmbeddedSwingComposite$3.widgetDisposed(EmbeddedSwingComposite.java:244)
|
||||
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:140)
|
||||
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
|
||||
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
|
||||
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
|
||||
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1643)
|
||||
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1622)
|
||||
at org.eclipse.swt.widgets.Widget.release(Widget.java:1394)
|
||||
at org.eclipse.swt.widgets.Control.release(Control.java:4753)
|
||||
at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:1560)
|
||||
at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:279)
|
||||
at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:503)
|
||||
at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:3435)
|
||||
at org.eclipse.swt.widgets.Widget.release(Widget.java:1401)
|
||||
at org.eclipse.swt.widgets.Control.release(Control.java:4753)
|
||||
at org.eclipse.swt.widgets.Widget.dispose(Widget.java:575)
|
||||
at org.eclipse.swt.widgets.Shell.dispose(Shell.java:3352)
|
||||
at org.eclipse.swt.widgets.Display.release(Display.java:4573)
|
||||
at org.eclipse.swt.graphics.Device.dispose(Device.java:276)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:168)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
|
||||
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
|
||||
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
|
||||
at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
*** SESSION Sep 03, 2025 14:43:27.388 ------------------------------------------
|
||||
*** SESSION Sep 03, 2025 14:52:08.729 ------------------------------------------
|
||||
*** SESSION Sep 08, 2025 14:03:38.937 ------------------------------------------
|
||||
*** SESSION Sep 10, 2025 14:14:54.289 ------------------------------------------
|
||||
*** SESSION Sep 10, 2025 15:12:55.190 ------------------------------------------
|
||||
*** SESSION Sep 10, 2025 15:27:36.494 ------------------------------------------
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -19,7 +19,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "usb_host.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@@ -48,17 +47,13 @@ DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
LTDC_HandleTypeDef hltdc;
|
||||
|
||||
SPI_HandleTypeDef hspi5;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
//osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
@@ -70,8 +65,6 @@ static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_LTDC_Init(void);
|
||||
static void MX_SPI5_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
@@ -94,7 +87,6 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
@@ -119,8 +111,6 @@ int main(void)
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_LTDC_Init();
|
||||
MX_SPI5_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_USART1_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
@@ -145,24 +135,23 @@ int main(void)
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
//osKernelStart();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
// userloop
|
||||
while (1)
|
||||
{
|
||||
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
@@ -188,7 +177,7 @@ void SystemClock_Config(void)
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
@@ -326,106 +315,6 @@ static void MX_I2C3_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LTDC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_LTDC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 0 */
|
||||
|
||||
/* USER CODE END LTDC_Init 0 */
|
||||
|
||||
LTDC_LayerCfgTypeDef pLayerCfg = {0};
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 1 */
|
||||
|
||||
/* USER CODE END LTDC_Init 1 */
|
||||
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 = 9;
|
||||
hltdc.Init.VerticalSync = 1;
|
||||
hltdc.Init.AccumulatedHBP = 29;
|
||||
hltdc.Init.AccumulatedVBP = 3;
|
||||
hltdc.Init.AccumulatedActiveW = 269;
|
||||
hltdc.Init.AccumulatedActiveH = 323;
|
||||
hltdc.Init.TotalWidth = 279;
|
||||
hltdc.Init.TotalHeigh = 327;
|
||||
hltdc.Init.Backcolor.Blue = 0;
|
||||
hltdc.Init.Backcolor.Green = 0;
|
||||
hltdc.Init.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
pLayerCfg.WindowX0 = 0;
|
||||
pLayerCfg.WindowX1 = 240;
|
||||
pLayerCfg.WindowY0 = 0;
|
||||
pLayerCfg.WindowY1 = 320;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||
pLayerCfg.Alpha = 255;
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
|
||||
pLayerCfg.FBStartAdress = 0xD0000000;
|
||||
pLayerCfg.ImageWidth = 240;
|
||||
pLayerCfg.ImageHeight = 320;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
pLayerCfg.Backcolor.Green = 0;
|
||||
pLayerCfg.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI5 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI5_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 0 */
|
||||
|
||||
/* USER CODE END SPI5_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 1 */
|
||||
|
||||
/* USER CODE END SPI5_Init 1 */
|
||||
/* SPI5 parameter configuration*/
|
||||
hspi5.Instance = SPI5;
|
||||
hspi5.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi5.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi5.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
|
||||
hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi5.Init.CRCPolynomial = 10;
|
||||
if (HAL_SPI_Init(&hspi5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI5_Init 2 */
|
||||
|
||||
/* USER CODE END SPI5_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
@@ -525,7 +414,7 @@ static void MX_FMC_Init(void)
|
||||
/* hsdram1.Init */
|
||||
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
|
||||
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_11;
|
||||
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
|
||||
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
|
||||
@@ -566,70 +455,52 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ACP_RST_GPIO_Port, ACP_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, RDX_Pin|WRX_DCX_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin OTG_FS_PSO_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin;
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : ACP_RST_Pin */
|
||||
GPIO_InitStruct.Pin = ACP_RST_Pin;
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ACP_RST_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : OTG_FS_OC_Pin */
|
||||
GPIO_InitStruct.Pin = OTG_FS_OC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(OTG_FS_OC_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : BOOT1_Pin */
|
||||
GPIO_InitStruct.Pin = BOOT1_Pin;
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(BOOT1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : TE_Pin */
|
||||
GPIO_InitStruct.Pin = TE_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(TE_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : RDX_Pin WRX_DCX_Pin */
|
||||
GPIO_InitStruct.Pin = RDX_Pin|WRX_DCX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
@@ -656,8 +527,6 @@ static void MX_GPIO_Init(void)
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* init code for USB_HOST */
|
||||
MX_USB_HOST_Init();
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
@@ -0,0 +1,4 @@
|
||||
635E684B79701B039C64EA45C3F84D30=76D5CABA7E36F5DD0D38ED323FA426B4
|
||||
66BE74F758C12D739921AEA421D593D3=2
|
||||
DC22A860405A8BF2F2C095E5B6529F12=BB3BD6F58A87E81DE6E549B37335B23A
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,582 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
CRC_HandleTypeDef hcrc;
|
||||
|
||||
DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
//osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void SystemClock_Config(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
int 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();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CRC_Init();
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_TIM1_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 */
|
||||
|
||||
/* USER CODE BEGIN RTOS_QUEUES */
|
||||
/* add queues, ... */
|
||||
/* USER CODE END RTOS_QUEUES */
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* Start scheduler */
|
||||
//osKernelStart();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
// userloop
|
||||
while (1)
|
||||
{
|
||||
bool A_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_7) == GPIO_PIN_SET);
|
||||
bool B_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_9) == GPIO_PIN_SET);
|
||||
|
||||
if (A_pressed && B_pressed == true)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
|
||||
} else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
}
|
||||
//
|
||||
|
||||
HAL_DELAY(200); // milliseconds
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
RCC_OscInitStruct.PLL.PLLN = 72;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 3;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
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_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CRC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_CRC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 0 */
|
||||
|
||||
/* USER CODE END CRC_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 1 */
|
||||
|
||||
/* USER CODE END CRC_Init 1 */
|
||||
hcrc.Instance = CRC;
|
||||
if (HAL_CRC_Init(&hcrc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CRC_Init 2 */
|
||||
|
||||
/* USER CODE END CRC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA2D Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_DMA2D_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 1 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 1 */
|
||||
hdma2d.Instance = DMA2D;
|
||||
hdma2d.Init.Mode = DMA2D_M2M;
|
||||
hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
|
||||
hdma2d.Init.OutputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
|
||||
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
||||
hdma2d.LayerCfg[1].InputAlpha = 0;
|
||||
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN DMA2D_Init 2 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C3 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_I2C3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 0 */
|
||||
|
||||
/* USER CODE END I2C3_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 1 */
|
||||
|
||||
/* USER CODE END I2C3_Init 1 */
|
||||
hi2c3.Instance = I2C3;
|
||||
hi2c3.Init.ClockSpeed = 100000;
|
||||
hi2c3.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||
hi2c3.Init.OwnAddress1 = 0;
|
||||
hi2c3.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c3.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
hi2c3.Init.OwnAddress2 = 0;
|
||||
hi2c3.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
||||
hi2c3.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
||||
if (HAL_I2C_Init(&hi2c3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Analogue filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigAnalogFilter(&hi2c3, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Digital filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigDigitalFilter(&hi2c3, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN I2C3_Init 2 */
|
||||
|
||||
/* USER CODE END I2C3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 0 */
|
||||
|
||||
/* USER CODE END TIM1_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 1 */
|
||||
|
||||
/* USER CODE END TIM1_Init 1 */
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 65535;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM1_Init 2 */
|
||||
|
||||
/* USER CODE END TIM1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USART1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_USART1_UART_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 0 */
|
||||
|
||||
/* USER CODE END USART1_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 1 */
|
||||
|
||||
/* USER CODE END USART1_Init 1 */
|
||||
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;
|
||||
if (HAL_UART_Init(&huart1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN USART1_Init 2 */
|
||||
|
||||
/* USER CODE END USART1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/* FMC initialization function */
|
||||
static void MX_FMC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN FMC_Init 0 */
|
||||
|
||||
/* USER CODE END FMC_Init 0 */
|
||||
|
||||
FMC_SDRAM_TimingTypeDef SdramTiming = {0};
|
||||
|
||||
/* USER CODE BEGIN FMC_Init 1 */
|
||||
|
||||
/* USER CODE END FMC_Init 1 */
|
||||
|
||||
/** Perform the SDRAM1 memory initialization sequence
|
||||
*/
|
||||
hsdram1.Instance = FMC_SDRAM_DEVICE;
|
||||
/* hsdram1.Init */
|
||||
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
|
||||
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_11;
|
||||
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
|
||||
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
|
||||
hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
|
||||
hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_PERIOD_2;
|
||||
hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_DISABLE;
|
||||
hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_1;
|
||||
/* SdramTiming */
|
||||
SdramTiming.LoadToActiveDelay = 2;
|
||||
SdramTiming.ExitSelfRefreshDelay = 7;
|
||||
SdramTiming.SelfRefreshTime = 4;
|
||||
SdramTiming.RowCycleDelay = 7;
|
||||
SdramTiming.WriteRecoveryTime = 3;
|
||||
SdramTiming.RPDelay = 2;
|
||||
SdramTiming.RCDDelay = 2;
|
||||
|
||||
if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK)
|
||||
{
|
||||
Error_Handler( );
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN FMC_Init 2 */
|
||||
|
||||
/* USER CODE END FMC_Init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GPIO Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_GPIO_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
/* USER CODE BEGIN MX_GPIO_Init_1 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_1 */
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|TP_INT1_Pin;-
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PA1 */ // External LED
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PE7 PE9 */ // Buttons
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_9;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_2 */
|
||||
}
|
||||
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
osDelay(1);
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM6 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
#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 /* USE_FULL_ASSERT */
|
||||
@@ -0,0 +1,4 @@
|
||||
635E684B79701B039C64EA45C3F84D30=76D5CABA7E36F5DD0D38ED323FA426B4
|
||||
66BE74F758C12D739921AEA421D593D3=1
|
||||
DC22A860405A8BF2F2C095E5B6529F12=BB3BD6F58A87E81DE6E549B37335B23A
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,4 @@
|
||||
635E684B79701B039C64EA45C3F84D30=76D5CABA7E36F5DD0D38ED323FA426B4
|
||||
66BE74F758C12D739921AEA421D593D3=3
|
||||
DC22A860405A8BF2F2C095E5B6529F12=BB3BD6F58A87E81DE6E549B37335B23A
|
||||
eclipse.preferences.version=1
|
||||
@@ -1,253 +0,0 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.h
|
||||
* @brief : Header for main.c file.
|
||||
* This file contains the common defines of the application.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define PC14_OSC32_IN_Pin GPIO_PIN_14
|
||||
#define PC14_OSC32_IN_GPIO_Port GPIOC
|
||||
#define PC15_OSC32_OUT_Pin GPIO_PIN_15
|
||||
#define PC15_OSC32_OUT_GPIO_Port GPIOC
|
||||
#define A0_Pin GPIO_PIN_0
|
||||
#define A0_GPIO_Port GPIOF
|
||||
#define A1_Pin GPIO_PIN_1
|
||||
#define A1_GPIO_Port GPIOF
|
||||
#define A2_Pin GPIO_PIN_2
|
||||
#define A2_GPIO_Port GPIOF
|
||||
#define A3_Pin GPIO_PIN_3
|
||||
#define A3_GPIO_Port GPIOF
|
||||
#define A4_Pin GPIO_PIN_4
|
||||
#define A4_GPIO_Port GPIOF
|
||||
#define A5_Pin GPIO_PIN_5
|
||||
#define A5_GPIO_Port GPIOF
|
||||
#define SPI5_SCK_Pin GPIO_PIN_7
|
||||
#define SPI5_SCK_GPIO_Port GPIOF
|
||||
#define SPI5_MISO_Pin GPIO_PIN_8
|
||||
#define SPI5_MISO_GPIO_Port GPIOF
|
||||
#define SPI5_MOSI_Pin GPIO_PIN_9
|
||||
#define SPI5_MOSI_GPIO_Port GPIOF
|
||||
#define ENABLE_Pin GPIO_PIN_10
|
||||
#define ENABLE_GPIO_Port GPIOF
|
||||
#define PH0_OSC_IN_Pin GPIO_PIN_0
|
||||
#define PH0_OSC_IN_GPIO_Port GPIOH
|
||||
#define PH1_OSC_OUT_Pin GPIO_PIN_1
|
||||
#define PH1_OSC_OUT_GPIO_Port GPIOH
|
||||
#define SDNWE_Pin GPIO_PIN_0
|
||||
#define SDNWE_GPIO_Port GPIOC
|
||||
#define NCS_MEMS_SPI_Pin GPIO_PIN_1
|
||||
#define NCS_MEMS_SPI_GPIO_Port GPIOC
|
||||
#define CSX_Pin GPIO_PIN_2
|
||||
#define CSX_GPIO_Port GPIOC
|
||||
#define B1_Pin GPIO_PIN_0
|
||||
#define B1_GPIO_Port GPIOA
|
||||
#define MEMS_INT1_Pin GPIO_PIN_1
|
||||
#define MEMS_INT1_GPIO_Port GPIOA
|
||||
#define MEMS_INT2_Pin GPIO_PIN_2
|
||||
#define MEMS_INT2_GPIO_Port GPIOA
|
||||
#define B5_Pin GPIO_PIN_3
|
||||
#define B5_GPIO_Port GPIOA
|
||||
#define VSYNC_Pin GPIO_PIN_4
|
||||
#define VSYNC_GPIO_Port GPIOA
|
||||
#define G2_Pin GPIO_PIN_6
|
||||
#define G2_GPIO_Port GPIOA
|
||||
#define ACP_RST_Pin GPIO_PIN_7
|
||||
#define ACP_RST_GPIO_Port GPIOA
|
||||
#define OTG_FS_PSO_Pin GPIO_PIN_4
|
||||
#define OTG_FS_PSO_GPIO_Port GPIOC
|
||||
#define OTG_FS_OC_Pin GPIO_PIN_5
|
||||
#define OTG_FS_OC_GPIO_Port GPIOC
|
||||
#define R3_Pin GPIO_PIN_0
|
||||
#define R3_GPIO_Port GPIOB
|
||||
#define R6_Pin GPIO_PIN_1
|
||||
#define R6_GPIO_Port GPIOB
|
||||
#define BOOT1_Pin GPIO_PIN_2
|
||||
#define BOOT1_GPIO_Port GPIOB
|
||||
#define SDNRAS_Pin GPIO_PIN_11
|
||||
#define SDNRAS_GPIO_Port GPIOF
|
||||
#define A6_Pin GPIO_PIN_12
|
||||
#define A6_GPIO_Port GPIOF
|
||||
#define A7_Pin GPIO_PIN_13
|
||||
#define A7_GPIO_Port GPIOF
|
||||
#define A8_Pin GPIO_PIN_14
|
||||
#define A8_GPIO_Port GPIOF
|
||||
#define A9_Pin GPIO_PIN_15
|
||||
#define A9_GPIO_Port GPIOF
|
||||
#define A10_Pin GPIO_PIN_0
|
||||
#define A10_GPIO_Port GPIOG
|
||||
#define A11_Pin GPIO_PIN_1
|
||||
#define A11_GPIO_Port GPIOG
|
||||
#define D4_Pin GPIO_PIN_7
|
||||
#define D4_GPIO_Port GPIOE
|
||||
#define D5_Pin GPIO_PIN_8
|
||||
#define D5_GPIO_Port GPIOE
|
||||
#define D6_Pin GPIO_PIN_9
|
||||
#define D6_GPIO_Port GPIOE
|
||||
#define D7_Pin GPIO_PIN_10
|
||||
#define D7_GPIO_Port GPIOE
|
||||
#define D8_Pin GPIO_PIN_11
|
||||
#define D8_GPIO_Port GPIOE
|
||||
#define D9_Pin GPIO_PIN_12
|
||||
#define D9_GPIO_Port GPIOE
|
||||
#define D10_Pin GPIO_PIN_13
|
||||
#define D10_GPIO_Port GPIOE
|
||||
#define D11_Pin GPIO_PIN_14
|
||||
#define D11_GPIO_Port GPIOE
|
||||
#define D12_Pin GPIO_PIN_15
|
||||
#define D12_GPIO_Port GPIOE
|
||||
#define G4_Pin GPIO_PIN_10
|
||||
#define G4_GPIO_Port GPIOB
|
||||
#define G5_Pin GPIO_PIN_11
|
||||
#define G5_GPIO_Port GPIOB
|
||||
#define OTG_HS_ID_Pin GPIO_PIN_12
|
||||
#define OTG_HS_ID_GPIO_Port GPIOB
|
||||
#define VBUS_HS_Pin GPIO_PIN_13
|
||||
#define VBUS_HS_GPIO_Port GPIOB
|
||||
#define OTG_HS_DM_Pin GPIO_PIN_14
|
||||
#define OTG_HS_DM_GPIO_Port GPIOB
|
||||
#define OTG_HS_DP_Pin GPIO_PIN_15
|
||||
#define OTG_HS_DP_GPIO_Port GPIOB
|
||||
#define D13_Pin GPIO_PIN_8
|
||||
#define D13_GPIO_Port GPIOD
|
||||
#define D14_Pin GPIO_PIN_9
|
||||
#define D14_GPIO_Port GPIOD
|
||||
#define D15_Pin GPIO_PIN_10
|
||||
#define D15_GPIO_Port GPIOD
|
||||
#define TE_Pin GPIO_PIN_11
|
||||
#define TE_GPIO_Port GPIOD
|
||||
#define RDX_Pin GPIO_PIN_12
|
||||
#define RDX_GPIO_Port GPIOD
|
||||
#define WRX_DCX_Pin GPIO_PIN_13
|
||||
#define WRX_DCX_GPIO_Port GPIOD
|
||||
#define D0_Pin GPIO_PIN_14
|
||||
#define D0_GPIO_Port GPIOD
|
||||
#define D1_Pin GPIO_PIN_15
|
||||
#define D1_GPIO_Port GPIOD
|
||||
#define BA0_Pin GPIO_PIN_4
|
||||
#define BA0_GPIO_Port GPIOG
|
||||
#define BA1_Pin GPIO_PIN_5
|
||||
#define BA1_GPIO_Port GPIOG
|
||||
#define R7_Pin GPIO_PIN_6
|
||||
#define R7_GPIO_Port GPIOG
|
||||
#define DOTCLK_Pin GPIO_PIN_7
|
||||
#define DOTCLK_GPIO_Port GPIOG
|
||||
#define SDCLK_Pin GPIO_PIN_8
|
||||
#define SDCLK_GPIO_Port GPIOG
|
||||
#define HSYNC_Pin GPIO_PIN_6
|
||||
#define HSYNC_GPIO_Port GPIOC
|
||||
#define G6_Pin GPIO_PIN_7
|
||||
#define G6_GPIO_Port GPIOC
|
||||
#define I2C3_SDA_Pin GPIO_PIN_9
|
||||
#define I2C3_SDA_GPIO_Port GPIOC
|
||||
#define I2C3_SCL_Pin GPIO_PIN_8
|
||||
#define I2C3_SCL_GPIO_Port GPIOA
|
||||
#define STLINK_RX_Pin GPIO_PIN_9
|
||||
#define STLINK_RX_GPIO_Port GPIOA
|
||||
#define STLINK_TX_Pin GPIO_PIN_10
|
||||
#define STLINK_TX_GPIO_Port GPIOA
|
||||
#define R4_Pin GPIO_PIN_11
|
||||
#define R4_GPIO_Port GPIOA
|
||||
#define R5_Pin GPIO_PIN_12
|
||||
#define R5_GPIO_Port GPIOA
|
||||
#define SWDIO_Pin GPIO_PIN_13
|
||||
#define SWDIO_GPIO_Port GPIOA
|
||||
#define SWCLK_Pin GPIO_PIN_14
|
||||
#define SWCLK_GPIO_Port GPIOA
|
||||
#define TP_INT1_Pin GPIO_PIN_15
|
||||
#define TP_INT1_GPIO_Port GPIOA
|
||||
#define R2_Pin GPIO_PIN_10
|
||||
#define R2_GPIO_Port GPIOC
|
||||
#define D2_Pin GPIO_PIN_0
|
||||
#define D2_GPIO_Port GPIOD
|
||||
#define D3_Pin GPIO_PIN_1
|
||||
#define D3_GPIO_Port GPIOD
|
||||
#define G7_Pin GPIO_PIN_3
|
||||
#define G7_GPIO_Port GPIOD
|
||||
#define B2_Pin GPIO_PIN_6
|
||||
#define B2_GPIO_Port GPIOD
|
||||
#define G3_Pin GPIO_PIN_10
|
||||
#define G3_GPIO_Port GPIOG
|
||||
#define B3_Pin GPIO_PIN_11
|
||||
#define B3_GPIO_Port GPIOG
|
||||
#define B4_Pin GPIO_PIN_12
|
||||
#define B4_GPIO_Port GPIOG
|
||||
#define LD3_Pin GPIO_PIN_13
|
||||
#define LD3_GPIO_Port GPIOG
|
||||
#define LD4_Pin GPIO_PIN_14
|
||||
#define LD4_GPIO_Port GPIOG
|
||||
#define SDNCAS_Pin GPIO_PIN_15
|
||||
#define SDNCAS_GPIO_Port GPIOG
|
||||
#define SDCKE1_Pin GPIO_PIN_5
|
||||
#define SDCKE1_GPIO_Port GPIOB
|
||||
#define SDNE1_Pin GPIO_PIN_6
|
||||
#define SDNE1_GPIO_Port GPIOB
|
||||
#define B6_Pin GPIO_PIN_8
|
||||
#define B6_GPIO_Port GPIOB
|
||||
#define B7_Pin GPIO_PIN_9
|
||||
#define B7_GPIO_Port GPIOB
|
||||
#define NBL0_Pin GPIO_PIN_0
|
||||
#define NBL0_GPIO_Port GPIOE
|
||||
#define NBL1_Pin GPIO_PIN_1
|
||||
#define NBL1_GPIO_Port GPIOE
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAIN_H */
|
||||
@@ -19,7 +19,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "usb_host.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@@ -48,10 +47,6 @@ DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
LTDC_HandleTypeDef hltdc;
|
||||
|
||||
SPI_HandleTypeDef hspi5;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
@@ -70,8 +65,6 @@ static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_LTDC_Init(void);
|
||||
static void MX_SPI5_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
@@ -118,8 +111,6 @@ int main(void)
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_LTDC_Init();
|
||||
MX_SPI5_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_USART1_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
@@ -185,7 +176,7 @@ void SystemClock_Config(void)
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
@@ -323,106 +314,6 @@ static void MX_I2C3_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LTDC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_LTDC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 0 */
|
||||
|
||||
/* USER CODE END LTDC_Init 0 */
|
||||
|
||||
LTDC_LayerCfgTypeDef pLayerCfg = {0};
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 1 */
|
||||
|
||||
/* USER CODE END LTDC_Init 1 */
|
||||
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 = 9;
|
||||
hltdc.Init.VerticalSync = 1;
|
||||
hltdc.Init.AccumulatedHBP = 29;
|
||||
hltdc.Init.AccumulatedVBP = 3;
|
||||
hltdc.Init.AccumulatedActiveW = 269;
|
||||
hltdc.Init.AccumulatedActiveH = 323;
|
||||
hltdc.Init.TotalWidth = 279;
|
||||
hltdc.Init.TotalHeigh = 327;
|
||||
hltdc.Init.Backcolor.Blue = 0;
|
||||
hltdc.Init.Backcolor.Green = 0;
|
||||
hltdc.Init.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
pLayerCfg.WindowX0 = 0;
|
||||
pLayerCfg.WindowX1 = 240;
|
||||
pLayerCfg.WindowY0 = 0;
|
||||
pLayerCfg.WindowY1 = 320;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||
pLayerCfg.Alpha = 255;
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
|
||||
pLayerCfg.FBStartAdress = 0xD0000000;
|
||||
pLayerCfg.ImageWidth = 240;
|
||||
pLayerCfg.ImageHeight = 320;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
pLayerCfg.Backcolor.Green = 0;
|
||||
pLayerCfg.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI5 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI5_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 0 */
|
||||
|
||||
/* USER CODE END SPI5_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 1 */
|
||||
|
||||
/* USER CODE END SPI5_Init 1 */
|
||||
/* SPI5 parameter configuration*/
|
||||
hspi5.Instance = SPI5;
|
||||
hspi5.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi5.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi5.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
|
||||
hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi5.Init.CRCPolynomial = 10;
|
||||
if (HAL_SPI_Init(&hspi5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI5_Init 2 */
|
||||
|
||||
/* USER CODE END SPI5_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
@@ -522,7 +413,7 @@ static void MX_FMC_Init(void)
|
||||
/* hsdram1.Init */
|
||||
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
|
||||
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_11;
|
||||
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
|
||||
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
|
||||
@@ -563,70 +454,52 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ACP_RST_GPIO_Port, ACP_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, RDX_Pin|WRX_DCX_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin OTG_FS_PSO_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin;
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : ACP_RST_Pin */
|
||||
GPIO_InitStruct.Pin = ACP_RST_Pin;
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ACP_RST_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : OTG_FS_OC_Pin */
|
||||
GPIO_InitStruct.Pin = OTG_FS_OC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(OTG_FS_OC_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : BOOT1_Pin */
|
||||
GPIO_InitStruct.Pin = BOOT1_Pin;
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(BOOT1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : TE_Pin */
|
||||
GPIO_InitStruct.Pin = TE_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(TE_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : RDX_Pin WRX_DCX_Pin */
|
||||
GPIO_InitStruct.Pin = RDX_Pin|WRX_DCX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
@@ -653,8 +526,6 @@ static void MX_GPIO_Init(void)
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* init code for USB_HOST */
|
||||
MX_USB_HOST_Init();
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
@@ -58,7 +58,7 @@ UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
//osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
@@ -145,15 +145,15 @@ int main(void)
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
//osKernelStart();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "usb_host.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@@ -48,17 +47,13 @@ DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
LTDC_HandleTypeDef hltdc;
|
||||
|
||||
SPI_HandleTypeDef hspi5;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
//osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
@@ -70,8 +65,6 @@ static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_LTDC_Init(void);
|
||||
static void MX_SPI5_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
@@ -94,7 +87,6 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
@@ -119,8 +111,6 @@ int main(void)
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_LTDC_Init();
|
||||
MX_SPI5_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_USART1_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
@@ -145,27 +135,36 @@ int main(void)
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
//osKernelStart();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
// userloop
|
||||
while (1)
|
||||
{
|
||||
// Flashing lights go here
|
||||
bool A_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_7) == GPIO_PIN_SET);
|
||||
bool B_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_9) == GPIO_PIN_SET);
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
if (A_pressed && B_pressed == true)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
|
||||
} else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
}
|
||||
//
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
HAL_DELAY(200); // milliseconds
|
||||
}
|
||||
/* USER CODE END 3 */
|
||||
}
|
||||
@@ -188,7 +187,7 @@ void SystemClock_Config(void)
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
@@ -326,106 +325,6 @@ static void MX_I2C3_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LTDC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_LTDC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 0 */
|
||||
|
||||
/* USER CODE END LTDC_Init 0 */
|
||||
|
||||
LTDC_LayerCfgTypeDef pLayerCfg = {0};
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 1 */
|
||||
|
||||
/* USER CODE END LTDC_Init 1 */
|
||||
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 = 9;
|
||||
hltdc.Init.VerticalSync = 1;
|
||||
hltdc.Init.AccumulatedHBP = 29;
|
||||
hltdc.Init.AccumulatedVBP = 3;
|
||||
hltdc.Init.AccumulatedActiveW = 269;
|
||||
hltdc.Init.AccumulatedActiveH = 323;
|
||||
hltdc.Init.TotalWidth = 279;
|
||||
hltdc.Init.TotalHeigh = 327;
|
||||
hltdc.Init.Backcolor.Blue = 0;
|
||||
hltdc.Init.Backcolor.Green = 0;
|
||||
hltdc.Init.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
pLayerCfg.WindowX0 = 0;
|
||||
pLayerCfg.WindowX1 = 240;
|
||||
pLayerCfg.WindowY0 = 0;
|
||||
pLayerCfg.WindowY1 = 320;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||
pLayerCfg.Alpha = 255;
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
|
||||
pLayerCfg.FBStartAdress = 0xD0000000;
|
||||
pLayerCfg.ImageWidth = 240;
|
||||
pLayerCfg.ImageHeight = 320;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
pLayerCfg.Backcolor.Green = 0;
|
||||
pLayerCfg.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI5 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI5_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 0 */
|
||||
|
||||
/* USER CODE END SPI5_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 1 */
|
||||
|
||||
/* USER CODE END SPI5_Init 1 */
|
||||
/* SPI5 parameter configuration*/
|
||||
hspi5.Instance = SPI5;
|
||||
hspi5.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi5.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi5.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
|
||||
hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi5.Init.CRCPolynomial = 10;
|
||||
if (HAL_SPI_Init(&hspi5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI5_Init 2 */
|
||||
|
||||
/* USER CODE END SPI5_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
@@ -525,7 +424,7 @@ static void MX_FMC_Init(void)
|
||||
/* hsdram1.Init */
|
||||
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
|
||||
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_11;
|
||||
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
|
||||
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
|
||||
@@ -566,70 +465,52 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ACP_RST_GPIO_Port, ACP_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, RDX_Pin|WRX_DCX_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin OTG_FS_PSO_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin;
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : ACP_RST_Pin */
|
||||
GPIO_InitStruct.Pin = ACP_RST_Pin;
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ACP_RST_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : OTG_FS_OC_Pin */
|
||||
GPIO_InitStruct.Pin = OTG_FS_OC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(OTG_FS_OC_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : BOOT1_Pin */
|
||||
GPIO_InitStruct.Pin = BOOT1_Pin;
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(BOOT1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : TE_Pin */
|
||||
GPIO_InitStruct.Pin = TE_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(TE_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : RDX_Pin WRX_DCX_Pin */
|
||||
GPIO_InitStruct.Pin = RDX_Pin|WRX_DCX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
@@ -656,8 +537,6 @@ static void MX_GPIO_Init(void)
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* init code for USB_HOST */
|
||||
MX_USB_HOST_Init();
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
@@ -19,7 +19,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "usb_host.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@@ -48,17 +47,13 @@ DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
LTDC_HandleTypeDef hltdc;
|
||||
|
||||
SPI_HandleTypeDef hspi5;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
//osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
@@ -70,8 +65,6 @@ static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_LTDC_Init(void);
|
||||
static void MX_SPI5_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
@@ -94,7 +87,6 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
@@ -119,8 +111,6 @@ int main(void)
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_LTDC_Init();
|
||||
MX_SPI5_Init();
|
||||
MX_TIM1_Init();
|
||||
MX_USART1_UART_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
@@ -145,15 +135,15 @@ int main(void)
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
//osKernelStart();
|
||||
|
||||
/* We should never get here as control is now taken by the scheduler */
|
||||
|
||||
@@ -161,8 +151,6 @@ int main(void)
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
@@ -188,7 +176,7 @@ void SystemClock_Config(void)
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
@@ -326,106 +314,6 @@ static void MX_I2C3_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LTDC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_LTDC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 0 */
|
||||
|
||||
/* USER CODE END LTDC_Init 0 */
|
||||
|
||||
LTDC_LayerCfgTypeDef pLayerCfg = {0};
|
||||
|
||||
/* USER CODE BEGIN LTDC_Init 1 */
|
||||
|
||||
/* USER CODE END LTDC_Init 1 */
|
||||
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 = 9;
|
||||
hltdc.Init.VerticalSync = 1;
|
||||
hltdc.Init.AccumulatedHBP = 29;
|
||||
hltdc.Init.AccumulatedVBP = 3;
|
||||
hltdc.Init.AccumulatedActiveW = 269;
|
||||
hltdc.Init.AccumulatedActiveH = 323;
|
||||
hltdc.Init.TotalWidth = 279;
|
||||
hltdc.Init.TotalHeigh = 327;
|
||||
hltdc.Init.Backcolor.Blue = 0;
|
||||
hltdc.Init.Backcolor.Green = 0;
|
||||
hltdc.Init.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
pLayerCfg.WindowX0 = 0;
|
||||
pLayerCfg.WindowX1 = 240;
|
||||
pLayerCfg.WindowY0 = 0;
|
||||
pLayerCfg.WindowY1 = 320;
|
||||
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
|
||||
pLayerCfg.Alpha = 255;
|
||||
pLayerCfg.Alpha0 = 0;
|
||||
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;
|
||||
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;
|
||||
pLayerCfg.FBStartAdress = 0xD0000000;
|
||||
pLayerCfg.ImageWidth = 240;
|
||||
pLayerCfg.ImageHeight = 320;
|
||||
pLayerCfg.Backcolor.Blue = 0;
|
||||
pLayerCfg.Backcolor.Green = 0;
|
||||
pLayerCfg.Backcolor.Red = 0;
|
||||
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN LTDC_Init 2 */
|
||||
|
||||
/* USER CODE END LTDC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SPI5 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_SPI5_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 0 */
|
||||
|
||||
/* USER CODE END SPI5_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN SPI5_Init 1 */
|
||||
|
||||
/* USER CODE END SPI5_Init 1 */
|
||||
/* SPI5 parameter configuration*/
|
||||
hspi5.Instance = SPI5;
|
||||
hspi5.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi5.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi5.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi5.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi5.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
hspi5.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
|
||||
hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi5.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi5.Init.CRCPolynomial = 10;
|
||||
if (HAL_SPI_Init(&hspi5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN SPI5_Init 2 */
|
||||
|
||||
/* USER CODE END SPI5_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
@@ -525,7 +413,7 @@ static void MX_FMC_Init(void)
|
||||
/* hsdram1.Init */
|
||||
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
|
||||
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
||||
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_11;
|
||||
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
|
||||
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
|
||||
@@ -566,70 +454,52 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(ACP_RST_GPIO_Port, ACP_RST_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, RDX_Pin|WRX_DCX_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin OTG_FS_PSO_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin|OTG_FS_PSO_Pin;
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : ACP_RST_Pin */
|
||||
GPIO_InitStruct.Pin = ACP_RST_Pin;
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(ACP_RST_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : OTG_FS_OC_Pin */
|
||||
GPIO_InitStruct.Pin = OTG_FS_OC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(OTG_FS_OC_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : BOOT1_Pin */
|
||||
GPIO_InitStruct.Pin = BOOT1_Pin;
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(BOOT1_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : TE_Pin */
|
||||
GPIO_InitStruct.Pin = TE_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(TE_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : RDX_Pin WRX_DCX_Pin */
|
||||
GPIO_InitStruct.Pin = RDX_Pin|WRX_DCX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
@@ -656,8 +526,6 @@ static void MX_GPIO_Init(void)
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* init code for USB_HOST */
|
||||
MX_USB_HOST_Init();
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
@@ -0,0 +1,568 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
CRC_HandleTypeDef hcrc;
|
||||
|
||||
DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void SystemClock_Config(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
int 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();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CRC_Init();
|
||||
MX_DMA2D_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_TIM1_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 */
|
||||
|
||||
/* USER CODE BEGIN RTOS_QUEUES */
|
||||
/* add queues, ... */
|
||||
/* USER CODE END RTOS_QUEUES */
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* 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 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 72;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 3;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
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_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CRC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_CRC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 0 */
|
||||
|
||||
/* USER CODE END CRC_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 1 */
|
||||
|
||||
/* USER CODE END CRC_Init 1 */
|
||||
hcrc.Instance = CRC;
|
||||
if (HAL_CRC_Init(&hcrc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CRC_Init 2 */
|
||||
|
||||
/* USER CODE END CRC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA2D Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_DMA2D_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 1 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 1 */
|
||||
hdma2d.Instance = DMA2D;
|
||||
hdma2d.Init.Mode = DMA2D_M2M;
|
||||
hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
|
||||
hdma2d.Init.OutputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
|
||||
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
||||
hdma2d.LayerCfg[1].InputAlpha = 0;
|
||||
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN DMA2D_Init 2 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C3 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_I2C3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 0 */
|
||||
|
||||
/* USER CODE END I2C3_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 1 */
|
||||
|
||||
/* USER CODE END I2C3_Init 1 */
|
||||
hi2c3.Instance = I2C3;
|
||||
hi2c3.Init.ClockSpeed = 100000;
|
||||
hi2c3.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||
hi2c3.Init.OwnAddress1 = 0;
|
||||
hi2c3.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c3.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
hi2c3.Init.OwnAddress2 = 0;
|
||||
hi2c3.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
||||
hi2c3.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
||||
if (HAL_I2C_Init(&hi2c3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Analogue filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigAnalogFilter(&hi2c3, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Digital filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigDigitalFilter(&hi2c3, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN I2C3_Init 2 */
|
||||
|
||||
/* USER CODE END I2C3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 0 */
|
||||
|
||||
/* USER CODE END TIM1_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 1 */
|
||||
|
||||
/* USER CODE END TIM1_Init 1 */
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 65535;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM1_Init 2 */
|
||||
|
||||
/* USER CODE END TIM1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USART1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_USART1_UART_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 0 */
|
||||
|
||||
/* USER CODE END USART1_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 1 */
|
||||
|
||||
/* USER CODE END USART1_Init 1 */
|
||||
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;
|
||||
if (HAL_UART_Init(&huart1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN USART1_Init 2 */
|
||||
|
||||
/* USER CODE END USART1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GPIO Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_GPIO_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
/* USER CODE BEGIN MX_GPIO_Init_1 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_1 */
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PC3 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_3;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : SDCKE1_Pin SDNE1_Pin */
|
||||
GPIO_InitStruct.Pin = SDCKE1_Pin|SDNE1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_2 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
osDelay(1);
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM6 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
bool A_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_7) == GPIO_PIN_SET);
|
||||
bool B_pressed = (HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_9) == GPIO_PIN_SET);
|
||||
|
||||
if (A_pressed && B_pressed == true)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_SET);
|
||||
} else
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
|
||||
}
|
||||
//
|
||||
|
||||
HAL_DELAY(200); // milliseconds
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
#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 /* USE_FULL_ASSERT */
|
||||
@@ -0,0 +1,555 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PTD */
|
||||
|
||||
/* USER CODE END PTD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
CRC_HandleTypeDef hcrc;
|
||||
|
||||
DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
I2C_HandleTypeDef hi2c3;
|
||||
|
||||
TIM_HandleTypeDef htim1;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
osThreadId defaultTaskHandle;
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
void SystemClock_Config(void);
|
||||
static void MX_GPIO_Init(void);
|
||||
static void MX_CRC_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_I2C3_Init(void);
|
||||
static void MX_TIM1_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
void StartDefaultTask(void const * argument);
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
int 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();
|
||||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config();
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CRC_Init();
|
||||
MX_DMA2D_Init();
|
||||
MX_I2C3_Init();
|
||||
MX_TIM1_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 */
|
||||
|
||||
/* USER CODE BEGIN RTOS_QUEUES */
|
||||
/* add queues, ... */
|
||||
/* USER CODE END RTOS_QUEUES */
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* 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 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
|
||||
|
||||
/** Initializes the RCC Oscillators according to the specified parameters
|
||||
* in the RCC_OscInitTypeDef structure.
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 72;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 3;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
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_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CRC Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_CRC_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 0 */
|
||||
|
||||
/* USER CODE END CRC_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN CRC_Init 1 */
|
||||
|
||||
/* USER CODE END CRC_Init 1 */
|
||||
hcrc.Instance = CRC;
|
||||
if (HAL_CRC_Init(&hcrc) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN CRC_Init 2 */
|
||||
|
||||
/* USER CODE END CRC_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA2D Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_DMA2D_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN DMA2D_Init 1 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 1 */
|
||||
hdma2d.Instance = DMA2D;
|
||||
hdma2d.Init.Mode = DMA2D_M2M;
|
||||
hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
|
||||
hdma2d.Init.OutputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputOffset = 0;
|
||||
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
|
||||
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
|
||||
hdma2d.LayerCfg[1].InputAlpha = 0;
|
||||
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN DMA2D_Init 2 */
|
||||
|
||||
/* USER CODE END DMA2D_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C3 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_I2C3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 0 */
|
||||
|
||||
/* USER CODE END I2C3_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN I2C3_Init 1 */
|
||||
|
||||
/* USER CODE END I2C3_Init 1 */
|
||||
hi2c3.Instance = I2C3;
|
||||
hi2c3.Init.ClockSpeed = 100000;
|
||||
hi2c3.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||
hi2c3.Init.OwnAddress1 = 0;
|
||||
hi2c3.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c3.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
hi2c3.Init.OwnAddress2 = 0;
|
||||
hi2c3.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
||||
hi2c3.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
||||
if (HAL_I2C_Init(&hi2c3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Analogue filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigAnalogFilter(&hi2c3, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/** Configure Digital filter
|
||||
*/
|
||||
if (HAL_I2CEx_ConfigDigitalFilter(&hi2c3, 0) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN I2C3_Init 2 */
|
||||
|
||||
/* USER CODE END I2C3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM1_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 0 */
|
||||
|
||||
/* USER CODE END TIM1_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM1_Init 1 */
|
||||
|
||||
/* USER CODE END TIM1_Init 1 */
|
||||
htim1.Instance = TIM1;
|
||||
htim1.Init.Prescaler = 0;
|
||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim1.Init.Period = 65535;
|
||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim1.Init.RepetitionCounter = 0;
|
||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM1_Init 2 */
|
||||
|
||||
/* USER CODE END TIM1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USART1 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_USART1_UART_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 0 */
|
||||
|
||||
/* USER CODE END USART1_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN USART1_Init 1 */
|
||||
|
||||
/* USER CODE END USART1_Init 1 */
|
||||
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;
|
||||
if (HAL_UART_Init(&huart1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN USART1_Init 2 */
|
||||
|
||||
/* USER CODE END USART1_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief GPIO Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_GPIO_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
/* USER CODE BEGIN MX_GPIO_Init_1 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_1 */
|
||||
|
||||
/* GPIO Ports Clock Enable */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, NCS_MEMS_SPI_Pin|CSX_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(LD_Ext_GPIO_Port, LD_Ext_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOG, LD3_Pin|LD4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : NCS_MEMS_SPI_Pin CSX_Pin */
|
||||
GPIO_InitStruct.Pin = NCS_MEMS_SPI_Pin|CSX_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PC3 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_3;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B1_Pin MEMS_INT2_Pin TP_INT1_Pin */
|
||||
GPIO_InitStruct.Pin = B1_Pin|MEMS_INT2_Pin|TP_INT1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : B5_Pin VSYNC_Pin */
|
||||
GPIO_InitStruct.Pin = B5_Pin|VSYNC_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : LD_Ext_Pin */
|
||||
GPIO_InitStruct.Pin = LD_Ext_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(LD_Ext_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pin : PB1 */
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : LD3_Pin LD4_Pin */
|
||||
GPIO_InitStruct.Pin = LD3_Pin|LD4_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : SDCKE1_Pin SDNE1_Pin */
|
||||
GPIO_InitStruct.Pin = SDCKE1_Pin|SDNE1_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||
|
||||
/* USER CODE END MX_GPIO_Init_2 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
osDelay(1);
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM6 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
*/
|
||||
void Error_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
#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 /* USE_FULL_ASSERT */
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
eclipse.preferences.version=1
|
||||
indexer/indexAllFiles=true
|
||||
indexer/indexAllHeaderVersions=false
|
||||
indexer/indexImportLocation=.settings/cdt-index.zip
|
||||
indexer/indexOnOpen=false
|
||||
indexer/indexUnusedHeadersWithAlternateLang=false
|
||||
indexer/indexUnusedHeadersWithDefaultLang=true
|
||||
indexer/indexerId=org.eclipse.cdt.core.fastIndexer
|
||||
indexer/preferenceScope=1
|
||||
indexer/skipFilesLargerThanMB=8
|
||||
indexer/skipImplicitReferences=false
|
||||
indexer/skipIncludedFilesLargerThanMB=16
|
||||
indexer/skipMacroReferences=false
|
||||
indexer/skipReferences=false
|
||||
indexer/skipTypeReferences=false
|
||||
indexer/useHeuristicIncludeResolution=true
|
||||
@@ -1,3 +1,5 @@
|
||||
eclipse.preferences.version=1
|
||||
properties/Calculator.null.2145936831/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1886963290=com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1886963290\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.423903262\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.255231222\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.546261214\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1787019455\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1456687213\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1268780921\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.912101704\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.202497991\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.513122859\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1507567127\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1106615152\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1504195571\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1219247456\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.2111416655\=rebuildState\\\=true\\n\n
|
||||
properties/Calculator.null.2145936831/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.1667077525=com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.422003303\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.111557008\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1052324815\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1384674110\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.672981160\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1844577398\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1577836230\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1085120613\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.882897823\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.754790563\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1342149954\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1680861613\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1988390204\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.1990850007\=rebuildState\\\=true\\n\n
|
||||
properties/MyNewProject.null.83337167/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1448234781=com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1448234781\=rcState\\\=0\\nrebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.354596405\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1252437589\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1056844319\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.2122207330\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1818827388\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.2139901750\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.805388918\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1558625880\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.2053603272\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.475412361\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1380220275\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.525858151\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.292402102\=rebuildState\\\=false\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.271126730\=rebuildState\\\=false\\n\n
|
||||
properties/MyNewProject.null.83337167/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.1285969537=com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.144819249\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.379559059\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2036727211\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.980685916\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1426522156\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1237423215\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1282775561\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1912732982\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1219327809\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.899390694\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1885585371\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1401195929\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.337205154\=rebuildState\\\=true\\n\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.167142367\=rebuildState\\\=true\\n\n
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
platformState=766020170201574
|
||||
platformState=766020774880702
|
||||
quickStart=false
|
||||
tipsAndTricks=true
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="ShowViewDialog">
|
||||
<item key="DIALOG_X_ORIGIN" value="764"/>
|
||||
<item key="DIALOG_Y_ORIGIN" value="232"/>
|
||||
<item key="DIALOG_WIDTH" value="375"/>
|
||||
<item key="DIALOG_HEIGHT" value="449"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Sans|10.0|0|GTK|1|"/>
|
||||
</section>
|
||||
</section>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="ASCII"?>
|
||||
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_PGuWwIj-EfCcBcPyH3_z_g" elementId="org.eclipse.e4.legacy.ide.application" contributorURI="platform:/plugin/org.eclipse.ui.workbench" selectedElement="_PGuWwYj-EfCcBcPyH3_z_g" bindingContexts="_PGuWyoj-EfCcBcPyH3_z_g">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<workbench>
<mruList>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="com.st.stm32cube.common.mx.startCubeMx" name="MyNewProject.ioc" tooltip="MyNewProject/MyNewProject.ioc">
<persistable path="/MyNewProject/MyNewProject.ioc"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="main.h" tooltip="MyNewProject/Core/Inc/main.h">
<persistable path="/MyNewProject/Core/Inc/main.h"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="main.c" tooltip="MyNewProject/Core/Src/main.c">
<persistable path="/MyNewProject/Core/Src/main.c"/>
</file>
</mruList>
</workbench>"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<workbench>
<mruList>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="main.c" tooltip="Calculator/Core/Src/main.c">
<persistable path="/Calculator/Core/Src/main.c"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="cmsis_os.h" tooltip="Calculator/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h">
<persistable path="/Calculator/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="com.st.stm32cube.common.mx.startCubeMx" name="Calculator.ioc" tooltip="Calculator/Calculator.ioc">
<persistable path="/Calculator/Calculator.ioc"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="main.c" tooltip="MyNewProject/Core/Src/main.c">
<persistable path="/MyNewProject/Core/Src/main.c"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="stm32f4xx_hal_gpio.c" tooltip="MyNewProject/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c">
<persistable path="/MyNewProject/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="com.st.stm32cube.common.mx.startCubeMx" name="MyNewProject.ioc" tooltip="MyNewProject/MyNewProject.ioc">
<persistable path="/MyNewProject/MyNewProject.ioc"/>
</file>
<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.cdt.ui.editor.CEditor" name="main.h" tooltip="MyNewProject/Core/Inc/main.h">
<persistable path="/MyNewProject/Core/Inc/main.h"/>
</file>
</mruList>
</workbench>"/>
|
||||
<tags>activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration</tags>
|
||||
<children xsi:type="basic:TrimmedWindow" xmi:id="_PGuWwYj-EfCcBcPyH3_z_g" elementId="IDEWindow" contributorURI="platform:/plugin/org.eclipse.ui.workbench" selectedElement="_QzO74Ij-EfCcBcPyH3_z_g" x="0" y="31" width="950" height="1063">
|
||||
<children xsi:type="basic:TrimmedWindow" xmi:id="_PGuWwYj-EfCcBcPyH3_z_g" elementId="IDEWindow" contributorURI="platform:/plugin/org.eclipse.ui.workbench" selectedElement="_QzO74Ij-EfCcBcPyH3_z_g" x="10" y="32" width="950" height="1063">
|
||||
<persistedState key="coolBarVisible" value="true"/>
|
||||
<persistedState key="perspectiveBarVisible" value="true"/>
|
||||
<persistedState key="isRestored" value="true"/>
|
||||
@@ -160,13 +160,13 @@
|
||||
<tags>persp.newWizSC:com.st.stm32cube.ide.mpu.linux.projectcreation.ui.wizard.linuxprojectfromsourcewizard</tags>
|
||||
<tags>persp.newWizSC:com.st.stm32cube.ide.cmake.newwizard</tags>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_A9HiUYj_EfCcBcPyH3_z_g" selectedElement="_A9HiVIj_EfCcBcPyH3_z_g" horizontal="true">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_A9HiUoj_EfCcBcPyH3_z_g" elementId="left" containerData="1484" selectedElement="_A9HiU4j_EfCcBcPyH3_z_g">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_A9HiUoj_EfCcBcPyH3_z_g" elementId="left" containerData="1825" selectedElement="_A9HiU4j_EfCcBcPyH3_z_g">
|
||||
<children xsi:type="advanced:Placeholder" xmi:id="_A9HiU4j_EfCcBcPyH3_z_g" elementId="org.eclipse.ui.navigator.ProjectExplorer" ref="_Q2iHgIj-EfCcBcPyH3_z_g" closeable="true">
|
||||
<tags>View</tags>
|
||||
<tags>categoryTag:General</tags>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_A9HiVIj_EfCcBcPyH3_z_g" containerData="8516" selectedElement="_A9HiVYj_EfCcBcPyH3_z_g">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_A9HiVIj_EfCcBcPyH3_z_g" containerData="8175" selectedElement="_A9HiVYj_EfCcBcPyH3_z_g">
|
||||
<children xsi:type="advanced:Placeholder" xmi:id="_A9HiVYj_EfCcBcPyH3_z_g" elementId="org.eclipse.ui.editorss" containerData="9000" ref="_Q2bZ0Ij-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_A9HiVoj_EfCcBcPyH3_z_g" toBeRendered="false" containerData="1000">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_A9HiV4j_EfCcBcPyH3_z_g" elementId="topRight" toBeRendered="false" containerData="5000"/>
|
||||
@@ -221,18 +221,12 @@
|
||||
<tags>categoryTag:Help</tags>
|
||||
</sharedElements>
|
||||
<sharedElements xsi:type="advanced:Area" xmi:id="_Q2bZ0Ij-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.editorss" selectedElement="_Q2bZ0Yj-EfCcBcPyH3_z_g">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_Q2bZ0Yj-EfCcBcPyH3_z_g" elementId="org.eclipse.e4.primaryDataStack" selectedElement="_G0BzkIzqEfCZ0u2Wn-GpjQ">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_Q2bZ0Yj-EfCcBcPyH3_z_g" elementId="org.eclipse.e4.primaryDataStack" selectedElement="_0RJ2sI6IEfCwEoqT84gjuQ">
|
||||
<tags>EditorStack</tags>
|
||||
<tags>org.eclipse.e4.primaryDataStack</tags>
|
||||
<tags>active</tags>
|
||||
<children xsi:type="basic:Part" xmi:id="_U8Vp0Ij_EfCcBcPyH3_z_g" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="main.c" iconURI="platform:/plugin/org.eclipse.cdt.ui/icons/obj16/c_file_obj.gif" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.cdt.ui.editor.CEditor" name="main.c" partName="main.c" title="main.c" tooltip="MyNewProject/Core/Src/main.c">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/MyNewProject/Core/Src/main.c"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="2266" selectionTopPixel="959"/>
</editor>"/>
|
||||
<tags>Editor</tags>
|
||||
<tags>removeOnHide</tags>
|
||||
<tags>org.eclipse.cdt.ui.editor.CEditor</tags>
|
||||
</children>
|
||||
<children xsi:type="basic:Part" xmi:id="_G0BzkIzqEfCZ0u2Wn-GpjQ" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="main.h" iconURI="platform:/plugin/org.eclipse.cdt.ui/icons/obj16/c_file_obj.gif" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.cdt.ui.editor.CEditor" name="main.h" partName="main.h" title="main.h" tooltip="MyNewProject/Core/Inc/main.h">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/MyNewProject/Core/Inc/main.h"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="2021" selectionTopPixel="780"/>
</editor>"/>
|
||||
<children xsi:type="basic:Part" xmi:id="_0RJ2sI6IEfCwEoqT84gjuQ" elementId="org.eclipse.e4.ui.compatibility.editor" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor" label="main.c" iconURI="platform:/plugin/org.eclipse.cdt.ui/icons/obj16/c_file_obj.gif" closeable="true">
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<editor id="org.eclipse.cdt.ui.editor.CEditor" name="main.c" partName="main.c" title="main.c" tooltip="Calculator/Core/Src/main.c">
<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/Calculator/Core/Src/main.c"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="11928" selectionTopPixel="7714"/>
</editor>"/>
|
||||
<tags>Editor</tags>
|
||||
<tags>removeOnHide</tags>
|
||||
<tags>org.eclipse.cdt.ui.editor.CEditor</tags>
|
||||
@@ -268,7 +262,7 @@
|
||||
<sharedElements xsi:type="basic:Part" xmi:id="_Q2j8sYj-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.views.ProblemView" contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" label="Problems" iconURI="platform:/plugin/org.eclipse.ui.ide/icons/full/eview16/problems_view.png" tooltip="" closeable="true">
|
||||
<persistedState key="originalCompatibilityViewClass" value="org.eclipse.ui.internal.views.markers.ProblemsView"/>
|
||||
<persistedState key="originalCompatibilityViewBundle" value="org.eclipse.ui.ide"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<view PRIMARY_SORT_FIELD="org.eclipse.ui.ide.severityAndDescriptionField" categoryGroup="org.eclipse.ui.ide.severity" markerContentGenerator="org.eclipse.ui.ide.problemsGenerator">
<columnWidths org.eclipse.ui.ide.locationField="105" org.eclipse.ui.ide.markerType="105" org.eclipse.ui.ide.pathField="140" org.eclipse.ui.ide.resourceField="105" org.eclipse.ui.ide.severityAndDescriptionField="350"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.resourceField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.pathField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.locationField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</view>"/>
|
||||
<persistedState key="memento" value="<?xml version="1.0" encoding="UTF-8"?>
<view PRIMARY_SORT_FIELD="org.eclipse.ui.ide.severityAndDescriptionField" categoryGroup="org.eclipse.ui.ide.severity" markerContentGenerator="org.eclipse.ui.ide.problemsGenerator">
<expanded>
<category IMemento.internal.id="Warnings (1 item)"/>
</expanded>
<columnWidths org.eclipse.ui.ide.locationField="105" org.eclipse.ui.ide.markerType="105" org.eclipse.ui.ide.pathField="140" org.eclipse.ui.ide.resourceField="105" org.eclipse.ui.ide.severityAndDescriptionField="350"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.resourceField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.pathField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.locationField"/>
<visible IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</view>"/>
|
||||
<tags>View</tags>
|
||||
<tags>categoryTag:General</tags>
|
||||
<menus xmi:id="_Q8Y34Ij-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.views.ProblemView">
|
||||
@@ -392,7 +386,7 @@
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0SEwIj-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.workbench.file">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_h8MQgIzmEfCZ0u2Wn-GpjQ" elementId="print" visible="false" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.png" tooltip="Print" command="_PHEVMIj-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_lyzTkI6EEfCwEoqT84gjuQ" elementId="print" visible="false" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/print_edit.png" tooltip="Print" command="_PHEVMIj-EfCcBcPyH3_z_g"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0SEwYj-EfCcBcPyH3_z_g" elementId="group.edit" toBeRendered="false">
|
||||
<tags>toolbarSeparator</tags>
|
||||
@@ -400,8 +394,8 @@
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0SEw4j-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.workbench.edit">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_h8NeoIzmEfCZ0u2Wn-GpjQ" elementId="undo" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/undo_edit.png" tooltip="Undo" enabled="false" command="_PHEVHoj-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_h8OFsIzmEfCZ0u2Wn-GpjQ" elementId="redo" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/redo_edit.png" tooltip="Redo" enabled="false" command="_PHFjQYj-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_ly0hsI6EEfCwEoqT84gjuQ" elementId="undo" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/undo_edit.png" tooltip="Undo" command="_PHEVHoj-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_ly1IwI6EEfCwEoqT84gjuQ" elementId="redo" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/redo_edit.png" tooltip="Redo" enabled="false" command="_PHFjQYj-EfCcBcPyH3_z_g"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0SExIj-EfCcBcPyH3_z_g" elementId="additions" toBeRendered="false">
|
||||
<tags>toolbarSeparator</tags>
|
||||
@@ -425,7 +419,7 @@
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0SEyIj-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.workbench.navigate">
|
||||
<tags>Draggable</tags>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_h8PT0IzmEfCZ0u2Wn-GpjQ" elementId="org.eclipse.ui.window.pinEditor" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/pin_editor.png" tooltip="Pin Editor" type="Check" command="_PHDuDoj-EfCcBcPyH3_z_g"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_ly1v0o6EEfCwEoqT84gjuQ" elementId="org.eclipse.ui.window.pinEditor" iconURI="platform:/plugin/org.eclipse.ui/icons/full/etool16/pin_editor.png" tooltip="Pin Editor" type="Check" command="_PHDuDoj-EfCcBcPyH3_z_g"/>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_Q0Sr0Ij-EfCcBcPyH3_z_g" elementId="group.editor" toBeRendered="false">
|
||||
<tags>toolbarSeparator</tags>
|
||||
@@ -1964,7 +1958,7 @@
|
||||
<addons xmi:id="_PGuW1oj-EfCcBcPyH3_z_g" elementId="MinMax Addon" contributorURI="platform:/plugin/org.eclipse.ui.workbench" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon"/>
|
||||
<addons xmi:id="_PGuW14j-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.workbench.addon.0" contributorURI="platform:/plugin/org.eclipse.ui.workbench" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
|
||||
<addons xmi:id="_PG1rgIj-EfCcBcPyH3_z_g" elementId="SplitterAddon" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.splitteraddon.SplitterAddon"/>
|
||||
<addons xmi:id="_IYS0IKimEeS11vbz3f9ezw" elementId="org.eclipse.ui.ide.addon.0" contributorURI="platform:/plugin/org.eclipse.ui.ide" contributionURI="bundleclass://org.eclipse.ui.ide/org.eclipse.ui.internal.ide.addons.SaveAllDirtyPartsAddon"/>
|
||||
<addons xmi:id="_kzJ0cI6EEfCwEoqT84gjuQ" elementId="org.eclipse.ui.ide.addon.0" contributionURI="bundleclass://org.eclipse.ui.ide/org.eclipse.ui.internal.ide.addons.SaveAllDirtyPartsAddon"/>
|
||||
<addons xmi:id="_dz0JgGOlEeSMMaPQU2nlzw" elementId="org.eclipse.ui.ide.application.addon.0" contributorURI="platform:/plugin/org.eclipse.ui.ide.application" contributionURI="bundleclass://org.eclipse.ui.ide.application/org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon"/>
|
||||
<categories xmi:id="_PHADkIj-EfCcBcPyH3_z_g" elementId="org.eclipse.team.ui.category.team" name="Version control (Team)" description="Actions that apply when working with a version control system"/>
|
||||
<categories xmi:id="_PHAqoIj-EfCcBcPyH3_z_g" elementId="org.eclipse.ui.category.views" name="Views" description="Commands for opening views"/>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<session version="1.0">
|
||||
<refactoring comment="Delete resource 'Calculator'" deleteContents="false" description="Delete resource 'Calculator'" element1="/Calculator" flags="7" id="org.eclipse.ltk.core.refactoring.delete.resources" resources="1" stamp="1757536245994"/>
|
||||
</session>
|
||||
@@ -0,0 +1 @@
|
||||
1757536245994 Delete resource 'Calculator'
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="RefactoringWizard.preview">
|
||||
<item key="width" value="600"/>
|
||||
<item key="height" value="400"/>
|
||||
</section>
|
||||
</section>
|
||||
@@ -3,4 +3,20 @@
|
||||
<section name="ExternalProjectImportWizard">
|
||||
<item key="WizardProjectsImportPage.STORE_NESTED_PROJECTS" value="true"/>
|
||||
</section>
|
||||
<section name="SmartImportWizard">
|
||||
<item key="SmartImportRootWizardPage.STORE_HIDE_ALREADY_OPEN" value="false"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_CLOSE_IMPORTED" value="false"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_NESTED_PROJECTS" value="true"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_CONFIGURE_NATURES" value="true"/>
|
||||
<list key="org.eclipse.ui.internal.wizards.datatransfer.SmartImportRootWizardPage.knownSources">
|
||||
<item value="/home/ja/Desktop/UTMProject/Calculator"/>
|
||||
</list>
|
||||
<section name="SmartImportWizard.dialogBounds">
|
||||
<item key="DIALOG_X_ORIGIN" value="501"/>
|
||||
<item key="DIALOG_Y_ORIGIN" value="81"/>
|
||||
<item key="DIALOG_WIDTH" value="901"/>
|
||||
<item key="DIALOG_HEIGHT" value="676"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Sans|10.0|0|GTK|1|"/>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
<item key="hasShownOverlayPopupBefore" value="true"/>
|
||||
<item key="replaceBarOpen" value="false"/>
|
||||
<list key="searchhistory">
|
||||
<item value="thread"/>
|
||||
<item value="osthread"/>
|
||||
<item value="Thread"/>
|
||||
<item value="while (1"/>
|
||||
<item value="while"/>
|
||||
<item value="B1_Pin"/>
|
||||
<item value="osThreadDef"/>
|
||||
<item value="osThreadId"/>
|
||||
<item value="while (1)"/>
|
||||
<item value="Hal_GPIO_R"/>
|
||||
<item value="GPIO"/>
|
||||
<item value="PF"/>
|
||||
<item value="PE"/>
|
||||
|
||||
@@ -7,4 +7,13 @@
|
||||
<item key="DIALOG_HEIGHT" value="751"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Sans|10.0|0|GTK|1|"/>
|
||||
</section>
|
||||
<section name="ImportExportAction">
|
||||
<section name="ImportExportWizard.dialogBounds">
|
||||
<item key="DIALOG_X_ORIGIN" value="645"/>
|
||||
<item key="DIALOG_Y_ORIGIN" value="185"/>
|
||||
<item key="DIALOG_WIDTH" value="613"/>
|
||||
<item key="DIALOG_HEIGHT" value="550"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Sans|10.0|0|GTK|1|"/>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Mon Sep 08 14:03:27 CDT 2025
|
||||
#Wed Sep 10 15:27:29 CDT 2025
|
||||
org.eclipse.core.runtime=2
|
||||
org.eclipse.platform=4.33.0.v20240903-0240
|
||||
|
||||
Reference in New Issue
Block a user