Lines Matching refs:regs
42 int mec_hal_btimer_has_counter32(struct mec_btmr_regs *regs);
45 int mec_hal_btimer_init(struct mec_btmr_regs *regs, uint32_t freq_div,
50 int mec_hal_btimer_reset(struct mec_btmr_regs *regs, uint32_t flags);
52 int mec_hal_btimer_girq_ctrl(struct mec_btmr_regs *regs, uint8_t enable);
53 int mec_hal_btimer_girq_status_clr(struct mec_btmr_regs *regs);
55 uint32_t mec_hal_btimer_freq(struct mec_btmr_regs *regs);
57 void mec_hal_btimer_pre_and_reload(struct mec_btmr_regs *regs,
63 void mec_hal_btimer_start_load(struct mec_btmr_regs *regs, uint32_t initial_count,
65 void mec_hal_btimer_auto_restart(struct mec_btmr_regs *regs, uint8_t enable);
66 bool mec_hal_btimer_is_auto_restart(struct mec_btmr_regs *regs);
68 bool mec_hal_btimer_is_enabled(struct mec_btmr_regs *regs);
69 bool mec_hal_btimer_is_started(struct mec_btmr_regs *regs);
70 bool mec_hal_btimer_is_counting_up(struct mec_btmr_regs *regs);
72 void mec_hal_btimer_reload_run(struct mec_btmr_regs *regs, uint32_t new_count);
73 void mec_hal_btimer_intr_clr(struct mec_btmr_regs *regs);
74 void mec_hal_btimer_intr_en(struct mec_btmr_regs *regs, uint8_t enable);
79 static inline uint32_t mec_hal_btimer_count(struct mec_btmr_regs *regs) in mec_hal_btimer_count() argument
81 return regs->COUNT; in mec_hal_btimer_count()
84 static inline uint32_t mec_hal_btimer_preload(struct mec_btmr_regs *regs) in mec_hal_btimer_preload() argument
86 return regs->PRELOAD; in mec_hal_btimer_preload()
89 static inline void mec_hal_btimer_preload_set(struct mec_btmr_regs *regs, uint32_t preload) in mec_hal_btimer_preload_set() argument
91 regs->PRELOAD = preload; in mec_hal_btimer_preload_set()
94 static inline void mec_hal_btimer_count_set(struct mec_btmr_regs *regs, uint32_t cnt) in mec_hal_btimer_count_set() argument
96 regs->COUNT = cnt; in mec_hal_btimer_count_set()
99 static inline uint32_t mec_hal_btimer_status(struct mec_btmr_regs *regs) in mec_hal_btimer_status() argument
101 return regs->STATUS & MEC_BIT(MEC_BTMR_STATUS_EVENT_Pos); in mec_hal_btimer_status()
104 static inline void mec_hal_btimer_enable(struct mec_btmr_regs *regs) in mec_hal_btimer_enable() argument
106 regs->CTRL |= MEC_BIT(MEC_BTMR_CTRL_ENABLE_Pos); in mec_hal_btimer_enable()
109 static inline void mec_hal_btimer_disable(struct mec_btmr_regs *regs) in mec_hal_btimer_disable() argument
111 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_BTMR_CTRL_ENABLE_Pos); in mec_hal_btimer_disable()
114 static inline void mec_hal_btimer_start(struct mec_btmr_regs *regs) in mec_hal_btimer_start() argument
116 regs->CTRL |= (MEC_BIT(MEC_BTMR_CTRL_ENABLE_Pos) | MEC_BIT(MEC_BTMR_CTRL_START_Pos)); in mec_hal_btimer_start()
119 static inline void mec_hal_btimer_stop(struct mec_btmr_regs *regs) in mec_hal_btimer_stop() argument
121 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_BTMR_CTRL_START_Pos); in mec_hal_btimer_stop()
124 static inline void mec_hal_btimer_halt(struct mec_btmr_regs *regs) in mec_hal_btimer_halt() argument
126 regs->CTRL |= MEC_BIT(MEC_BTMR_CTRL_HALT_Pos); in mec_hal_btimer_halt()
129 static inline void mec_hal_btimer_unhalt(struct mec_btmr_regs *regs) in mec_hal_btimer_unhalt() argument
131 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_BTMR_CTRL_HALT_Pos); in mec_hal_btimer_unhalt()
134 static inline void mec_hal_btimer_reload(struct mec_btmr_regs *regs) in mec_hal_btimer_reload() argument
136 regs->CTRL |= MEC_BIT(MEC_BTMR_CTRL_RELOAD_Pos); in mec_hal_btimer_reload()