/* * Copyright (C) 2010 Tobias Klauser * Copyright (C) 2010 chysun2000@gmail.com * * This file is part of nios2sim-ng. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #ifndef _TIMER_H_ #define _TIMER_H_ #include "device.h" #define TIMER_BASE 0x84842000 #define TIMER_SIZE 48 #define TIMER_IRQ IRQ_TIMER #define TIMER_REG_COUNT (TIMER_SIZE / sizeof(uint32_t)) #define TIMER_STATUS_REG 0 #define TIMER_CTRL_REG 1 #define TIMER_PERIODL_REG 2 #define TIMER_PERIODH_REG 3 #define TIMER_SNAPL_REG 4 #define TIMER_SNAPH_REG 5 #define TIMER_STATUS_TO_MASK 0x01 #define TIMER_STATUS_RUN_MASK 0x02 #define TIMER_CTRL_ITO_MASK 0x01 #define TIMER_CTRL_CONT_MASK 0x02 #define TIMER_CTRL_START_MASK 0x04 #define TIMER_CTRL_STOP_MASK 0x08 extern struct device timer_core; #endif /* _TIMER_H_ */