zephyr/drivers/counter/timer_cmsdk_apb.h
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00

40 lines
907 B
C

/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _DRIVERS_TIMER_CMSDK_AHB_
#define _DRIVERS_TIMER_CMSDK_AHB_
#include <counter.h>
#ifdef __cplusplus
extern "C" {
#endif
struct timer_cmsdk_apb {
/* Offset: 0x000 (R/W) control register */
volatile u32_t ctrl;
/* Offset: 0x004 (R/W) current value register */
volatile u32_t value;
/* Offset: 0x008 (R/W) reload value register */
volatile u32_t reload;
union {
/* Offset: 0x00C (R/ ) interrupt status register */
volatile u32_t intstatus;
/* Offset: 0x00C ( /W) interruptclear register */
volatile u32_t intclear;
};
};
#define TIMER_CTRL_IRQ_EN (1 << 3)
#define TIMER_CTRL_SEL_EXT_CLK (1 << 2)
#define TIMER_CTRL_SEL_EXT_EN (1 << 1)
#define TIMER_CTRL_EN (1 << 0)
#define TIMER_CTRL_INT_CLEAR (1 << 0)
#ifdef __cplusplus
}
#endif
#endif /* _DRIVERS_TIMER_CMSDK_AHB_ */