pmic_bltc.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _PMIC_BLTC_H_
  13. #define _PMIC_BLTC_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_PMIC_BLTC_BASE (0x51108080)
  17. typedef volatile struct
  18. {
  19. uint32_t bltc_ctl; // 0x00000000
  20. uint32_t bltc_r_prescale; // 0x00000004
  21. uint32_t bltc_r_duty; // 0x00000008
  22. uint32_t bltc_r_curve0; // 0x0000000c
  23. uint32_t bltc_r_curve1; // 0x00000010
  24. uint32_t bltc_g_prescale; // 0x00000014
  25. uint32_t bltc_g_duty; // 0x00000018
  26. uint32_t bltc_g_curve0; // 0x0000001c
  27. uint32_t bltc_g_curve1; // 0x00000020
  28. uint32_t bltc_b_prescale; // 0x00000024
  29. uint32_t bltc_b_duty; // 0x00000028
  30. uint32_t bltc_b_curve0; // 0x0000002c
  31. uint32_t bltc_b_curve1; // 0x00000030
  32. uint32_t bltc_sts; // 0x00000034
  33. uint32_t bltc_r_isat; // 0x00000038
  34. uint32_t bltc_g_isat; // 0x0000003c
  35. uint32_t bltc_b_isat; // 0x00000040
  36. uint32_t bltc_wled_isat; // 0x00000044
  37. uint32_t bltc_wled_prescale; // 0x00000048
  38. uint32_t bltc_wled_duty; // 0x0000004c
  39. uint32_t bltc_wled_curve0; // 0x00000050
  40. uint32_t bltc_wled_curve1; // 0x00000054
  41. uint32_t bltc_pd_ctrl; // 0x00000058
  42. uint32_t bltc_version; // 0x0000005c
  43. } HWP_PMIC_BLTC_T;
  44. #define hwp_pmicBltc ((HWP_PMIC_BLTC_T *)REG_ACCESS_ADDRESS(REG_PMIC_BLTC_BASE))
  45. // bltc_ctl
  46. typedef union {
  47. uint32_t v;
  48. struct
  49. {
  50. uint32_t r_run : 1; // [0]
  51. uint32_t r_type : 1; // [1]
  52. uint32_t r_sel : 1; // [2]
  53. uint32_t r_sw : 1; // [3]
  54. uint32_t g_run : 1; // [4]
  55. uint32_t g_type : 1; // [5]
  56. uint32_t g_sel : 1; // [6]
  57. uint32_t g_sw : 1; // [7]
  58. uint32_t b_run : 1; // [8]
  59. uint32_t b_type : 1; // [9]
  60. uint32_t b_sel : 1; // [10]
  61. uint32_t b_sw : 1; // [11]
  62. uint32_t wled_run : 1; // [12]
  63. uint32_t wled_type : 1; // [13]
  64. uint32_t wled_sel : 1; // [14]
  65. uint32_t wled_sw : 1; // [15]
  66. uint32_t __31_16 : 16; // [31:16]
  67. } b;
  68. } REG_PMIC_BLTC_BLTC_CTL_T;
  69. // bltc_r_prescale
  70. typedef union {
  71. uint32_t v;
  72. struct
  73. {
  74. uint32_t prescl : 8; // [7:0]
  75. uint32_t __31_8 : 24; // [31:8]
  76. } b;
  77. } REG_PMIC_BLTC_BLTC_R_PRESCALE_T;
  78. // bltc_r_duty
  79. typedef union {
  80. uint32_t v;
  81. struct
  82. {
  83. uint32_t mode : 8; // [7:0]
  84. uint32_t duty : 8; // [15:8]
  85. uint32_t __31_16 : 16; // [31:16]
  86. } b;
  87. } REG_PMIC_BLTC_BLTC_R_DUTY_T;
  88. // bltc_r_curve0
  89. typedef union {
  90. uint32_t v;
  91. struct
  92. {
  93. uint32_t trise : 6; // [5:0]
  94. uint32_t __7_6 : 2; // [7:6]
  95. uint32_t tfall : 6; // [13:8]
  96. uint32_t __31_14 : 18; // [31:14]
  97. } b;
  98. } REG_PMIC_BLTC_BLTC_R_CURVE0_T;
  99. // bltc_r_curve1
  100. typedef union {
  101. uint32_t v;
  102. struct
  103. {
  104. uint32_t thigh : 8; // [7:0]
  105. uint32_t tlow : 8; // [15:8]
  106. uint32_t __31_16 : 16; // [31:16]
  107. } b;
  108. } REG_PMIC_BLTC_BLTC_R_CURVE1_T;
  109. // bltc_g_prescale
  110. typedef union {
  111. uint32_t v;
  112. struct
  113. {
  114. uint32_t prescl : 8; // [7:0]
  115. uint32_t __31_8 : 24; // [31:8]
  116. } b;
  117. } REG_PMIC_BLTC_BLTC_G_PRESCALE_T;
  118. // bltc_g_duty
  119. typedef union {
  120. uint32_t v;
  121. struct
  122. {
  123. uint32_t mode : 8; // [7:0]
  124. uint32_t duty : 8; // [15:8]
  125. uint32_t __31_16 : 16; // [31:16]
  126. } b;
  127. } REG_PMIC_BLTC_BLTC_G_DUTY_T;
  128. // bltc_g_curve0
  129. typedef union {
  130. uint32_t v;
  131. struct
  132. {
  133. uint32_t trise : 6; // [5:0]
  134. uint32_t __7_6 : 2; // [7:6]
  135. uint32_t tfall : 6; // [13:8]
  136. uint32_t __31_14 : 18; // [31:14]
  137. } b;
  138. } REG_PMIC_BLTC_BLTC_G_CURVE0_T;
  139. // bltc_g_curve1
  140. typedef union {
  141. uint32_t v;
  142. struct
  143. {
  144. uint32_t thigh : 8; // [7:0]
  145. uint32_t tlow : 8; // [15:8]
  146. uint32_t __31_16 : 16; // [31:16]
  147. } b;
  148. } REG_PMIC_BLTC_BLTC_G_CURVE1_T;
  149. // bltc_b_prescale
  150. typedef union {
  151. uint32_t v;
  152. struct
  153. {
  154. uint32_t prescl : 8; // [7:0]
  155. uint32_t __31_8 : 24; // [31:8]
  156. } b;
  157. } REG_PMIC_BLTC_BLTC_B_PRESCALE_T;
  158. // bltc_b_duty
  159. typedef union {
  160. uint32_t v;
  161. struct
  162. {
  163. uint32_t mode : 8; // [7:0]
  164. uint32_t duty : 8; // [15:8]
  165. uint32_t __31_16 : 16; // [31:16]
  166. } b;
  167. } REG_PMIC_BLTC_BLTC_B_DUTY_T;
  168. // bltc_b_curve0
  169. typedef union {
  170. uint32_t v;
  171. struct
  172. {
  173. uint32_t trise : 6; // [5:0]
  174. uint32_t __7_6 : 2; // [7:6]
  175. uint32_t tfall : 6; // [13:8]
  176. uint32_t __31_14 : 18; // [31:14]
  177. } b;
  178. } REG_PMIC_BLTC_BLTC_B_CURVE0_T;
  179. // bltc_b_curve1
  180. typedef union {
  181. uint32_t v;
  182. struct
  183. {
  184. uint32_t thigh : 8; // [7:0]
  185. uint32_t tlow : 8; // [15:8]
  186. uint32_t __31_16 : 16; // [31:16]
  187. } b;
  188. } REG_PMIC_BLTC_BLTC_B_CURVE1_T;
  189. // bltc_sts
  190. typedef union {
  191. uint32_t v;
  192. struct
  193. {
  194. uint32_t bltc_r_busy : 1; // [0], read only
  195. uint32_t bltc_g_busy : 1; // [1], read only
  196. uint32_t bltc_b_busy : 1; // [2], read only
  197. uint32_t bltc_wled_busy : 1; // [3], read only
  198. uint32_t __31_4 : 28; // [31:4]
  199. } b;
  200. } REG_PMIC_BLTC_BLTC_STS_T;
  201. // bltc_r_isat
  202. typedef union {
  203. uint32_t v;
  204. struct
  205. {
  206. uint32_t isat : 6; // [5:0]
  207. uint32_t __31_6 : 26; // [31:6]
  208. } b;
  209. } REG_PMIC_BLTC_BLTC_R_ISAT_T;
  210. // bltc_g_isat
  211. typedef union {
  212. uint32_t v;
  213. struct
  214. {
  215. uint32_t isat : 6; // [5:0]
  216. uint32_t __31_6 : 26; // [31:6]
  217. } b;
  218. } REG_PMIC_BLTC_BLTC_G_ISAT_T;
  219. // bltc_b_isat
  220. typedef union {
  221. uint32_t v;
  222. struct
  223. {
  224. uint32_t isat : 6; // [5:0]
  225. uint32_t __31_6 : 26; // [31:6]
  226. } b;
  227. } REG_PMIC_BLTC_BLTC_B_ISAT_T;
  228. // bltc_wled_isat
  229. typedef union {
  230. uint32_t v;
  231. struct
  232. {
  233. uint32_t isat : 6; // [5:0]
  234. uint32_t __31_6 : 26; // [31:6]
  235. } b;
  236. } REG_PMIC_BLTC_BLTC_WLED_ISAT_T;
  237. // bltc_wled_prescale
  238. typedef union {
  239. uint32_t v;
  240. struct
  241. {
  242. uint32_t prescl : 8; // [7:0]
  243. uint32_t __31_8 : 24; // [31:8]
  244. } b;
  245. } REG_PMIC_BLTC_BLTC_WLED_PRESCALE_T;
  246. // bltc_wled_duty
  247. typedef union {
  248. uint32_t v;
  249. struct
  250. {
  251. uint32_t mode : 8; // [7:0]
  252. uint32_t duty : 8; // [15:8]
  253. uint32_t __31_16 : 16; // [31:16]
  254. } b;
  255. } REG_PMIC_BLTC_BLTC_WLED_DUTY_T;
  256. // bltc_wled_curve0
  257. typedef union {
  258. uint32_t v;
  259. struct
  260. {
  261. uint32_t trise : 6; // [5:0]
  262. uint32_t __7_6 : 2; // [7:6]
  263. uint32_t tfall : 6; // [13:8]
  264. uint32_t __31_14 : 18; // [31:14]
  265. } b;
  266. } REG_PMIC_BLTC_BLTC_WLED_CURVE0_T;
  267. // bltc_wled_curve1
  268. typedef union {
  269. uint32_t v;
  270. struct
  271. {
  272. uint32_t thigh : 8; // [7:0]
  273. uint32_t tlow : 8; // [15:8]
  274. uint32_t __31_16 : 16; // [31:16]
  275. } b;
  276. } REG_PMIC_BLTC_BLTC_WLED_CURVE1_T;
  277. // bltc_pd_ctrl
  278. typedef union {
  279. uint32_t v;
  280. struct
  281. {
  282. uint32_t sw_pd : 1; // [0]
  283. uint32_t hw_pd : 1; // [1]
  284. uint32_t __31_2 : 30; // [31:2]
  285. } b;
  286. } REG_PMIC_BLTC_BLTC_PD_CTRL_T;
  287. // bltc_version
  288. typedef union {
  289. uint32_t v;
  290. struct
  291. {
  292. uint32_t bltc_version : 16; // [15:0]
  293. uint32_t __31_16 : 16; // [31:16]
  294. } b;
  295. } REG_PMIC_BLTC_BLTC_VERSION_T;
  296. // bltc_ctl
  297. #define PMIC_BLTC_R_RUN (1 << 0)
  298. #define PMIC_BLTC_R_TYPE (1 << 1)
  299. #define PMIC_BLTC_R_SEL (1 << 2)
  300. #define PMIC_BLTC_R_SW (1 << 3)
  301. #define PMIC_BLTC_G_RUN (1 << 4)
  302. #define PMIC_BLTC_G_TYPE (1 << 5)
  303. #define PMIC_BLTC_G_SEL (1 << 6)
  304. #define PMIC_BLTC_G_SW (1 << 7)
  305. #define PMIC_BLTC_B_RUN (1 << 8)
  306. #define PMIC_BLTC_B_TYPE (1 << 9)
  307. #define PMIC_BLTC_B_SEL (1 << 10)
  308. #define PMIC_BLTC_B_SW (1 << 11)
  309. #define PMIC_BLTC_WLED_RUN (1 << 12)
  310. #define PMIC_BLTC_WLED_TYPE (1 << 13)
  311. #define PMIC_BLTC_WLED_SEL (1 << 14)
  312. #define PMIC_BLTC_WLED_SW (1 << 15)
  313. // bltc_r_prescale
  314. #define PMIC_BLTC_PRESCL(n) (((n)&0xff) << 0)
  315. // bltc_r_duty
  316. #define PMIC_BLTC_MODE(n) (((n)&0xff) << 0)
  317. #define PMIC_BLTC_DUTY(n) (((n)&0xff) << 8)
  318. // bltc_r_curve0
  319. #define PMIC_BLTC_TRISE(n) (((n)&0x3f) << 0)
  320. #define PMIC_BLTC_TFALL(n) (((n)&0x3f) << 8)
  321. // bltc_r_curve1
  322. #define PMIC_BLTC_THIGH(n) (((n)&0xff) << 0)
  323. #define PMIC_BLTC_TLOW(n) (((n)&0xff) << 8)
  324. // bltc_g_prescale
  325. #define PMIC_BLTC_PRESCL(n) (((n)&0xff) << 0)
  326. // bltc_g_duty
  327. #define PMIC_BLTC_MODE(n) (((n)&0xff) << 0)
  328. #define PMIC_BLTC_DUTY(n) (((n)&0xff) << 8)
  329. // bltc_g_curve0
  330. #define PMIC_BLTC_TRISE(n) (((n)&0x3f) << 0)
  331. #define PMIC_BLTC_TFALL(n) (((n)&0x3f) << 8)
  332. // bltc_g_curve1
  333. #define PMIC_BLTC_THIGH(n) (((n)&0xff) << 0)
  334. #define PMIC_BLTC_TLOW(n) (((n)&0xff) << 8)
  335. // bltc_b_prescale
  336. #define PMIC_BLTC_PRESCL(n) (((n)&0xff) << 0)
  337. // bltc_b_duty
  338. #define PMIC_BLTC_MODE(n) (((n)&0xff) << 0)
  339. #define PMIC_BLTC_DUTY(n) (((n)&0xff) << 8)
  340. // bltc_b_curve0
  341. #define PMIC_BLTC_TRISE(n) (((n)&0x3f) << 0)
  342. #define PMIC_BLTC_TFALL(n) (((n)&0x3f) << 8)
  343. // bltc_b_curve1
  344. #define PMIC_BLTC_THIGH(n) (((n)&0xff) << 0)
  345. #define PMIC_BLTC_TLOW(n) (((n)&0xff) << 8)
  346. // bltc_sts
  347. #define PMIC_BLTC_BLTC_R_BUSY (1 << 0)
  348. #define PMIC_BLTC_BLTC_G_BUSY (1 << 1)
  349. #define PMIC_BLTC_BLTC_B_BUSY (1 << 2)
  350. #define PMIC_BLTC_BLTC_WLED_BUSY (1 << 3)
  351. // bltc_r_isat
  352. #define PMIC_BLTC_ISAT(n) (((n)&0x3f) << 0)
  353. // bltc_g_isat
  354. #define PMIC_BLTC_ISAT(n) (((n)&0x3f) << 0)
  355. // bltc_b_isat
  356. #define PMIC_BLTC_ISAT(n) (((n)&0x3f) << 0)
  357. // bltc_wled_isat
  358. #define PMIC_BLTC_ISAT(n) (((n)&0x3f) << 0)
  359. // bltc_wled_prescale
  360. #define PMIC_BLTC_PRESCL(n) (((n)&0xff) << 0)
  361. // bltc_wled_duty
  362. #define PMIC_BLTC_MODE(n) (((n)&0xff) << 0)
  363. #define PMIC_BLTC_DUTY(n) (((n)&0xff) << 8)
  364. // bltc_wled_curve0
  365. #define PMIC_BLTC_TRISE(n) (((n)&0x3f) << 0)
  366. #define PMIC_BLTC_TFALL(n) (((n)&0x3f) << 8)
  367. // bltc_wled_curve1
  368. #define PMIC_BLTC_THIGH(n) (((n)&0xff) << 0)
  369. #define PMIC_BLTC_TLOW(n) (((n)&0xff) << 8)
  370. // bltc_pd_ctrl
  371. #define PMIC_BLTC_SW_PD (1 << 0)
  372. #define PMIC_BLTC_HW_PD (1 << 1)
  373. // bltc_version
  374. #define PMIC_BLTC_BLTC_VERSION(n) (((n)&0xffff) << 0)
  375. #endif // _PMIC_BLTC_H_