EXTI.c 892 B

1234567891011121314151617181920212223
  1. #include <FU68xx_5.h>
  2. #include <Myproject.h>
  3. USER_TYPEDEF User;
  4. /**
  5. * @brief 过零点检测
  6. * @data 2022/08/12
  7. */
  8. void ZeroCrossing_Init(void)
  9. {
  10. // ClrBit(P1_OE, P15); // config P20 as input
  11. // ClrBit(P1_PU, P15); // diasable P20 Pull Up
  12. // ClrBit(P1_AN, P15); // diasable P20 analog function
  13. // ClrBit(P1_IF, P15); // clear P11 interrupt flag
  14. // SetBit(P1_IE, P15); // config P11 as the source of EXTI1
  15. // IT11 = 0;
  16. // IT10 = 0; // 00: posedge mode interrupt,01: negedge mode interrupt,1x: edge-change mode interrupt
  17. // PX11 = 0;
  18. // PX10 = 1; // 中断优先级别0,中断优先级最高
  19. // EX1 = 1; // 使能外部中断1, P20位外部中断输入硬件
  20. // EA = 1; // 使能全局中断
  21. }