Lines Matching refs:regs
38 int mec_hal_wdt_init(struct mec_wdt_regs *regs, uint16_t n32k_ticks, uint32_t flags) in mec_hal_wdt_init() argument
42 if ((uintptr_t)regs != (uintptr_t)MEC_WDT0_BASE) { in mec_hal_wdt_init()
46 regs->CTRL = ctrl; in mec_hal_wdt_init()
47 regs->IEN = 0u; in mec_hal_wdt_init()
48 regs->STATUS = UINT32_MAX; in mec_hal_wdt_init()
53 regs->LOAD = n32k_ticks; in mec_hal_wdt_init()
69 regs->IEN |= MEC_BIT(MEC_WDT_IEN_INTREN_Pos); in mec_hal_wdt_init()
73 regs->CTRL = ctrl; in mec_hal_wdt_init()
78 bool mec_hal_wdt_is_enabled(struct mec_wdt_regs *regs) in mec_hal_wdt_is_enabled() argument
80 if (regs->CTRL & MEC_BIT(MEC_WDT_CTRL_ENABLE_Pos)) { in mec_hal_wdt_is_enabled()
87 void mec_hal_wdt_enable(struct mec_wdt_regs *regs) in mec_hal_wdt_enable() argument
89 regs->CTRL |= MEC_BIT(MEC_WDT_CTRL_ENABLE_Pos); in mec_hal_wdt_enable()
92 void mec_hal_wdt_disable(struct mec_wdt_regs *regs) in mec_hal_wdt_disable() argument
94 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_WDT_CTRL_ENABLE_Pos); in mec_hal_wdt_disable()
97 void mec_hal_wdt_intr_ctrl(struct mec_wdt_regs *regs, uint8_t enable) in mec_hal_wdt_intr_ctrl() argument
100 regs->CTRL |= MEC_BIT(MEC_WDT_CTRL_RST_MODE_INTR_Pos); in mec_hal_wdt_intr_ctrl()
101 regs->IEN |= MEC_BIT(MEC_WDT_IEN_INTREN_Pos); in mec_hal_wdt_intr_ctrl()
104 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_WDT_CTRL_RST_MODE_INTR_Pos); in mec_hal_wdt_intr_ctrl()
105 regs->IEN &= (uint32_t)~MEC_BIT(MEC_WDT_IEN_INTREN_Pos); in mec_hal_wdt_intr_ctrl()
109 uint8_t mec_hal_wdt_intr_get_status(struct mec_wdt_regs *regs) in mec_hal_wdt_intr_get_status() argument
111 return (uint8_t)(regs->STATUS & 0xffu); in mec_hal_wdt_intr_get_status()
114 void mec_hal_wdt_intr_clear_status(struct mec_wdt_regs *regs) in mec_hal_wdt_intr_clear_status() argument
116 regs->STATUS = MEC_BIT(MEC_WDT_STATUS_ISTATUS_Pos); in mec_hal_wdt_intr_clear_status()
120 void mec_hal_wdt_girq_enable(struct mec_wdt_regs *regs, uint8_t enable) in mec_hal_wdt_girq_enable() argument
122 (void)regs; in mec_hal_wdt_girq_enable()
127 void mec_hal_wdt_intr_helper(struct mec_wdt_regs *regs, uint16_t counts_before_reset) in mec_hal_wdt_intr_helper() argument
131 regs->CTRL &= (uint32_t)~(MEC_BIT(MEC_WDT_CTRL_ENABLE_Pos) in mec_hal_wdt_intr_helper()
133 regs->IEN = 0u; in mec_hal_wdt_intr_helper()
134 regs->STATUS = MEC_BIT(MEC_WDT_STATUS_ISTATUS_Pos); in mec_hal_wdt_intr_helper()
141 regs->LOAD = load; in mec_hal_wdt_intr_helper()
142 regs->CTRL |= MEC_BIT(MEC_WDT_CTRL_ENABLE_Pos); in mec_hal_wdt_intr_helper()
146 void mec_hal_wdt_restart(struct mec_wdt_regs *regs) in mec_hal_wdt_restart() argument
148 regs->KICK = 0u; in mec_hal_wdt_restart()
152 void mec_hal_wdt_reload(struct mec_wdt_regs *regs, uint16_t nmsec) in mec_hal_wdt_reload() argument
154 regs->LOAD = nmsec; in mec_hal_wdt_reload()
155 regs->KICK = nmsec; in mec_hal_wdt_reload()
158 void mec_hal_wdt_debug_stall(struct mec_wdt_regs *regs, uint8_t enable) in mec_hal_wdt_debug_stall() argument
161 regs->CTRL |= MEC_BIT(MEC_WDT_CTRL_STALL_JTAG_Pos); in mec_hal_wdt_debug_stall()
163 regs->CTRL &= (uint32_t)~MEC_BIT(MEC_WDT_CTRL_STALL_JTAG_Pos); in mec_hal_wdt_debug_stall()
167 void mec_hal_wdt_kick(struct mec_wdt_regs *regs) in mec_hal_wdt_kick() argument
169 regs->KICK = 0; in mec_hal_wdt_kick()
172 uint32_t mec_hal_wdt_count(struct mec_wdt_regs *regs) in mec_hal_wdt_count() argument
174 return regs->COUNT; in mec_hal_wdt_count()