wm_efuse.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /**
  2. * @file wm_efuse.h
  3. *
  4. * @brief virtual efuse Driver Module
  5. *
  6. * @author dave
  7. *
  8. * Copyright (c) 2014 Winner Microelectronics Co., Ltd.
  9. */
  10. #ifndef WM_EFUSE_H
  11. #define WM_EFUSE_H
  12. #define TLS_EFUSE_STATUS_OK (0)
  13. #define TLS_EFUSE_STATUS_EINVALID (1)
  14. #define TLS_EFUSE_STATUS_EIO (2)
  15. enum {
  16. CMD_WIFI_MAC = 0x01,
  17. CMD_BT_MAC,
  18. CMD_TX_DC,
  19. CMD_RX_DC,
  20. CMD_TX_IQ_GAIN,
  21. CMD_RX_IQ_GAIN,
  22. CMD_TX_IQ_PHASE,
  23. CMD_RX_IQ_PHASE,
  24. CMD_TX_GAIN,
  25. CMD_ALL,
  26. };
  27. #define VCG_ADDR (FT_MAGICNUM_ADDR + sizeof(FT_PARAM_ST)+4)
  28. #define VCG_LEN (4)
  29. //#define TX_GAIN_NEW_ADDR (VCG_ADDR+VCG_LEN)
  30. #define TX_GAIN_LEN (28*3)
  31. /**
  32. * @defgroup Driver_APIs Driver APIs
  33. * @brief Driver APIs
  34. */
  35. /**
  36. * @addtogroup Driver_APIs
  37. * @{
  38. */
  39. /**
  40. * @defgroup EFUSE_Driver_APIs EFUSE Driver APIs
  41. * @brief EFUSE driver APIs
  42. */
  43. /**
  44. * @addtogroup EFUSE_Driver_APIs
  45. * @{
  46. */
  47. /**
  48. * @brief This function is used to init ft param.
  49. *
  50. * @param[in] None
  51. *
  52. * @retval TRUE init success
  53. * @retval FALSE init failed
  54. */
  55. int tls_ft_param_init(void);
  56. /**
  57. * @brief This function is used to write ft_param.
  58. *
  59. * @param[in] opnum ft cmd
  60. * @param[in] data data pointer
  61. * @param[in] len len to write data
  62. *
  63. * @retval TLS_EFUSE_STATUS_OK set success
  64. * @retval TLS_EFUSE_STATUS_EIO set failed
  65. */
  66. int tls_ft_param_set(unsigned int opnum, void *data, unsigned int len);
  67. /**
  68. * @brief This function is used to read ft_param.
  69. *
  70. * @param[in] opnum ft cmd
  71. * @param[in] data data pointer
  72. * @param[in] len len to read data
  73. *
  74. * @retval TLS_EFUSE_STATUS_OK get success
  75. * @retval TLS_EFUSE_STATUS_EIO get failed
  76. */
  77. int tls_ft_param_get(unsigned int opnum, void *data, unsigned int rdlen);
  78. /**
  79. * @brief This function is used to get mac addr
  80. *
  81. * @param[in] mac mac addr,6 byte
  82. *
  83. * @retval TLS_EFUSE_STATUS_OK get success
  84. * @retval TLS_EFUSE_STATUS_EIO get failed
  85. */
  86. int tls_get_mac_addr(u8 *mac);
  87. /**
  88. * @brief This function is used to set mac addr
  89. *
  90. * @param[in] mac mac addr,6 byte
  91. *
  92. * @retval TLS_EFUSE_STATUS_OK set success
  93. * @retval TLS_EFUSE_STATUS_EIO set failed
  94. */
  95. int tls_set_mac_addr(u8 *mac);
  96. /**
  97. * @brief This function is used to get bluetooth mac addr
  98. *
  99. * @param[in] mac mac addr,6 byte
  100. *
  101. * @retval TLS_EFUSE_STATUS_OK get success
  102. * @retval TLS_EFUSE_STATUS_EIO get failed
  103. */
  104. int tls_get_bt_mac_addr(u8 *mac);
  105. /**
  106. * @brief This function is used to set bluetooth mac addr
  107. *
  108. * @param[in] mac mac addr,6 byte
  109. *
  110. * @retval TLS_EFUSE_STATUS_OK set success
  111. * @retval TLS_EFUSE_STATUS_EIO set failed
  112. */
  113. int tls_set_bt_mac_addr(u8 *mac);
  114. /**
  115. * @brief This function is used to get tx gain
  116. *
  117. * @param[in] txgain tx gain,12 byte
  118. *
  119. * @retval TLS_EFUSE_STATUS_OK get success
  120. * @retval TLS_EFUSE_STATUS_EIO get failed
  121. */
  122. int tls_get_tx_gain(u8 *txgain);
  123. /**
  124. * @brief This function is used to set tx gain
  125. *
  126. * @param[in] txgain tx gain,12 byte
  127. *
  128. * @retval TLS_EFUSE_STATUS_OK set success
  129. * @retval TLS_EFUSE_STATUS_EIO set failed
  130. */
  131. int tls_set_tx_gain(u8 *txgain);
  132. /**
  133. * @brief This function is used to get tx lod
  134. *
  135. * @param[in] txlo tx lod
  136. *
  137. * @retval TLS_EFUSE_STATUS_OK get success
  138. * @retval TLS_EFUSE_STATUS_EIO get failed
  139. */
  140. int tls_get_tx_lo(u8 *txlo);
  141. /**
  142. * @brief This function is used to set tx lod
  143. *
  144. * @param[in] txlo tx lod
  145. *
  146. * @retval TLS_EFUSE_STATUS_OK set success
  147. * @retval TLS_EFUSE_STATUS_EIO set failed
  148. */
  149. int tls_set_tx_lo(u8 *txlo);
  150. /**
  151. * @brief This function is used to get tx iq gain
  152. *
  153. * @param[in] txGain
  154. *
  155. * @retval TLS_EFUSE_STATUS_OK get success
  156. * @retval TLS_EFUSE_STATUS_EIO get failed
  157. */
  158. int tls_get_tx_iq_gain(u8 *txGain);
  159. /**
  160. * @brief This function is used to set tx iq gain
  161. *
  162. * @param[in] txGain
  163. *
  164. * @retval TLS_EFUSE_STATUS_OK set success
  165. * @retval TLS_EFUSE_STATUS_EIO set failed
  166. */
  167. int tls_set_tx_iq_gain(u8 *txGain);
  168. /**
  169. * @brief This function is used to get rx iq gain
  170. *
  171. * @param[in] rxGain
  172. *
  173. * @retval TLS_EFUSE_STATUS_OK get success
  174. * @retval TLS_EFUSE_STATUS_EIO get failed
  175. */
  176. int tls_get_rx_iq_gain(u8 *rxGain);
  177. /**
  178. * @brief This function is used to get rx iq gain
  179. *
  180. * @param[in] rxGain
  181. *
  182. * @retval TLS_EFUSE_STATUS_OK set success
  183. * @retval TLS_EFUSE_STATUS_EIO set failed
  184. */
  185. int tls_set_rx_iq_gain(u8 *rxGain);
  186. /**
  187. * @brief This function is used to get tx iq phase
  188. *
  189. * @param[in] txPhase
  190. *
  191. * @retval TLS_EFUSE_STATUS_OK get success
  192. * @retval TLS_EFUSE_STATUS_EIO get failed
  193. */
  194. int tls_get_tx_iq_phase(u8 *txPhase);
  195. /**
  196. * @brief This function is used to set tx iq phase
  197. *
  198. * @param[in] txPhase
  199. *
  200. * @retval TLS_EFUSE_STATUS_OK set success
  201. * @retval TLS_EFUSE_STATUS_EIO set failed
  202. */
  203. int tls_set_tx_iq_phase(u8 *txPhase);
  204. /**
  205. * @brief This function is used to get rx iq phase
  206. *
  207. * @param[in] rxPhase
  208. *
  209. * @retval TLS_EFUSE_STATUS_OK get success
  210. * @retval TLS_EFUSE_STATUS_EIO get failed
  211. */
  212. int tls_get_rx_iq_phase(u8 *rxPhase);
  213. /**
  214. * @brief This function is used to set rx iq phase
  215. *
  216. * @param[in] rxPhase
  217. *
  218. * @retval TLS_EFUSE_STATUS_OK set success
  219. * @retval TLS_EFUSE_STATUS_EIO set failed
  220. */
  221. int tls_set_rx_iq_phase(u8 *rxPhase);
  222. /**
  223. * @brief This function is used to set/get freq err
  224. *
  225. * @param[in] freqerr
  226. * @param[in] flag 1-set 0-get
  227. * @retval TLS_EFUSE_STATUS_OK set/get success
  228. * @retval TLS_EFUSE_STATUS_EIO set/get failed
  229. */
  230. int tls_freq_err_op(u8 *freqerr, u8 flag);
  231. /**
  232. * @brief This function is used to set/get vcg ctrl
  233. *
  234. * @param[in] vcg
  235. * @param[in] flag 1-set 0-get
  236. *
  237. * @retval TLS_EFUSE_STATUS_OK set/get success
  238. * @retval TLS_EFUSE_STATUS_EIO set/get failed
  239. */
  240. int tls_rf_vcg_ctrl_op(u8 *vcg, u8 flag);
  241. /**
  242. * @}
  243. */
  244. /**
  245. * @}
  246. */
  247. #endif /* WM_EFUSE_H */