1 /* 2 * Copyright (c) 2017 Linaro Limited. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef ZEPHYR_DRIVERS_COUNTER_TIMER_CMSDK_APB_H_ 7 #define ZEPHYR_DRIVERS_COUNTER_TIMER_CMSDK_APB_H_ 8 9 #include <zephyr/drivers/counter.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 struct timer_cmsdk_apb { 16 /* Offset: 0x000 (R/W) control register */ 17 volatile uint32_t ctrl; 18 /* Offset: 0x004 (R/W) current value register */ 19 volatile uint32_t value; 20 /* Offset: 0x008 (R/W) reload value register */ 21 volatile uint32_t reload; 22 union { 23 /* Offset: 0x00C (R/ ) interrupt status register */ 24 volatile uint32_t intstatus; 25 /* Offset: 0x00C ( /W) interruptclear register */ 26 volatile uint32_t intclear; 27 }; 28 }; 29 30 #define TIMER_CTRL_IRQ_EN (1 << 3) 31 #define TIMER_CTRL_SEL_EXT_CLK (1 << 2) 32 #define TIMER_CTRL_SEL_EXT_EN (1 << 1) 33 #define TIMER_CTRL_EN (1 << 0) 34 #define TIMER_CTRL_INT_CLEAR (1 << 0) 35 36 #ifdef __cplusplus 37 } 38 #endif 39 40 #endif /* ZEPHYR_DRIVERS_COUNTER_TIMER_CMSDK_APB_H_ */ 41