func.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef _FUNC_H
  2. #define _FUNC_H
  3. #include "func_bt.h"
  4. #include "func_bt_hid.h"
  5. #include "func_bt_dut.h"
  6. #include "func_idle.h"
  7. #include "func_music.h"
  8. #include "func_usbdev.h"
  9. #include "func_aux.h"
  10. #include "func_speaker.h"
  11. #include "func_lowpwr.h"
  12. #include "func_update.h"
  13. //task number
  14. enum {
  15. FUNC_NULL = 0,
  16. FUNC_MUSIC,
  17. FUNC_FMRX,
  18. FUNC_CLOCK,
  19. FUNC_BT,
  20. FUNC_BTHID,
  21. FUNC_USBDEV,
  22. FUNC_AUX,
  23. FUNC_SPDIF,
  24. FUNC_SPEAKER,
  25. FUNC_PWROFF,
  26. FUNC_CHARGE,
  27. FUNC_BT_DUT, //CBT测试模式
  28. FUNC_BT_FCC, //FCC测试模式
  29. FUNC_BT_IODM, //IODM测试模式
  30. FUNC_IDLE,
  31. FUNC_I2S,
  32. };
  33. //task control block
  34. typedef struct {
  35. u8 sta; //cur working task number
  36. u8 last; //lask task number
  37. #if BT_BACKSTAGE_EN
  38. u8 sta_break; //被中断的任务
  39. #endif
  40. void (*mp3_res_play)(u32 addr, u32 len); //各任务的语音播报函数接口
  41. void (*set_vol_callback)(u8 dir); //设置音量的回调函数,用于各任务的音量事件处理。
  42. } func_cb_t;
  43. extern func_cb_t func_cb;
  44. extern const u8 func_sort_table[]; //任务切换排序table
  45. u8 get_funcs_total(void);
  46. void func_process(void);
  47. void func_message(u16 msg);
  48. void func_run(void);
  49. void func_music(void);
  50. void func_idle(void);
  51. void func_clock(void);
  52. void func_fmrx(void);
  53. void func_bt(void);
  54. void func_bthid(void);
  55. void func_usbdev(void);
  56. void func_aux(void);
  57. void func_charge(void);
  58. #if FUNC_SPEAKER_EN
  59. void func_speaker(void);
  60. #endif // FUNC_SPEAKER_EN
  61. void func_exspifalsh_music(void);
  62. void func_bt_warning(void);
  63. #endif // _FUNC_H