first software regen

This commit is contained in:
2025-02-23 01:57:50 +01:00
parent c1c85c276e
commit c30b708f92
156 changed files with 213266 additions and 208058 deletions

View File

@ -19,6 +19,7 @@
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_touchgfx.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
@ -45,6 +46,8 @@
/* Private variables ---------------------------------------------------------*/
CRC_HandleTypeDef hcrc;
FDCAN_HandleTypeDef hfdcan1;
I2C_HandleTypeDef hi2c4;
@ -60,10 +63,6 @@ PCD_HandleTypeDef hpcd_USB_OTG_HS;
SDRAM_HandleTypeDef hsdram1;
uint16_t setpoint = 0;
float currentsetpoint = 0.0;
float voltagesetpoint = 3.8;
/* USER CODE BEGIN PV */
/* USER CODE END PV */
@ -80,6 +79,7 @@ static void MX_USART10_UART_Init(void);
static void MX_USB_OTG_HS_PCD_Init(void);
static void MX_UART5_Init(void);
static void MX_LTDC_Init(void);
static void MX_CRC_Init(void);
/* USER CODE BEGIN PFP */
uint32_t MemoryCheck(UART_HandleTypeDef *uart_console, SDRAM_HandleTypeDef *sram);
/* USER CODE END PFP */
@ -96,6 +96,7 @@ uint32_t MemoryCheck(UART_HandleTypeDef *uart_console, SDRAM_HandleTypeDef *sram
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
@ -112,7 +113,7 @@ int main(void)
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* USER CODE BEGIN SysInit */
@ -122,13 +123,15 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_FDCAN1_Init();
//MX_FMC_Init();
MX_FMC_Init();
MX_I2C4_Init();
//MX_SDMMC2_SD_Init();
MX_SDMMC2_SD_Init();
MX_USART10_UART_Init();
MX_USB_OTG_HS_PCD_Init();
MX_UART5_Init();
//MX_LTDC_Init();
MX_LTDC_Init();
MX_CRC_Init();
MX_TouchGFX_Init();
/* USER CODE BEGIN 2 */
//uint32_t sdramcheck = MemoryCheck(&huart5, &hsdram1);
@ -150,6 +153,7 @@ int main(void)
{
/* USER CODE END WHILE */
MX_TouchGFX_Process();
/* USER CODE BEGIN 3 */
@ -188,10 +192,6 @@ void SystemClock_Config(void)
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Macro to configure the PLL clock source
*/
__HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE);
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
@ -259,6 +259,37 @@ void PeriphCommonClock_Config(void)
}
}
/**
* @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;
hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
if (HAL_CRC_Init(&hcrc) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN CRC_Init 2 */
/* USER CODE END CRC_Init 2 */
}
/**
* @brief FDCAN1 Initialization Function
* @param None
@ -398,11 +429,11 @@ static void MX_LTDC_Init(void)
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 0;
pLayerCfg.WindowX1 = 1024;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 0;
pLayerCfg.WindowY1 = 600;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB888;
pLayerCfg.Alpha = 0;
pLayerCfg.Alpha = 1;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
@ -666,6 +697,8 @@ static void MX_FMC_Init(void)
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_GPIOE_CLK_ENABLE();
@ -729,6 +762,8 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(Charger_Remote_Shutdown_GPIO_Port, &GPIO_InitStruct);
/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
}
/* USER CODE BEGIN 4 */

View File

@ -63,6 +63,7 @@
*/
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
@ -76,6 +77,51 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
/**
* @brief CRC MSP Initialization
* This function configures the hardware resources used in this example
* @param hcrc: CRC handle pointer
* @retval None
*/
void HAL_CRC_MspInit(CRC_HandleTypeDef* hcrc)
{
if(hcrc->Instance==CRC)
{
/* USER CODE BEGIN CRC_MspInit 0 */
/* USER CODE END CRC_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_CRC_CLK_ENABLE();
/* USER CODE BEGIN CRC_MspInit 1 */
/* USER CODE END CRC_MspInit 1 */
}
}
/**
* @brief CRC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hcrc: CRC handle pointer
* @retval None
*/
void HAL_CRC_MspDeInit(CRC_HandleTypeDef* hcrc)
{
if(hcrc->Instance==CRC)
{
/* USER CODE BEGIN CRC_MspDeInit 0 */
/* USER CODE END CRC_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_CRC_CLK_DISABLE();
/* USER CODE BEGIN CRC_MspDeInit 1 */
/* USER CODE END CRC_MspDeInit 1 */
}
}
/**
* @brief FDCAN MSP Initialization
* This function configures the hardware resources used in this example
@ -126,6 +172,7 @@ void HAL_FDCAN_MspInit(FDCAN_HandleTypeDef* hfdcan)
/* USER CODE BEGIN FDCAN1_MspInit 1 */
/* USER CODE END FDCAN1_MspInit 1 */
}
}
@ -205,6 +252,7 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
/* USER CODE BEGIN I2C4_MspInit 1 */
/* USER CODE END I2C4_MspInit 1 */
}
}
@ -266,7 +314,7 @@ void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
PeriphClkInitStruct.PLL3.PLL3R = 3;
PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_3;
PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE;
PeriphClkInitStruct.PLL3.PLL3FRACN = 0.0;
PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
@ -391,6 +439,7 @@ void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
/* USER CODE BEGIN LTDC_MspInit 1 */
/* USER CODE END LTDC_MspInit 1 */
}
}
@ -509,6 +558,7 @@ void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
/* USER CODE BEGIN SDMMC2_MspInit 1 */
/* USER CODE END SDMMC2_MspInit 1 */
}
}
@ -726,6 +776,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd)
/* USER CODE BEGIN USB_OTG_HS_MspInit 1 */
/* USER CODE END USB_OTG_HS_MspInit 1 */
}
}