t_icu.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _USER_ICU_H_
  2. #define _USER_ICU_H_
  3. #include "t_define.h"
  4. #include "t_bk3231sf.h"
  5. #define ICU_MCU_CLK_SRC_APH 0x00//for pph
  6. #define ICU_MCU_CLK_SRC_XTL_32K 0x00//for core when in normal mode
  7. #define ICU_MCU_CLK_SRC_XTL_16M 0x01//for core when in normal mode
  8. #define ICU_LPO_CLK_SRC_XTL_32K 0x00//for coer when in lowpower mode
  9. #define ICU_LPO_CLK_SRC_XTL_16M_DIV 0x01//for coer when in lowpower mode
  10. #define ICU_CLK_SRC_FREQ_32K 0x00
  11. #define ICU_CLK_SRC_FREQ_16M 0x01
  12. #define ICU_CLK_SRC_FREQ_DPLL_96M 0x10
  13. #define ICU_CLK_PRE_DIV_NONE 0
  14. #define ICU_CLK_EN 0
  15. #define ICU_CLK_DISEN 1
  16. #define ICU_PPH_CORE 0x00
  17. #define ICU_PPH_ADC 0x01
  18. #define ICU_PPH_UART 0x02
  19. #define ICU_PPH_I2C0 0x03
  20. #define ICU_PPH_I2C1 0x04
  21. #define ICU_PPH_SPI 0x05
  22. #define ICU_PPH_CEVA 0x06
  23. #define ICU_PPH_WD 0x07
  24. #define ICU_PPH_BK24 0x08
  25. #define ICU_PPH_LPO 0x09
  26. #define ICU_PPH_RTC 0x0A
  27. #define ICU_PPH_PWM0 0x0B
  28. #define ICU_PPH_PWM1 0x0C
  29. #define ICU_PPH_PWM2 0x0D
  30. #define ICU_PPH_PWM3 0x0E
  31. #define ICU_PPH_PWM4 0x0F
  32. #define ICU_PPH_PWM5 0x10
  33. #define ICU_PPH_TIMER 0x11
  34. #define ICU_PPH_GPIO 0x12
  35. void IcuPphCfg(uint8 pph, uint8 clksrc, uint8 clkfreq, uint8 clkprediv, uint8 clken, uint8 inten, uint8 wakeen, uint8 fiqprio);
  36. void IcuPphClkCfg(uint8 pph, uint8 clksrc, uint8 clkfreq, uint8 clkprediv, uint8 clken);
  37. void IcuPphIntCfg(uint8 pph, uint8 inten, uint8 wakeen, uint8 fiqprio);
  38. uint32 IcuPphGetIntSta(void);
  39. void IcuPphFiqCfg(uint8 en);
  40. void IcuPphIrqCfg(uint8 en);
  41. void IcuEnterDeepSleep(void);
  42. #endif