EXTI.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* -------------------------- (C) COPYRIGHT 2022 Fortiortech ShenZhen ---------------------------*/
  2. /**
  3. * @copyright (C) COPYRIGHT 2022 Fortiortech Shenzhen
  4. * @file xxx.c
  5. * @author Fortiortech Appliction Team
  6. * @since Create:2022-07-14
  7. * @date Last modify:2022-07-14
  8. * @note Last modify author is Leo.li
  9. * @brief
  10. */
  11. /* Includes -------------------------------------------------------------------------------------*/
  12. #include <FU68xx_5.h>
  13. #include <Myproject.h>
  14. USER_TYPEDEF User;
  15. /**
  16. * @brief 过零点检测
  17. * @data 2022/08/12
  18. */
  19. void ZeroCrossing_Init(void)
  20. {
  21. // ClrBit(P1_OE, P15); // config P20 as input
  22. // ClrBit(P1_PU, P15); // diasable P20 Pull Up
  23. // ClrBit(P1_AN, P15); // diasable P20 analog function
  24. // ClrBit(P1_IF, P15); // clear P11 interrupt flag
  25. // SetBit(P1_IE, P15); // config P11 as the source of EXTI1
  26. // IT11 = 0;
  27. // IT10 = 0; // 00: posedge mode interrupt,01: negedge mode interrupt,1x: edge-change mode interrupt
  28. // PX11 = 0;
  29. // PX10 = 1; // 中断优先级别0,中断优先级最高
  30. // EX1 = 1; // 使能外部中断1, P20位外部中断输入硬件
  31. // EA = 1; // 使能全局中断
  32. }