/* 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) 2019 STMicroelectronics. * All rights reserved.

* * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l0xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "Usart.h" #include "serial_at_cmd_app.h" #include "led.h" #include "dw_app.h" #include "global_param.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ extern SPI_HandleTypeDef hspi1; extern UART_HandleTypeDef huart1; extern uint8_t g_start_send_flag,bat_percent; extern ADC_HandleTypeDef hadc; extern LPTIM_HandleTypeDef hlptim1; extern uint16_t lastpoll_count,interval_count,slot_startcount,tag_frequency,tyncpoll_time,waitusart_timer; /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ #define LPTIMER_LSB 30.518 //1 puls=30.518us #define LPTIMER_1S_COUNT 33095 #define USART_KEEPWAKE_TIME 60 /* 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 BAT_MEAS_Pin GPIO_PIN_1 #define BAT_MEAS_GPIO_Port GPIOA #define SCL_Pin GPIO_PIN_2 #define SCL_GPIO_Port GPIOA #define SDA_Pin GPIO_PIN_3 #define SDA_GPIO_Port GPIOA #define SPI_CS_Pin GPIO_PIN_4 #define SPI_CS_GPIO_Port GPIOA #define BAT_MEAS_GND_Pin GPIO_PIN_0 #define BAT_MEAS_GND_GPIO_Port GPIOB #define USER_KEY_Pin GPIO_PIN_1 #define USER_KEY_GPIO_Port GPIOB #define USER_KEY_EXTI_IRQn EXTI0_1_IRQn #define MOTOR_Pin GPIO_PIN_10 #define MOTOR_GPIO_Port GPIOB #define LED1_G_Pin GPIO_PIN_12 #define LED1_G_GPIO_Port GPIOB #define LED1_R_Pin GPIO_PIN_13 #define LED1_R_GPIO_Port GPIOB #define DW_WKUP_Pin GPIO_PIN_8 #define DW_WKUP_GPIO_Port GPIOA #define DW_CTRL_Pin GPIO_PIN_12 #define DW_CTRL_GPIO_Port GPIOA #define LED2_G_Pin GPIO_PIN_15 #define LED2_G_GPIO_Port GPIOA #define LED2_R_Pin GPIO_PIN_3 #define LED2_R_GPIO_Port GPIOB #define PWR_ON_Pin GPIO_PIN_7 #define PWR_ON_GPIO_Port GPIOB /* USER CODE BEGIN Private defines */ #define GET_IMUINT HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0) /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/