main.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __MAIN_H
  23. #define __MAIN_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32l1xx_hal.h"
  29. /* Private includes ----------------------------------------------------------*/
  30. /* USER CODE BEGIN Includes */
  31. #include "ssd1306.h"
  32. /* USER CODE END Includes */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* USER CODE BEGIN ET */
  35. /* USER CODE END ET */
  36. /* Exported constants --------------------------------------------------------*/
  37. /* USER CODE BEGIN EC */
  38. /* USER CODE END EC */
  39. /* Exported macro ------------------------------------------------------------*/
  40. /* USER CODE BEGIN EM */
  41. /* USER CODE END EM */
  42. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
  43. /* Exported functions prototypes ---------------------------------------------*/
  44. void Error_Handler(void);
  45. /* USER CODE BEGIN EFP */
  46. /* USER CODE END EFP */
  47. /* Private defines -----------------------------------------------------------*/
  48. /* USER CODE BEGIN Private defines */
  49. #define SIPM_BIAS_VOLTAGE_OFFSET 2100
  50. #define COMP_THRESHOLD_VOLTAGE 135
  51. typedef enum { OFF = 0, ON = 1 } OnOff_t;
  52. typedef struct {
  53. struct {
  54. int Volume;
  55. int Tone;
  56. int Buttons;
  57. } Sound;
  58. struct {
  59. int DoseRate;
  60. int TotalDose;
  61. int SoundType;
  62. int Volume;
  63. } Alarm;
  64. struct {
  65. int Brightness;
  66. int DispOffMin;
  67. int ShutdownMin;
  68. } Energy;
  69. } Settings_td;
  70. /* USER CODE END Private defines */
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* __MAIN_H */