RTEMS 6.1-rc2
Loading...
Searching...
No Matches
xttcps_hw.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (C) 2010 - 2021 Xilinx, Inc. All rights reserved.
3* SPDX-License-Identifier: MIT
4******************************************************************************/
5
6/*****************************************************************************/
32#ifndef XTTCPS_HW_H /* prevent circular inclusions */
33#define XTTCPS_HW_H /* by using protection macros */
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/***************************** Include Files *********************************/
40
41#include "xil_types.h"
42#include "xil_assert.h"
43#include "xil_io.h"
44#ifdef __rtems__
45#include <xil_system.h>
46#endif
47
48/************************** Constant Definitions *****************************/
49/*
50 * Flag for a9 processor
51 */
52 #if !defined (ARMR5) && !defined (__aarch64__) && !defined (ARMA53_32)
53 #define ARMA9
54 #endif
55
62#define XTTCPS_CLK_CNTRL_OFFSET 0x00000000U
63#define XTTCPS_CNT_CNTRL_OFFSET 0x0000000CU
64#define XTTCPS_COUNT_VALUE_OFFSET 0x00000018U
65#define XTTCPS_INTERVAL_VAL_OFFSET 0x00000024U
66#define XTTCPS_MATCH_0_OFFSET 0x00000030U
67#define XTTCPS_MATCH_1_OFFSET 0x0000003CU
68#define XTTCPS_MATCH_2_OFFSET 0x00000048U
69#define XTTCPS_ISR_OFFSET 0x00000054U
70#define XTTCPS_IER_OFFSET 0x00000060U
71/* @} */
72
77#define XTTCPS_CLK_CNTRL_PS_EN_MASK 0x00000001U
78#define XTTCPS_CLK_CNTRL_PS_VAL_MASK 0x0000001EU
79#define XTTCPS_CLK_CNTRL_PS_VAL_SHIFT 1U
80#define XTTCPS_CLK_CNTRL_PS_DISABLE 16U
81#define XTTCPS_CLK_CNTRL_SRC_MASK 0x00000020U
82#define XTTCPS_CLK_CNTRL_EXT_EDGE_MASK 0x00000040U
83/* @} */
84
89#define XTTCPS_CNT_CNTRL_DIS_MASK 0x00000001U
90#define XTTCPS_CNT_CNTRL_INT_MASK 0x00000002U
91#define XTTCPS_CNT_CNTRL_DECR_MASK 0x00000004U
92#define XTTCPS_CNT_CNTRL_MATCH_MASK 0x00000008U
93#define XTTCPS_CNT_CNTRL_RST_MASK 0x00000010U
94#define XTTCPS_CNT_CNTRL_EN_WAVE_MASK 0x00000020U
95#define XTTCPS_CNT_CNTRL_POL_WAVE_MASK 0x00000040U
96#define XTTCPS_CNT_CNTRL_RESET_VALUE 0x00000021U
97/* @} */
98
103#if defined(ARMA9)
104#define XTTCPS_COUNT_VALUE_MASK 0x0000FFFFU
105#else
106#define XTTCPS_COUNT_VALUE_MASK 0xFFFFFFFFU
107#endif
108/* @} */
109
115#if defined(ARMA9)
116#define XTTCPS_INTERVAL_VAL_MASK 0x0000FFFFU
117#else
118#define XTTCPS_INTERVAL_VAL_MASK 0xFFFFFFFFU
119#endif
120/* @} */
121
127#if defined(ARMA9)
128#define XTTCPS_MATCH_MASK 0x0000FFFFU
129#else
130#define XTTCPS_MATCH_MASK 0xFFFFFFFFU
131#endif
132#define XTTCPS_NUM_MATCH_REG 3U
133/* @} */
134
140#define XTTCPS_IXR_INTERVAL_MASK 0x00000001U
141#define XTTCPS_IXR_MATCH_0_MASK 0x00000002U
142#define XTTCPS_IXR_MATCH_1_MASK 0x00000004U
143#define XTTCPS_IXR_MATCH_2_MASK 0x00000008U
144#define XTTCPS_IXR_CNT_OVR_MASK 0x00000010U
145#define XTTCPS_IXR_ALL_MASK 0x0000001FU
146/* @} */
147
148
149/***************** Macros (Inline Functions) Definitions *********************/
150
151/****************************************************************************/
165#define XTtcPs_ReadReg(BaseAddress, RegOffset) \
166 (Xil_In32((BaseAddress) + (u32)(RegOffset)))
167
168/****************************************************************************/
184#define XTtcPs_WriteReg(BaseAddress, RegOffset, Data) \
185 (Xil_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)))
186
187/****************************************************************************/
200#define XTtcPs_Match_N_Offset(MatchIndex) \
201 ((u32)XTTCPS_MATCH_0_OFFSET + ((u32)(12U) * (u32)(MatchIndex)))
202
203/************************** Function Prototypes ******************************/
204
205/************************** Variable Definitions *****************************/
206#ifdef __cplusplus
207}
208#endif
209#endif /* end of protection macro */