温度,pn,sn,生产时间和厂家,积分时间,像素长度等变量

This commit is contained in:
wantong
2024-01-31 15:17:21 +08:00
parent 0732984a64
commit c5b2a4e98b
42 changed files with 5275 additions and 8507 deletions

View File

@ -28,9 +28,13 @@
#include <stdio.h>
#include "SerialDataProcess.h"
#include <stdint.h>
#include <stdbool.h>
#include "stdlib.h"
#include "Store_Information.h"
#include "string.h"
#include "Get_Parameters.h"
#include "Control_Adjustment.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@ -56,7 +60,6 @@
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MPU_Config(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@ -77,9 +80,6 @@ int main(void)
/* USER CODE END 1 */
/* MPU Configuration--------------------------------------------------------*/
MPU_Config();
/* Enable I-Cache---------------------------------------------------------*/
SCB_EnableICache();
@ -105,8 +105,9 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART1_UART_Init();
MX_USART3_UART_Init();
/* USER CODE BEGIN 2 */
RetargetInit(&huart1);
RetargetInit(&huart3);//用串口3来进行信息的控制和输出。串口1进行图像的输出。
/* USER CODE END 2 */
@ -118,13 +119,35 @@ int main(void)
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
struct paramstruct *paramstruct;
paramstruct = GetParametesptr();
paramstruct->age=20;
SerialDataProcess();
age= Change_Age();
printf("Age is %d\r\n",age);
struct paramstruct *ParamStructPtr;
ParamStructPtr = GetParametesptr();
// paramstruct ->age = 20;
if(ParamStructPtr->pn == 1 ){
Printf_Pn_Number();
}
if(ParamStructPtr->sn == 1){
Printf_Sn_Number();
}
if(ParamStructPtr->production_date ==1){
Printf_Product_Time();
}
if(ParamStructPtr->manufacturer ==1){
Printf_Manufacturer();
}
if(ParamStructPtr->Device_Pixel_Length ==1){
Printf_Device_Pixel_Length();
}
if(ParamStructPtr->temperature==1){
printf("Temperature:%.1f\r\n",Get_Temperature());
}
if(ParamStructPtr->Set_Integration_Time!=0){
Control_St(ParamStructPtr->Set_Integration_Time);
}
//free(ParamStructPtr);
// printf("Hello World\r\n");
}
/* USER CODE END 3 */
@ -197,35 +220,6 @@ void SystemClock_Config(void)
/* USER CODE END 4 */
/* MPU Configuration */
void MPU_Config(void)
{
MPU_Region_InitTypeDef MPU_InitStruct = {0};
/* Disables the MPU */
HAL_MPU_Disable();
/** Initializes and configures the Region and the memory to be protected
*/
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.BaseAddress = 0x24000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/* Enables the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}
/**
* @brief This function is executed in case of error occurrence.
* @retval None