tkey.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _BSP_TKEY_H
  2. #define _BSP_TKEY_H
  3. #define TKC_MAX_BITS 2
  4. #define TKC_MAX_SIZE (1 << TKC_MAX_BITS)
  5. extern tk_cb_t tk_cb;
  6. extern tk_cb_t te_cb;
  7. void bsp_tkey_init(void);
  8. bool bsp_tkey_wakeup_en(void);
  9. u8 tkey_get_key(void);
  10. u8 tkey_wakeup_status(void);
  11. void bsp_tkey_spp_tx(void);
  12. void bsp_tkey_str_spp_tx(char *str);
  13. bool tkey_is_pressed(void);
  14. void tkey_press_timeout_clr(void);
  15. void tkey_press_timeout_process(void);
  16. #if USER_TKEY
  17. void bsp_charge_bcnt_calibration(u32 min_avg_cnt);
  18. void tkey_stop_calibration_in_charge(void);
  19. void tkey_proc_calibration_in_charge(void);
  20. void bsp_tebcnt_temp_calibration_stop(void);
  21. void bsp_tebcnt_temp_calibration_start(void);
  22. void bsp_tebcnt_temp_calibration(void);
  23. void bsp_tebcnt_temp_calibration_stop(void);
  24. void bsp_tkey_bcnt_calibration_timeout(void);
  25. #else
  26. #define bsp_charge_bcnt_calibration(x)
  27. #define tkey_proc_calibration_in_charge()
  28. #define tkey_stop_calibration_in_charge()
  29. #define bsp_tebcnt_temp_calibration_stop()
  30. #define bsp_tebcnt_temp_calibration_start()
  31. #define bsp_tebcnt_temp_calibration()
  32. #define bsp_tebcnt_temp_calibration_stop()
  33. #define bsp_tkey_bcnt_calibration_timeout()
  34. #endif // USER_TKEY
  35. #if USER_TKEY_INEAR
  36. u8 tkey_is_inear(void); //入耳检测,0:出耳, 1:入耳
  37. #else
  38. #define tkey_is_inear() (0)
  39. #endif // USER_TKEY_INEAR
  40. #endif