1/* 2 * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3 * 4 * SPDX-License-Identifier: GPL-2.0-only 5 */ 6 7#pragma once 8 9#define TMR0_IRQ_PEND_FLAG BIT(0) 10 11struct timer { 12 uint32_t tmr_irq_en_reg; /* Timer IRQ Enable Register 0x00 */ 13 uint32_t tmr_irq_sta_reg; /* Timer Status Register 0x04 */ 14 uint32_t tmr_reserved01[2]; 15 uint32_t tmr0_ctrl_reg; /* Timer 0 Control Register 0x10 */ 16 uint32_t tmr0_intv_value_reg; /* Timer 0 Interval Value Register 0x14 */ 17 uint32_t tmr0_cur_value_reg; /* Timer 0 Current Value Register 0x18 */ 18}; 19typedef volatile struct timer timer_t; 20extern timer_t *timer; 21 22static inline void resetTimer(void) 23{ 24 timer->tmr_irq_sta_reg = TMR0_IRQ_PEND_FLAG; 25} 26 27