MAX32672 Peripheral Driver API
Peripheral Driver API for the MAX32672
qdec_regs.h
Go to the documentation of this file.
1
8/******************************************************************************
9 *
10 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
11 * Analog Devices, Inc.),
12 * Copyright (C) 2023-2024 Analog Devices, Inc.
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License");
15 * you may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 * http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 *
26 ******************************************************************************/
27
28#ifndef LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32672_INCLUDE_QDEC_REGS_H_
29#define LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32672_INCLUDE_QDEC_REGS_H_
30
31/* **** Includes **** */
32#include <stdint.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#if defined (__ICCARM__)
39 #pragma system_include
40#endif
41
42#if defined (__CC_ARM)
43 #pragma anon_unions
44#endif
46/*
47 If types are not defined elsewhere (CMSIS) define them here
48*/
49#ifndef __IO
50#define __IO volatile
51#endif
52#ifndef __I
53#define __I volatile const
54#endif
55#ifndef __O
56#define __O volatile
57#endif
58#ifndef __R
59#define __R volatile const
60#endif
62
63/* **** Definitions **** */
64
76typedef struct {
77 __IO uint32_t ctrl;
78 __IO uint32_t intfl;
79 __IO uint32_t inten;
80 __IO uint32_t maxcnt;
81 __IO uint32_t initial;
82 __IO uint32_t compare;
83 __I uint32_t index;
84 __I uint32_t capture;
85 __I uint32_t status;
86 __IO uint32_t position;
87 __IO uint32_t capdly;
89
90/* Register offsets for module QDEC */
97#define MXC_R_QDEC_CTRL ((uint32_t)0x00000000UL)
98#define MXC_R_QDEC_INTFL ((uint32_t)0x00000004UL)
99#define MXC_R_QDEC_INTEN ((uint32_t)0x00000008UL)
100#define MXC_R_QDEC_MAXCNT ((uint32_t)0x0000000CUL)
101#define MXC_R_QDEC_INITIAL ((uint32_t)0x00000010UL)
102#define MXC_R_QDEC_COMPARE ((uint32_t)0x00000014UL)
103#define MXC_R_QDEC_INDEX ((uint32_t)0x00000018UL)
104#define MXC_R_QDEC_CAPTURE ((uint32_t)0x0000001CUL)
105#define MXC_R_QDEC_STATUS ((uint32_t)0x00000020UL)
106#define MXC_R_QDEC_POSITION ((uint32_t)0x00000024UL)
107#define MXC_R_QDEC_CAPDLY ((uint32_t)0x00000028UL)
116#define MXC_F_QDEC_CTRL_EN_POS 0
117#define MXC_F_QDEC_CTRL_EN ((uint32_t)(0x1UL << MXC_F_QDEC_CTRL_EN_POS))
119#define MXC_F_QDEC_CTRL_MODE_POS 1
120#define MXC_F_QDEC_CTRL_MODE ((uint32_t)(0x3UL << MXC_F_QDEC_CTRL_MODE_POS))
121#define MXC_V_QDEC_CTRL_MODE_X1MODE ((uint32_t)0x0UL)
122#define MXC_S_QDEC_CTRL_MODE_X1MODE (MXC_V_QDEC_CTRL_MODE_X1MODE << MXC_F_QDEC_CTRL_MODE_POS)
123#define MXC_V_QDEC_CTRL_MODE_X2MODE ((uint32_t)0x1UL)
124#define MXC_S_QDEC_CTRL_MODE_X2MODE (MXC_V_QDEC_CTRL_MODE_X2MODE << MXC_F_QDEC_CTRL_MODE_POS)
125#define MXC_V_QDEC_CTRL_MODE_X4MODE ((uint32_t)0x2UL)
126#define MXC_S_QDEC_CTRL_MODE_X4MODE (MXC_V_QDEC_CTRL_MODE_X4MODE << MXC_F_QDEC_CTRL_MODE_POS)
128#define MXC_F_QDEC_CTRL_SWAP_POS 3
129#define MXC_F_QDEC_CTRL_SWAP ((uint32_t)(0x1UL << MXC_F_QDEC_CTRL_SWAP_POS))
131#define MXC_F_QDEC_CTRL_FILTER_POS 4
132#define MXC_F_QDEC_CTRL_FILTER ((uint32_t)(0x3UL << MXC_F_QDEC_CTRL_FILTER_POS))
133#define MXC_V_QDEC_CTRL_FILTER_1_SAMPLE ((uint32_t)0x0UL)
134#define MXC_S_QDEC_CTRL_FILTER_1_SAMPLE (MXC_V_QDEC_CTRL_FILTER_1_SAMPLE << MXC_F_QDEC_CTRL_FILTER_POS)
135#define MXC_V_QDEC_CTRL_FILTER_2_SAMPLES ((uint32_t)0x1UL)
136#define MXC_S_QDEC_CTRL_FILTER_2_SAMPLES (MXC_V_QDEC_CTRL_FILTER_2_SAMPLES << MXC_F_QDEC_CTRL_FILTER_POS)
137#define MXC_V_QDEC_CTRL_FILTER_3_SAMPLES ((uint32_t)0x2UL)
138#define MXC_S_QDEC_CTRL_FILTER_3_SAMPLES (MXC_V_QDEC_CTRL_FILTER_3_SAMPLES << MXC_F_QDEC_CTRL_FILTER_POS)
139#define MXC_V_QDEC_CTRL_FILTER_4_SAMPLES ((uint32_t)0x3UL)
140#define MXC_S_QDEC_CTRL_FILTER_4_SAMPLES (MXC_V_QDEC_CTRL_FILTER_4_SAMPLES << MXC_F_QDEC_CTRL_FILTER_POS)
142#define MXC_F_QDEC_CTRL_RST_INDEX_POS 6
143#define MXC_F_QDEC_CTRL_RST_INDEX ((uint32_t)(0x1UL << MXC_F_QDEC_CTRL_RST_INDEX_POS))
145#define MXC_F_QDEC_CTRL_RST_MAXCNT_POS 7
146#define MXC_F_QDEC_CTRL_RST_MAXCNT ((uint32_t)(0x1UL << MXC_F_QDEC_CTRL_RST_MAXCNT_POS))
148#define MXC_F_QDEC_CTRL_STICKY_POS 8
149#define MXC_F_QDEC_CTRL_STICKY ((uint32_t)(0x1UL << MXC_F_QDEC_CTRL_STICKY_POS))
151#define MXC_F_QDEC_CTRL_PSC_POS 16
152#define MXC_F_QDEC_CTRL_PSC ((uint32_t)(0x7UL << MXC_F_QDEC_CTRL_PSC_POS))
153#define MXC_V_QDEC_CTRL_PSC_DIV1 ((uint32_t)0x0UL)
154#define MXC_S_QDEC_CTRL_PSC_DIV1 (MXC_V_QDEC_CTRL_PSC_DIV1 << MXC_F_QDEC_CTRL_PSC_POS)
155#define MXC_V_QDEC_CTRL_PSC_DIV2 ((uint32_t)0x1UL)
156#define MXC_S_QDEC_CTRL_PSC_DIV2 (MXC_V_QDEC_CTRL_PSC_DIV2 << MXC_F_QDEC_CTRL_PSC_POS)
157#define MXC_V_QDEC_CTRL_PSC_DIV4 ((uint32_t)0x2UL)
158#define MXC_S_QDEC_CTRL_PSC_DIV4 (MXC_V_QDEC_CTRL_PSC_DIV4 << MXC_F_QDEC_CTRL_PSC_POS)
159#define MXC_V_QDEC_CTRL_PSC_DIV8 ((uint32_t)0x3UL)
160#define MXC_S_QDEC_CTRL_PSC_DIV8 (MXC_V_QDEC_CTRL_PSC_DIV8 << MXC_F_QDEC_CTRL_PSC_POS)
161#define MXC_V_QDEC_CTRL_PSC_DIV16 ((uint32_t)0x4UL)
162#define MXC_S_QDEC_CTRL_PSC_DIV16 (MXC_V_QDEC_CTRL_PSC_DIV16 << MXC_F_QDEC_CTRL_PSC_POS)
163#define MXC_V_QDEC_CTRL_PSC_DIV32 ((uint32_t)0x5UL)
164#define MXC_S_QDEC_CTRL_PSC_DIV32 (MXC_V_QDEC_CTRL_PSC_DIV32 << MXC_F_QDEC_CTRL_PSC_POS)
165#define MXC_V_QDEC_CTRL_PSC_DIV64 ((uint32_t)0x6UL)
166#define MXC_S_QDEC_CTRL_PSC_DIV64 (MXC_V_QDEC_CTRL_PSC_DIV64 << MXC_F_QDEC_CTRL_PSC_POS)
167#define MXC_V_QDEC_CTRL_PSC_DIV128 ((uint32_t)0x7UL)
168#define MXC_S_QDEC_CTRL_PSC_DIV128 (MXC_V_QDEC_CTRL_PSC_DIV128 << MXC_F_QDEC_CTRL_PSC_POS)
178#define MXC_F_QDEC_INTFL_INDEX_POS 0
179#define MXC_F_QDEC_INTFL_INDEX ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_INDEX_POS))
181#define MXC_F_QDEC_INTFL_QERR_POS 1
182#define MXC_F_QDEC_INTFL_QERR ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_QERR_POS))
184#define MXC_F_QDEC_INTFL_COMPARE_POS 2
185#define MXC_F_QDEC_INTFL_COMPARE ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_COMPARE_POS))
187#define MXC_F_QDEC_INTFL_MAXCNT_POS 3
188#define MXC_F_QDEC_INTFL_MAXCNT ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_MAXCNT_POS))
190#define MXC_F_QDEC_INTFL_CAPTURE_POS 4
191#define MXC_F_QDEC_INTFL_CAPTURE ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_CAPTURE_POS))
193#define MXC_F_QDEC_INTFL_DIR_POS 5
194#define MXC_F_QDEC_INTFL_DIR ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_DIR_POS))
196#define MXC_F_QDEC_INTFL_MOVE_POS 6
197#define MXC_F_QDEC_INTFL_MOVE ((uint32_t)(0x1UL << MXC_F_QDEC_INTFL_MOVE_POS))
207#define MXC_F_QDEC_INTEN_INDEX_POS 0
208#define MXC_F_QDEC_INTEN_INDEX ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_INDEX_POS))
210#define MXC_F_QDEC_INTEN_QERR_POS 1
211#define MXC_F_QDEC_INTEN_QERR ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_QERR_POS))
213#define MXC_F_QDEC_INTEN_COMPARE_POS 2
214#define MXC_F_QDEC_INTEN_COMPARE ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_COMPARE_POS))
216#define MXC_F_QDEC_INTEN_MAXCNT_POS 3
217#define MXC_F_QDEC_INTEN_MAXCNT ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_MAXCNT_POS))
219#define MXC_F_QDEC_INTEN_CAPTURE_POS 4
220#define MXC_F_QDEC_INTEN_CAPTURE ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_CAPTURE_POS))
222#define MXC_F_QDEC_INTEN_DIR_POS 5
223#define MXC_F_QDEC_INTEN_DIR ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_DIR_POS))
225#define MXC_F_QDEC_INTEN_MOVE_POS 6
226#define MXC_F_QDEC_INTEN_MOVE ((uint32_t)(0x1UL << MXC_F_QDEC_INTEN_MOVE_POS))
236#define MXC_F_QDEC_MAXCNT_MAXCNT_POS 0
237#define MXC_F_QDEC_MAXCNT_MAXCNT ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_MAXCNT_MAXCNT_POS))
247#define MXC_F_QDEC_INITIAL_INITIAL_POS 0
248#define MXC_F_QDEC_INITIAL_INITIAL ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_INITIAL_INITIAL_POS))
258#define MXC_F_QDEC_COMPARE_COMPARE_POS 0
259#define MXC_F_QDEC_COMPARE_COMPARE ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_COMPARE_COMPARE_POS))
269#define MXC_F_QDEC_INDEX_INDEX_POS 0
270#define MXC_F_QDEC_INDEX_INDEX ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_INDEX_INDEX_POS))
280#define MXC_F_QDEC_CAPTURE_CAPTURE_POS 0
281#define MXC_F_QDEC_CAPTURE_CAPTURE ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_CAPTURE_CAPTURE_POS))
291#define MXC_F_QDEC_STATUS_DIR_POS 0
292#define MXC_F_QDEC_STATUS_DIR ((uint32_t)(0x1UL << MXC_F_QDEC_STATUS_DIR_POS))
302#define MXC_F_QDEC_POSITION_POSITION_POS 0
303#define MXC_F_QDEC_POSITION_POSITION ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_POSITION_POSITION_POS))
313#define MXC_F_QDEC_CAPDLY_CAPDLY_POS 0
314#define MXC_F_QDEC_CAPDLY_CAPDLY ((uint32_t)(0xFFFFFFFFUL << MXC_F_QDEC_CAPDLY_CAPDLY_POS))
318#ifdef __cplusplus
319}
320#endif
321
322#endif // LIBRARIES_CMSIS_DEVICE_MAXIM_MAX32672_INCLUDE_QDEC_REGS_H_
__I uint32_t index
Definition: qdec_regs.h:83
__IO uint32_t capdly
Definition: qdec_regs.h:87
__I uint32_t capture
Definition: qdec_regs.h:84
__IO uint32_t position
Definition: qdec_regs.h:86
__IO uint32_t intfl
Definition: qdec_regs.h:78
__I uint32_t status
Definition: qdec_regs.h:85
__IO uint32_t ctrl
Definition: qdec_regs.h:77
__IO uint32_t maxcnt
Definition: qdec_regs.h:80
__IO uint32_t initial
Definition: qdec_regs.h:81
__IO uint32_t inten
Definition: qdec_regs.h:79
__IO uint32_t compare
Definition: qdec_regs.h:82
Definition: qdec_regs.h:76