/* 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" #include "stm32l0xx_ll_dma.h" #include "stm32l0xx_hal.h" #include "stm32l0xx_ll_usart.h" #include "stm32l0xx_ll_rcc.h" #include "stm32l0xx.h" #include "stm32l0xx_ll_system.h" #include "stm32l0xx_ll_gpio.h" #include "stm32l0xx_ll_exti.h" #include "stm32l0xx_ll_bus.h" #include "stm32l0xx_ll_cortex.h" #include "stm32l0xx_ll_utils.h" #include "stm32l0xx_ll_pwr.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ //#define SENSOR_QUANTITY 2 typedef enum{ FALSE = 0, TRUE = !FALSE }bool; enum LORAWAN_STATE{ LORA_RESET = 0, LORA_P2P, LORA_NOT_JOIN, LORA_JOINED }; /* 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 Lora_RST_Pin LL_GPIO_PIN_4 #define Lora_RST_GPIO_Port GPIOA #define I2C_SCL_Pin LL_GPIO_PIN_6 #define I2C_SCL_GPIO_Port GPIOB #define I2C_SDA_Pin LL_GPIO_PIN_7 #define I2C_SDA_GPIO_Port GPIOB #define Power_Control_Pin LL_GPIO_PIN_8 #define Power_Control_GPIO_Port GPIOB /* USER CODE BEGIN Private defines */ //#define TissuePaper //STS-R2 #define JumboRoll //STS-R1-SINGLE //#define DoubleJumboRoll //STS-R1-DOUBLE //#define WasteBin // STS-R5 #ifdef TissuePaper //STS-R2 #define SENSOR_QUANTITY 1 #define DATA_PORT 52 #endif #ifdef JumboRoll //STS-R1-SINGLE #define SENSOR_QUANTITY 1 #define DATA_PORT 58 #endif #ifdef DoubleJumboRoll //STS-R1-DOUBLE #define SENSOR_QUANTITY 2 #define DATA_PORT 57 #endif #ifdef WasteBin // STS-R5 #define SENSOR_QUANTITY 1 #define DATA_PORT 11 #endif //#define SLEEP_TIME_SECOND 1800 #define SLEEP_TIME_SECOND 690 //十分钟发一次数据 //#define SLEEP_TIME_SECOND 10 #define Lora_Uart USART2 /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/