tim.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. ******************************************************************************
  3. * File Name : TIM.h
  4. * Description : This file provides code for the configuration
  5. * of the TIM instances.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under Ultimate Liberty license
  13. * SLA0044, the "License"; You may not use this file except in compliance with
  14. * the License. You may obtain a copy of the License at:
  15. * www.st.com/SLA0044
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef __tim_H
  21. #define __tim_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "main.h"
  27. /* USER CODE BEGIN Includes */
  28. /* USER CODE END Includes */
  29. extern TIM_HandleTypeDef htim1;
  30. extern TIM_HandleTypeDef htim4;
  31. extern TIM_HandleTypeDef htim5;
  32. extern TIM_HandleTypeDef htim6;
  33. extern TIM_HandleTypeDef htim9;
  34. extern TIM_HandleTypeDef htim10;
  35. extern TIM_HandleTypeDef htim11;
  36. extern TIM_HandleTypeDef htim12;
  37. extern TIM_HandleTypeDef htim13;
  38. extern TIM_HandleTypeDef htim14;
  39. /* USER CODE BEGIN Private defines */
  40. #define PWM_CH_CP 0
  41. #define PWM_CH_LED_R 1
  42. #define PWM_CH_LED_G 2
  43. #define PWM_CH_LED_B 3
  44. #define PWM_CH_LED_W 4
  45. #define PWM_CH_GFCI_TEST 5
  46. #define PWM_DUTY_FULL 1000
  47. #define PWM_DUTY_OFF 0
  48. #define PWM_DUTY_5 50
  49. /* USER CODE END Private defines */
  50. void MX_TIM1_Init(void);
  51. void MX_TIM4_Init(void);
  52. void MX_TIM5_Init(void);
  53. void MX_TIM6_Init(void);
  54. void MX_TIM9_Init(void);
  55. void MX_TIM10_Init(void);
  56. void MX_TIM11_Init(void);
  57. void MX_TIM12_Init(void);
  58. void MX_TIM13_Init(void);
  59. void MX_TIM14_Init(void);
  60. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
  61. /* USER CODE BEGIN Prototypes */
  62. extern void user_pwm_setvalue(uint8_t ch, uint16_t value);
  63. extern void SPWM_Switch(uint8_t isOn);
  64. extern uint16_t ICP_Leak_Duty;
  65. extern uint16_t ICP_Leak_Period;
  66. extern uint16_t ICP_rising[2];
  67. extern uint16_t ICP_falling;
  68. extern uint8_t ICP_rising_idx;
  69. extern uint16_t SPWM_idx;
  70. /* USER CODE END Prototypes */
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /*__ tim_H */
  75. /**
  76. * @}
  77. */
  78. /**
  79. * @}
  80. */
  81. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/