hpm_mmc_drv.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. /*
  2. * Copyright (c) 2023 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef HPM_MMC_DRV_H
  8. #define HPM_MMC_DRV_H
  9. #include "hpm_common.h"
  10. #include "hpm_mmc_regs.h"
  11. /**
  12. * @brief MMC driver APIs
  13. * @defgroup mmc_interface MMC driver APIs
  14. * @ingroup mmc_interfaces
  15. * @{
  16. */
  17. /* trigger source to update position parameter */
  18. typedef enum {
  19. mmc_pos_update_by_timestamp = 0,
  20. mmc_pos_update_by_intrgr0_rise_edge = 1,
  21. mmc_pos_update_by_intrgr1_rise_edge = 2,
  22. mmc_pos_update_by_outtrgr0_rise_edge = 3,
  23. mmc_pos_update_by_outtrgr1_rise_edge = 4,
  24. mmc_pos_update_by_self_pos_thr = 5,
  25. mmc_pos_update_by_self_speed_thr = 6,
  26. } mmc_pos_update_trigger_t;
  27. /* cmd mask to update position parameter */
  28. typedef enum {
  29. mmc_pos_update_none = 0,
  30. mmc_pos_update_position = 1 << 0,
  31. mmc_pos_update_revolution = 1 << 1,
  32. mmc_pos_update_speed = 1 << 2,
  33. mmc_pos_update_accel = 1 << 3,
  34. mmc_pos_update_all = 0b1111,
  35. } mmc_pos_update_cmd_mask_t;
  36. typedef enum {
  37. mmc_coef_not_update = 0,
  38. mmc_coef_p_update = 1 << 0,
  39. mmc_coef_i_update = 1 << 1,
  40. mmc_coef_a_update = 1 << 2,
  41. mmc_coef_update_all = 0b111,
  42. } mmc_coef_update_cmd_mask_t;
  43. typedef struct {
  44. bool discrete_pos_mode;
  45. uint32_t discrete_line;
  46. uint32_t continuous_step_thr;
  47. uint32_t continuous_circ_thr;
  48. uint32_t oosync_theta_thr;
  49. } mmc_track_pos_mode_t;
  50. typedef struct {
  51. bool force_accel_to_zero;
  52. bool en_ms_coef;
  53. bool open_loop_mode;
  54. bool pos_16bit_type; /* true for output 16bit position, false for output 32bit position */
  55. bool sync_new_pos; /* predictor base new track position data */
  56. mmc_track_pos_mode_t pos_mode;
  57. } mmc_track_mode_t;
  58. typedef struct {
  59. uint32_t pos_time;
  60. uint32_t position;
  61. int32_t revolution;
  62. double speed;
  63. double accel;
  64. uint32_t cmd_mask; /*!< cmd to to select which parameters to update */
  65. uint32_t trigger; /*!< trigger source for when to update parameters */
  66. } mmc_pos_or_delta_pos_input_t;
  67. typedef struct {
  68. uint32_t coef_time;
  69. double coef_p;
  70. double coef_i;
  71. double coef_a;
  72. uint32_t cmd_mask; /* cmd to select change which parameter */
  73. } mmc_coef_input_t;
  74. typedef struct {
  75. uint32_t err_thr;
  76. uint32_t hold_time;
  77. double coef_p;
  78. double coef_i;
  79. double coef_a;
  80. } mmc_coef_trig_config_t;
  81. typedef struct {
  82. uint32_t time;
  83. uint32_t position;
  84. int32_t revolution;
  85. double speed;
  86. double accel;
  87. } mmc_pos_out_t;
  88. typedef struct {
  89. double coef_p;
  90. double coef_i;
  91. double coef_a;
  92. } mmc_coef_out_t;
  93. /* track event, definition align with interrupt mask and status mask */
  94. typedef enum {
  95. mmc_track_shadow_read_done = 1 << 0,
  96. mmc_track_init_coefs_done = 1 << 1,
  97. mmc_track_init_pos_done = 1 << 2,
  98. mmc_track_oosync = 1 << 4,
  99. mmc_track_idle = 1 << 5, /*!< no corresponding interrupt */
  100. mmc_pred1_init_pos_done = 1 << 6,
  101. mmc_pred0_init_pos_done = 1 << 7,
  102. mmc_track_init_delta_pos_done = 1 << 8,
  103. mmc_track_pos_trig_valid = 1 << 9,
  104. mmc_track_speed_trig_valid = 1 << 10,
  105. } mmc_track_event_t;
  106. typedef enum {
  107. mmc_pred_idle = MMC_BR_BR_ST_IDLE_MASK,
  108. mmc_pred_init_delta_pos_done = MMC_BR_BR_ST_INI_DELTA_POS_DONE_MASK,
  109. mmc_pred_pos_trig_valid = MMC_BR_BR_ST_POS_TRG_VLD_MASK,
  110. mmc_pred_speed_trig_valid = MMC_BR_BR_ST_SPEED_TRG_VLD_MASK,
  111. mmc_pred_open_loop = MMC_BR_BR_ST_OPEN_LOOP_ST_MASK,
  112. } mmc_pred_event_t;
  113. typedef enum {
  114. mmc_pred_pos_trig_valid_int = MMC_BR_BR_CTRL_POS_TRG_VALID_IE_MASK,
  115. mmc_pred_speed_trig_valid_int = MMC_BR_BR_CTRL_SPEED_TRG_VALID_IE_MASK,
  116. mmc_pred_init_delta_pos_done_int = MMC_BR_BR_CTRL_INI_DELTA_POS_DONE_IE_MASK
  117. } mmc_pred_int_t;
  118. typedef struct {
  119. bool speed_trig_int;
  120. bool position_trig_int;
  121. bool delta_pos_done_trig_int;
  122. bool open_loop_mode;
  123. uint8_t pred_mode;
  124. uint8_t not_first_pred_trig_type;
  125. uint8_t first_pred_trig_type;
  126. } mmc_pred_mode_t;
  127. typedef enum {
  128. mmc_pred_not_reload_pos_cmd = 0,
  129. mmc_pred_0_reload_pos_cmd = 2,
  130. mmc_pred_1_reload_pos_cmd = 1,
  131. mmc_pred_both_reload_pos_cmd = 3,
  132. } mmc_pred_reload_pos_cmd_t;
  133. typedef enum {
  134. mmc_pred_by_period = 0,
  135. mmc_pred_continuously_repeat = 1,
  136. mmc_pred_only_once = 2,
  137. } mmc_pred_time_t;
  138. /* using for mmc_pred_by_period mode */
  139. typedef struct {
  140. uint32_t offset_time;
  141. uint32_t period_time;
  142. uint32_t first_time;
  143. } mmc_pred_period_time_t;
  144. typedef struct {
  145. bool less_than; /*!< true for less than, false for greater than */
  146. bool enable;
  147. uint32_t position_thr; /*!< position in a cycle */
  148. int32_t revolution_thr; /*!< cycle */
  149. } mmc_pos_trig_t;
  150. typedef struct {
  151. bool absolute_compare; /*!< true for absolute value compare, false for signed value compare */
  152. bool less_than; /*!< true for less than, false for greater than */
  153. bool enable;
  154. int32_t speed_thr;
  155. } mmc_speed_trig_t;
  156. #ifdef __cplusplus
  157. extern "C" {
  158. #endif
  159. /**
  160. * @brief MMC set frequency
  161. * @param [in] base MMC base address
  162. * @param [in] freq the moto system freq
  163. */
  164. static inline void mmc_set_sysclk_freq(MMC_Type *base, uint32_t freq)
  165. {
  166. uint32_t period;
  167. base->SYSCLK_FREQ = freq;
  168. /* 1/freq *(2^24)*(2^20) */
  169. period = (uint32_t)((double)(1 << 20) * (1 << 24) / freq);
  170. base->SYSCLK_PERIOD = period;
  171. }
  172. /**
  173. * @brief MMC software reset
  174. * @param [in] base MMC base address
  175. */
  176. static inline void mmc_software_reset(MMC_Type *base)
  177. {
  178. base->CR |= MMC_CR_SFTRST_MASK;
  179. base->CR &= ~MMC_CR_SFTRST_MASK;
  180. }
  181. /**
  182. * @brief MMC module enable
  183. * @param [in] base MMC base address
  184. */
  185. static inline void mmc_enable_module(MMC_Type *base)
  186. {
  187. base->CR |= MMC_CR_MOD_EN_MASK;
  188. }
  189. /**
  190. * @brief MMC module disable
  191. * @param [in] base MMC base address
  192. */
  193. static inline void mmc_disable_module(MMC_Type *base)
  194. {
  195. base->CR &= ~MMC_CR_MOD_EN_MASK;
  196. }
  197. /**
  198. * @brief MMC track set loop mode
  199. * @param [in] base MMC base address
  200. * @param [in] open_loop true for open loop, false for close loop
  201. */
  202. static inline void mmc_track_set_open_loop_mode(MMC_Type *base, bool open_loop)
  203. {
  204. if (open_loop) {
  205. base->CR |= MMC_CR_OPEN_LOOP_MODE_MASK;
  206. } else {
  207. base->CR &= ~MMC_CR_OPEN_LOOP_MODE_MASK;
  208. }
  209. }
  210. /**
  211. * @brief MMC track set adjop mode
  212. * @param [in] base MMC base address
  213. * @param [in] adjop true for adjop mode, false for normal mode
  214. */
  215. static inline void mmc_track_set_adjop_mode(MMC_Type *base, bool adjop)
  216. {
  217. if (adjop) {
  218. base->CR |= MMC_CR_ADJOP_MASK;
  219. } else {
  220. base->CR &= ~MMC_CR_ADJOP_MASK;
  221. }
  222. }
  223. /**
  224. * @brief MMC track request shadow read
  225. * @param [in] base MMC base address
  226. *
  227. * @note request shadow before read mmc track resoult register
  228. */
  229. static inline void mmc_track_enable_shadow_read(MMC_Type *base)
  230. {
  231. base->CR |= MMC_CR_SHADOW_RD_REQ_MASK;
  232. /* SHADOW_RD_REQ clear indicates that the shadow is complete */
  233. while ((base->CR & MMC_CR_SHADOW_RD_REQ_MASK) == MMC_CR_SHADOW_RD_REQ_MASK) {
  234. }
  235. }
  236. /**
  237. * @brief MMC track enable interrupt
  238. * @param [in] base MMC base address
  239. * @param [in] int_mask interrupt_mask @ref mmc_track_event_t
  240. */
  241. static inline void mmc_track_enable_interrupt(MMC_Type *base, uint32_t int_mask)
  242. {
  243. base->INT_EN = int_mask;
  244. }
  245. /**
  246. * @brief MMC track disable interrupt
  247. * @param [in] base MMC base address
  248. * @param [in] int_mask interrupt_mask @ref mmc_track_event_t
  249. */
  250. static inline void mmc_track_disable_interrupt(MMC_Type *base, uint32_t int_mask)
  251. {
  252. base->INT_EN &= ~int_mask;
  253. }
  254. /**
  255. * @brief MMC track get status register value
  256. * @param [in] base MMC base address
  257. * @retval status register value
  258. */
  259. static inline uint32_t mmc_track_get_status(MMC_Type *base)
  260. {
  261. return base->STA;
  262. }
  263. /**
  264. * @brief MMC track clear status flag in status register
  265. * @param [in] base MMC base address
  266. * @param [in] clr_mask @ref mmc_track_event_t
  267. */
  268. static inline void mmc_track_clear_status(MMC_Type *base, uint32_t clr_mask)
  269. {
  270. base->STA = clr_mask; /* W1C */
  271. }
  272. /**
  273. * @brief MMC track set the threshold of theta for out-of-sync
  274. * @param [in] base MMC base address
  275. * @param [in] threshold threshold value
  276. */
  277. static inline void mmc_track_set_oosync_theta_threshold(MMC_Type *base, uint32_t threshold)
  278. {
  279. base->OOSYNC_THETA_THR = MMC_OOSYNC_THETA_THR_VAL_SET(threshold);
  280. }
  281. /**
  282. * @brief MMC track config position mode
  283. * @param [in] base MMC base address
  284. * @param [in] mode mmc_track_pos_mode_t
  285. */
  286. void mmc_track_config_pos_mode(MMC_Type *base, mmc_track_pos_mode_t *mode);
  287. /**
  288. * @brief MMC track get default mode config
  289. * @param [in] base MMC base address
  290. * @param [in] config mmc_track_mode_t
  291. */
  292. void mmc_track_get_default_mode_config(MMC_Type *base, mmc_track_mode_t *config);
  293. /**
  294. * @brief MMC track config mode
  295. * @param [in] base MMC base address
  296. * @param [in] config mmc_track_mode_t
  297. */
  298. void mmc_track_config_mode(MMC_Type *base, mmc_track_mode_t *config);
  299. /**
  300. * @brief MMC track config position parameter
  301. * @param [in] base MMC base address
  302. * @param [in] para mmc_pos_or_delta_pos_input_t
  303. */
  304. void mmc_track_config_pos_para(MMC_Type *base, mmc_pos_or_delta_pos_input_t *para);
  305. /**
  306. * @brief MMC track config delta parameter
  307. * @param [in] base MMC base address
  308. * @param [in] para mmc_pos_or_delta_pos_input_t
  309. */
  310. void mmc_track_config_delta_para(MMC_Type *base, mmc_pos_or_delta_pos_input_t *para);
  311. /**
  312. * @brief MMC track config coef parameter
  313. * @param [in] base MMC base address
  314. * @param [in] para mmc_coef_input_t
  315. */
  316. void mmc_track_config_coef_para(MMC_Type *base, mmc_coef_input_t *para);
  317. /**
  318. * @brief MMC track config position trigger
  319. * @param [in] base MMC base address
  320. * @param [in] trig mmc_pos_trig_t
  321. */
  322. void mmc_track_config_position_trig(MMC_Type *base, mmc_pos_trig_t *trig);
  323. /**
  324. * @brief MMC track config speed trigger
  325. * @param [in] base MMC base address
  326. * @param [in] trig mmc_speed_trig_t
  327. */
  328. void mmc_track_config_speed_trig(MMC_Type *base, mmc_speed_trig_t *trig);
  329. /**
  330. * @brief MMC track disable position trigger
  331. * @param [in] base MMC base address
  332. */
  333. static inline void mmc_track_disable_position_trig(MMC_Type *base)
  334. {
  335. base->POS_TRG_CFG &= ~MMC_POS_TRG_CFG_EN_MASK;
  336. }
  337. /**
  338. * @brief MMC track disable speed trigger
  339. * @param [in] base MMC base address
  340. */
  341. static inline void mmc_track_disable_speed_trig(MMC_Type *base)
  342. {
  343. base->SPEED_TRG_CFG &= ~MMC_SPEED_TRG_CFG_EN_MASK;
  344. }
  345. /**
  346. * @brief MMC track config multiple coef trigger
  347. * @param [in] base MMC base address
  348. * @param [in] index coef trigger index(0/1/2)
  349. * @param [in] config mmc_coef_trig_config_t
  350. */
  351. void mmc_track_config_coef_trig(MMC_Type *base, uint8_t index, mmc_coef_trig_config_t *config);
  352. /**
  353. * @brief MMC track get result
  354. * @param [in] base MMC base address
  355. * @param [out] pos_out mmc_pos_out_t
  356. * @param [out] coef_out mmc_coef_out_t
  357. */
  358. void mmc_track_get_result(MMC_Type *base, mmc_pos_out_t *pos_out, mmc_coef_out_t *coef_out);
  359. /* predictor */
  360. /**
  361. * @brief MMC enable predictor
  362. * @param [in] base MMC base address
  363. * @param [in] index predictor index(0/1)
  364. */
  365. static inline void mmc_enable_pred(MMC_Type *base, uint8_t index)
  366. {
  367. base->BR[index].BR_CTRL |= MMC_BR_BR_CTRL_BR_EN_MASK;
  368. }
  369. /**
  370. * @brief MMC disable predictor
  371. * @param [in] base MMC base address
  372. * @param [in] index predictor index(0/1)
  373. */
  374. static inline void mmc_disable_pred(MMC_Type *base, uint8_t index)
  375. {
  376. base->BR[index].BR_CTRL &= ~MMC_BR_BR_CTRL_BR_EN_MASK;
  377. }
  378. /**
  379. * @brief MMC predictor set loop mode
  380. * @param [in] base MMC base address
  381. * @param [in] index predictor index(0/1)
  382. * @param [in] open_loop true for open loop, false for close loop
  383. */
  384. static inline void mmc_pred_set_open_loop_mode(MMC_Type *base, uint8_t index, bool open_loop)
  385. {
  386. if (open_loop) {
  387. base->BR[index].BR_CTRL |= MMC_BR_BR_CTRL_OPEN_LOOP_MODE_MASK;
  388. } else {
  389. base->BR[index].BR_CTRL &= ~MMC_BR_BR_CTRL_OPEN_LOOP_MODE_MASK;
  390. }
  391. }
  392. /**
  393. * @brief MMC predictor set pred time
  394. * @param [in] base MMC base address
  395. * @param [in] index predictor index(0/1)
  396. * @param [in] time mmc_pred_time_t
  397. */
  398. static inline void mmc_pred_set_pred_time(MMC_Type *base, uint8_t index, mmc_pred_time_t time)
  399. {
  400. base->BR[index].BR_CTRL &= ~MMC_BR_BR_CTRL_PRED_MODE_MASK;
  401. base->BR[index].BR_CTRL |= MMC_BR_BR_CTRL_PRED_MODE_SET(time);
  402. }
  403. /**
  404. * @brief MMC pred enable interrupt
  405. * @param [in] base MMC base address
  406. * @param [in] index predictor index(0/1)
  407. * @param [in] int_mask interrupt_mask @ref mmc_pred_int_t
  408. */
  409. static inline void mmc_pred_enable_interrupt(MMC_Type *base, uint8_t index, uint32_t int_mask)
  410. {
  411. base->BR[index].BR_CTRL |= int_mask;
  412. }
  413. /**
  414. * @brief MMC pred disable interrupt
  415. * @param [in] base MMC base address
  416. * @param [in] index predictor index(0/1)
  417. * @param [in] int_mask interrupt_mask @ref mmc_pred_int_t
  418. */
  419. static inline void mmc_pred_disable_interrupt(MMC_Type *base, uint8_t index, uint32_t int_mask)
  420. {
  421. base->BR[index].BR_CTRL &= ~int_mask;
  422. }
  423. /**
  424. * @brief MMC predictor get status register value
  425. * @param [in] base MMC base address
  426. * @param [in] index predictor index(0/1)
  427. * @retval predictor status register value
  428. */
  429. static inline uint32_t mmc_pred_get_status(MMC_Type *base, uint8_t index)
  430. {
  431. return base->BR[index].BR_ST;
  432. }
  433. /**
  434. * @brief MMC predictor clear status bit in reigster
  435. * @param [in] base MMC base address
  436. * @param [in] index predictor index(0/1)
  437. * @param [in] clr_mask bit mask @ref mmc_pred_event_t
  438. */
  439. static inline void mmc_pred_clear_status(MMC_Type *base, uint8_t index, uint32_t clr_mask)
  440. {
  441. base->BR[index].BR_ST = clr_mask; /*!< W1C */
  442. }
  443. /**
  444. * @brief MMC predictor get default mode config
  445. * @param [in] base MMC base address
  446. * @param [in] config mmc_pred_mode_t
  447. */
  448. void mmc_pred_get_default_mode_config(MMC_Type *base, mmc_pred_mode_t *config);
  449. /**
  450. * @brief MMC predictor config mode
  451. * @param [in] base MMC base address
  452. * @param [in] index predictor index(0/1)
  453. * @param [in] config mmc_pred_mode_t
  454. */
  455. void mmc_pred_config_mode(MMC_Type *base, uint8_t index, mmc_pred_mode_t *config);
  456. /**
  457. * @brief MMC predictor config position parameter
  458. * @param [in] base MMC base address
  459. * @param [in] index predictor index(0/1)
  460. * @param [in] para mmc_pos_or_delta_pos_input_t
  461. * @param [in] req_reload request to update parameter cmd
  462. *
  463. * @note 2 predictors can be set simultaneously by call mmc_pred_reload_pos_cmd()
  464. */
  465. void mmc_pred_config_pos_para(MMC_Type *base, uint8_t index, mmc_pos_or_delta_pos_input_t *para, bool req_reload);
  466. /**
  467. * @brief MMC predictor reload position parameter cmd
  468. * @param [in] base MMC base address
  469. * @param [in] cmd mmc_pred_reload_pos_cmd_t
  470. */
  471. static inline void mmc_pred_reload_pos_cmd(MMC_Type *base, mmc_pred_reload_pos_cmd_t cmd)
  472. {
  473. base->CR &= ~(MMC_CR_INI_BR0_POS_REQ_MASK | MMC_CR_INI_BR0_POS_REQ_MASK);
  474. base->CR |= cmd << MMC_CR_INI_BR1_POS_REQ_SHIFT;
  475. }
  476. /**
  477. * @brief MMC predictor update delta parameter
  478. * @param [in] base MMC base address
  479. * @param [in] index predictor index(0/1)
  480. * @param [in] para mmc_pos_or_delta_pos_input_t
  481. */
  482. void mmc_pred_config_delta_para(MMC_Type *base, uint8_t index, mmc_pos_or_delta_pos_input_t *para);
  483. /**
  484. * @brief MMC predictor config period time
  485. * @param [in] base MMC base address
  486. * @param [in] index predictor index(0/1)
  487. * @param [in] time mmc_pred_period_time_t
  488. */
  489. void mmc_pred_config_period_time(MMC_Type *base, uint8_t index, mmc_pred_period_time_t *time);
  490. /**
  491. * @brief MMC predictor config position trigger
  492. * @param [in] base MMC base address
  493. * @param [in] index predictor index(0/1)
  494. * @param [in] trig mmc_pos_trig_t
  495. */
  496. void mmc_pred_config_position_trig(MMC_Type *base, uint8_t index, mmc_pos_trig_t *trig);
  497. /**
  498. * @brief MMC predictor config speed trigger
  499. * @param [in] base MMC base address
  500. * @param [in] index predictor index(0/1)
  501. * @param [in] trig mmc_speed_trig_t
  502. */
  503. void mmc_pred_config_speed_trig(MMC_Type *base, uint8_t index, mmc_speed_trig_t *trig);
  504. /**
  505. * @brief MMC predictor disable position trigger
  506. * @param [in] base MMC base address
  507. * @param [in] index predictor index(0/1)
  508. */
  509. static inline void mmc_pred_disable_position_trig(MMC_Type *base, uint8_t index)
  510. {
  511. base->BR[index].BR_TRG_POS_CFG &= ~MMC_BR_BR_TRG_POS_CFG_EN_MASK;
  512. }
  513. /**
  514. * @brief MMC predictor disable speed trigger
  515. * @param [in] base MMC base address
  516. * @param [in] index predictor index(0/1)
  517. */
  518. static inline void mmc_pred_disable_speed_trig(MMC_Type *base, uint8_t index)
  519. {
  520. base->BR[index].BR_TRG_SPEED_CFG &= ~MMC_BR_BR_TRG_SPEED_CFG_EN_MASK;
  521. }
  522. /**
  523. * @brief MMC predictor get result
  524. * @param [in] base MMC base address
  525. * @param [in] index predictor index(0/1)
  526. * @param [out] pos_out mmc_pos_out_t
  527. */
  528. void mmc_pred_get_result(MMC_Type *base, uint8_t index, mmc_pos_out_t *pos_out);
  529. /**
  530. * @brief MMC predictor get result
  531. * @param [in] base MMC base address
  532. * @param [out] para mmc_pos_or_delta_pos_input_t
  533. */
  534. void mmc_get_default_pos_or_delta_pos_para(MMC_Type *base, mmc_pos_or_delta_pos_input_t *para);
  535. #ifdef __cplusplus
  536. }
  537. #endif
  538. /**
  539. * @}
  540. */
  541. #endif /* HPM_MMC_DRV_H */