Lines Matching refs:regs

41 int mec_hal_rtimer_init(struct mec_rtmr_regs *regs, uint32_t rtmr_config, uint32_t preload);
43 void mec_hal_rtimer_restart(struct mec_rtmr_regs *regs, uint32_t new_count, uint8_t restart);
45 uint32_t mec_hal_rtimer_status(struct mec_rtmr_regs *regs);
46 void mec_hal_rtimer_status_clear(struct mec_rtmr_regs *regs, uint32_t status);
47 void mec_hal_rtimer_status_clear_all(struct mec_rtmr_regs *regs);
49 void mec_hal_rtimer_intr_ctrl(struct mec_rtmr_regs *regs, uint8_t enable);
51 static inline void mec_hal_rtimer_auto_reload(struct mec_rtmr_regs *regs, uint8_t enable) in mec_hal_rtimer_auto_reload() argument
54 regs->CTRL |= MEC_BIT(MEC_RTMR_CTRL_AUTO_RELOAD_Pos); in mec_hal_rtimer_auto_reload()
56 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_RTMR_CTRL_AUTO_RELOAD_Pos); in mec_hal_rtimer_auto_reload()
60 static inline void mec_hal_rtimer_stop(struct mec_rtmr_regs *regs) in mec_hal_rtimer_stop() argument
62 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_RTMR_CTRL_START_Pos); in mec_hal_rtimer_stop()
65 static inline void mec_hal_rtimer_start(struct mec_rtmr_regs *regs) in mec_hal_rtimer_start() argument
67 regs->CTRL |= MEC_BIT(MEC_RTMR_CTRL_START_Pos); in mec_hal_rtimer_start()
70 static inline bool mec_hal_rtimer_is_started(struct mec_rtmr_regs *regs) in mec_hal_rtimer_is_started() argument
72 return (regs->CTRL & MEC_BIT(MEC_RTMR_CTRL_START_Pos)) ? true : false; in mec_hal_rtimer_is_started()
75 static inline uint32_t mec_hal_rtimer_count(struct mec_rtmr_regs *regs) in mec_hal_rtimer_count() argument
77 return regs->COUNT; in mec_hal_rtimer_count()
80 static inline uint32_t mec_hal_rtimer_preload(struct mec_rtmr_regs *regs) in mec_hal_rtimer_preload() argument
82 return regs->PRELOAD; in mec_hal_rtimer_preload()
89 static inline void mec_hal_rtimer_preload_set(struct mec_rtmr_regs *regs, uint32_t preload) in mec_hal_rtimer_preload_set() argument
91 regs->PRELOAD = preload; in mec_hal_rtimer_preload_set()
94 static inline void mec_hal_rtimer_halt(struct mec_rtmr_regs *regs) in mec_hal_rtimer_halt() argument
96 regs->CTRL |= MEC_BIT(MEC_RTMR_CTRL_FW_HALT_Pos); in mec_hal_rtimer_halt()
99 static inline void mec_hal_rtimer_unhalt(struct mec_rtmr_regs *regs) in mec_hal_rtimer_unhalt() argument
101 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_RTMR_CTRL_FW_HALT_Pos); in mec_hal_rtimer_unhalt()
104 static inline bool mec_hal_rtimer_is_counting(struct mec_rtmr_regs *regs) in mec_hal_rtimer_is_counting() argument
106 return (regs->COUNT != 0) ? true : false; in mec_hal_rtimer_is_counting()
113 static inline void mec_hal_rtimer_stop_and_load(struct mec_rtmr_regs *regs, uint32_t count_down, in mec_hal_rtimer_stop_and_load() argument
116 regs->CTRL = 0U; in mec_hal_rtimer_stop_and_load()
117 regs->CTRL = MEC_BIT(MEC_RTMR_CTRL_ENABLE_Pos); in mec_hal_rtimer_stop_and_load()
118 regs->PRELOAD = count_down; in mec_hal_rtimer_stop_and_load()
119 regs->CTRL = start_val; in mec_hal_rtimer_stop_and_load()