120 lines
3.5 KiB
C
120 lines
3.5 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) 2024 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 */
|
|
|
|
/* 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 LineSeek_L2_Pin GPIO_PIN_13
|
|
#define LineSeek_L2_GPIO_Port GPIOC
|
|
#define LineSeek_L1_Pin GPIO_PIN_14
|
|
#define LineSeek_L1_GPIO_Port GPIOC
|
|
#define LineSeek_R1_Pin GPIO_PIN_15
|
|
#define LineSeek_R1_GPIO_Port GPIOC
|
|
#define FM_K2_POWERC_Pin GPIO_PIN_0
|
|
#define FM_K2_POWERC_GPIO_Port GPIOA
|
|
#define FAN_GS_Pin GPIO_PIN_1
|
|
#define FAN_GS_GPIO_Port GPIOA
|
|
#define HWR_Pin GPIO_PIN_4
|
|
#define HWR_GPIO_Port GPIOA
|
|
#define HWL_Pin GPIO_PIN_6
|
|
#define HWL_GPIO_Port GPIOA
|
|
#define LED_B_TIM3CH2_Pin GPIO_PIN_7
|
|
#define LED_B_TIM3CH2_GPIO_Port GPIOA
|
|
#define LED_G_TIM3CH3_Pin GPIO_PIN_0
|
|
#define LED_G_TIM3CH3_GPIO_Port GPIOB
|
|
#define LED_R_TIM3CH4_Pin GPIO_PIN_1
|
|
#define LED_R_TIM3CH4_GPIO_Port GPIOB
|
|
#define MPU6050_SCL_Pin GPIO_PIN_10
|
|
#define MPU6050_SCL_GPIO_Port GPIOB
|
|
#define MPU6050_SDA_Pin GPIO_PIN_11
|
|
#define MPU6050_SDA_GPIO_Port GPIOB
|
|
#define LineSeek_R2_Pin GPIO_PIN_12
|
|
#define LineSeek_R2_GPIO_Port GPIOB
|
|
#define SERVO_Pin GPIO_PIN_11
|
|
#define SERVO_GPIO_Port GPIOA
|
|
#define ECHO_Pin GPIO_PIN_12
|
|
#define ECHO_GPIO_Port GPIOA
|
|
#define ECHO_EXTI_IRQn EXTI15_10_IRQn
|
|
#define TRIG_Pin GPIO_PIN_15
|
|
#define TRIG_GPIO_Port GPIOA
|
|
#define R_FORWARD_Pin GPIO_PIN_4
|
|
#define R_FORWARD_GPIO_Port GPIOB
|
|
#define R_BACKWARD_Pin GPIO_PIN_5
|
|
#define R_BACKWARD_GPIO_Port GPIOB
|
|
#define R_TIM4CH1_Pin GPIO_PIN_6
|
|
#define R_TIM4CH1_GPIO_Port GPIOB
|
|
#define L_TIM4CH2_Pin GPIO_PIN_7
|
|
#define L_TIM4CH2_GPIO_Port GPIOB
|
|
#define L_BACKWARD_Pin GPIO_PIN_8
|
|
#define L_BACKWARD_GPIO_Port GPIOB
|
|
#define L_FORWARD_Pin GPIO_PIN_9
|
|
#define L_FORWARD_GPIO_Port GPIOB
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
#define LOW (0)
|
|
#define HIGH (1)
|
|
#define LEFT (0)
|
|
#define STRAIGHT (1)
|
|
#define RIGHT (2)
|
|
#define STOP (3)
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|