temp_comp.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /********************************************************************************
  2. * USDK(ZS283A)
  3. * Module: SYSTEM
  4. * Copyright(c) 2003-2017 Actions Semiconductor,
  5. * All Rights Reserved.
  6. *
  7. * History:
  8. * <author> <time> <version > <desc>
  9. * wuyufan 2019-2-18-4:09:22 1.0 build this file
  10. ********************************************************************************/
  11. /*!
  12. * \file temp_comp.h
  13. * \brief
  14. * \author
  15. * \version 1.0
  16. * \date 2019-2-18-4:09:22
  17. *******************************************************************************/
  18. #ifndef TEMP_COMP_H_
  19. #define TEMP_COMP_H_
  20. #define CFG_MAX_CAP_TEMP_COMP 10
  21. enum CFG_TYPE_CAP_TEMP
  22. {
  23. CAP_TEMP_NA = 0x7F, // <"NA">
  24. CAP_TEMP_N_40 = 0x100 - 40, // <"-40">
  25. CAP_TEMP_N_35 = 0x100 - 35, // <"-35">
  26. CAP_TEMP_N_30 = 0x100 - 30, // <"-30">
  27. CAP_TEMP_N_25 = 0x100 - 25, // <"-25">
  28. CAP_TEMP_N_20 = 0x100 - 20, // <"-20">
  29. CAP_TEMP_N_15 = 0x100 - 15, // <"-15">
  30. CAP_TEMP_N_10 = 0x100 - 10, // <"-10">
  31. CAP_TEMP_N_5 = 0x100 - 5, // <"-5">
  32. CAP_TEMP_0 = 0, // <"0">
  33. CAP_TEMP_P_5 = 5, // <"+5">
  34. CAP_TEMP_P_10 = 10, // <"+10">
  35. CAP_TEMP_P_15 = 15, // <"+15">
  36. CAP_TEMP_P_20 = 20, // <"+20">
  37. CAP_TEMP_P_25 = 25, // <"+25">
  38. CAP_TEMP_P_30 = 30, // <"+30">
  39. CAP_TEMP_P_35 = 35, // <"+35">
  40. CAP_TEMP_P_40 = 40, // <"+40">
  41. CAP_TEMP_P_45 = 45, // <"+45">
  42. CAP_TEMP_P_50 = 50, // <"+50">
  43. CAP_TEMP_P_55 = 55, // <"+55">
  44. CAP_TEMP_P_60 = 60, // <"+60">
  45. CAP_TEMP_P_65 = 65, // <"+65">
  46. CAP_TEMP_P_70 = 70, // <"+70">
  47. CAP_TEMP_P_75 = 75, // <"+75">
  48. CAP_TEMP_P_80 = 80, // <"+80">
  49. };
  50. typedef struct // <"temperature compensation">
  51. {
  52. uint8_t Cap_Temp; // <"temperature C", CFG_TYPE_CAP_TEMP>
  53. uint8_t Cap_Comp; // <"compensation pF", -10.0 ~ 10.0, float_x10>
  54. } CFG_Type_Cap_Temp_Comp;
  55. typedef struct // <"temperature compensation", CFG_CATEGORY_BLUETOOTH>
  56. {
  57. uint8_t Enable_Cap_Temp_Comp; // <"enable temperature compensation", CFG_TYPE_BOOL>
  58. CFG_Type_Cap_Temp_Comp Table[CFG_MAX_CAP_TEMP_COMP]; // <"temperature compensation", CFG_Type_Cap_Temp_Comp>
  59. } CFG_Struct_Cap_Temp_Comp;
  60. typedef struct
  61. {
  62. CFG_Struct_Cap_Temp_Comp configs;
  63. uint8_t enabled;
  64. uint8_t table_size;
  65. uint8_t normal_cap;
  66. int last_temp;
  67. } cap_temp_comp_ctrl_t;
  68. #endif /* TEMP_COMP_H_ */