main.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2024 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __MAIN_H
  22. #define __MAIN_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32l4xx_hal.h"
  28. /* Private includes ----------------------------------------------------------*/
  29. /* USER CODE BEGIN Includes */
  30. void Low_Power_Set(void);
  31. void Configure_GPIOs_For_LowPower(void);
  32. void Enter_LPSleepMode(void);
  33. void Enter_LPStop1Mode(void);
  34. void Enter_LPStop2Mode(void);
  35. void Enter_StandbyMode(void);
  36. /* USER CODE END Includes */
  37. /* Exported types ------------------------------------------------------------*/
  38. /* USER CODE BEGIN ET */
  39. uint16_t CalculateCRC(uint8_t *data, uint16_t length);
  40. uint8_t ReadHallSensor(void);
  41. uint32_t ReadADCValue(void);
  42. uint16_t CalculateBatteryLevel(uint32_t adcValue);
  43. uint8_t ReadSC7A20Sensor(void);
  44. /* USER CODE END ET */
  45. /* Exported constants --------------------------------------------------------*/
  46. /* USER CODE BEGIN EC */
  47. /* USER CODE END EC */
  48. /* Exported macro ------------------------------------------------------------*/
  49. /* USER CODE BEGIN EM */
  50. /* USER CODE END EM */
  51. /* Exported functions prototypes ---------------------------------------------*/
  52. void Error_Handler(void);
  53. /* USER CODE BEGIN EFP */
  54. /* USER CODE END EFP */
  55. /* Private defines -----------------------------------------------------------*/
  56. #define SDA_IIC_Pin GPIO_PIN_1
  57. #define SDA_IIC_GPIO_Port GPIOB
  58. #define SCL_IIC_Pin GPIO_PIN_2
  59. #define SCL_IIC_GPIO_Port GPIOB
  60. #define LINK_BT_Pin GPIO_PIN_11
  61. #define LINK_BT_GPIO_Port GPIOA
  62. /* USER CODE BEGIN Private defines */
  63. /* USER CODE END Private defines */
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __MAIN_H */