111 lines
2.6 KiB
C
111 lines
2.6 KiB
C
/* 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 "stm32f1xx_hal.h"
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Includes */
|
|
typedef enum {
|
|
STATE_OPEN_VALVE = 0, // open
|
|
STATE_CLOSE_VALVE= 1 // close
|
|
} ValveState;
|
|
typedef struct
|
|
{
|
|
uint32_t id[2];
|
|
float temp;
|
|
uint16_t location;
|
|
uint8_t t_open;
|
|
float t_set;
|
|
uint8_t t_close;
|
|
|
|
|
|
uint8_t status_T_sense:1 ;
|
|
|
|
ValveState state;
|
|
uint16_t count;
|
|
|
|
|
|
|
|
}TEMP;
|
|
|
|
|
|
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN ET */
|
|
#define reset_blink_delay 50
|
|
#define rest_iter 10
|
|
#define GPIOB11_valve MB_DATA.Coils.coils[0].state_val_bit.state_val_01
|
|
|
|
|
|
|
|
|
|
extern void handle_command(char* cmd);
|
|
typedef void (*FunctionPointer)(void);
|
|
|
|
uint16_t handle_valves(TEMP* tmp_sense);
|
|
void init_all_T_sense(void);
|
|
void iwdg_refresh(void);
|
|
void led_blink(GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint8_t iter,uint16_t delay);
|
|
|
|
/* 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 One_wire_Pin GPIO_PIN_15
|
|
#define One_wire_GPIO_Port GPIOA
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|