98 lines
2.9 KiB
C
98 lines
2.9 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 "stm32f0xx_hal.h"
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Includes */
|
|
#include <stdio.h>
|
|
#include "adc.h"
|
|
#include "can.h"
|
|
#include "variables.h"
|
|
#include "haltech.h"
|
|
#include "timers.h"
|
|
#include "math.h"
|
|
/* 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 */
|
|
#define GPIO_TOGGLE_PIN(port, pin) ((port)->ODR ^= (pin))
|
|
#define GPIO_READ_PIN(port, pin) ((port)->IDR & (pin))
|
|
#define GPIO_SET_PIN(port, pin) ((port)->BSRR = (pin))
|
|
#define GPIO_CLEAR_PIN(port, pin) ((port)->BSRR = (pin << 16u))
|
|
|
|
/* USER CODE END EM */
|
|
|
|
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
|
|
|
/* Exported functions prototypes ---------------------------------------------*/
|
|
void Error_Handler(void);
|
|
|
|
/* USER CODE BEGIN EFP */
|
|
|
|
/* USER CODE END EFP */
|
|
|
|
/* Private defines -----------------------------------------------------------*/
|
|
#define OUT0_Pin GPIO_PIN_4
|
|
#define OUT0_GPIO_Port GPIOA
|
|
#define OUT1_Pin GPIO_PIN_5
|
|
#define OUT1_GPIO_Port GPIOA
|
|
#define OUT2_Pin GPIO_PIN_6
|
|
#define OUT2_GPIO_Port GPIOA
|
|
#define OUT3_Pin GPIO_PIN_7
|
|
#define OUT3_GPIO_Port GPIOA
|
|
#define IN3_Pin GPIO_PIN_14
|
|
#define IN3_GPIO_Port GPIOB
|
|
#define IN0_Pin GPIO_PIN_8
|
|
#define IN0_GPIO_Port GPIOA
|
|
#define IN1_Pin GPIO_PIN_15
|
|
#define IN1_GPIO_Port GPIOA
|
|
#define IN2_Pin GPIO_PIN_5
|
|
#define IN2_GPIO_Port GPIOB
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
extern var_typedef var;
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|