libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
g4/opamp.h
Go to the documentation of this file.
1/** @defgroup opamp_defines OPAMP Defines
2 *
3 * @brief <b>libopencm3 Defined Constants and Types for the STM32G4xx
4 * Operational Amplifier module</b>
5 *
6 * @ingroup STM32G4xx_defines
7 *
8 * @version 1.0.0
9 *
10 * @date 10 Dec 2020
11 *
12 *LGPL License Terms @ref lgpl_license
13 */
14/*
15 * This file is part of the libopencm3 project.
16 *
17 * This library is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public License
28 * along with this library. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31#ifndef LIBOPENCM3_OPAMP_H
32#define LIBOPENCM3_OPAMP_H
33/**@{*/
34
36
37#define OPAMP1 (OPAMP_BASE + 0x00)
38#define OPAMP2 (OPAMP_BASE + 0x04)
39#define OPAMP3 (OPAMP_BASE + 0x08)
40#define OPAMP4 (OPAMP_BASE + 0x0C)
41#define OPAMP5 (OPAMP_BASE + 0x10)
42#define OPAMP6 (OPAMP_BASE + 0x14)
43
44/* OpAmp registers */
45
46/* Control and status register (OPAMPx_CSR) */
47#define OPAMP1_CSR OPAMP_CSR(OPAMP1)
48#define OPAMP2_CSR OPAMP_CSR(OPAMP2)
49#define OPAMP3_CSR OPAMP_CSR(OPAMP3)
50#define OPAMP4_CSR OPAMP_CSR(OPAMP4)
51#define OPAMP5_CSR OPAMP_CSR(OPAMP5)
52#define OPAMP6_CSR OPAMP_CSR(OPAMP6)
53
54#define OPAMP1_TCMR OPAMP_TCMR(OPAMP1)
55#define OPAMP2_TCMR OPAMP_TCMR(OPAMP2)
56#define OPAMP3_TCMR OPAMP_TCMR(OPAMP3)
57#define OPAMP4_TCMR OPAMP_TCMR(OPAMP4)
58#define OPAMP5_TCMR OPAMP_TCMR(OPAMP5)
59#define OPAMP6_TCMR OPAMP_TCMR(OPAMP6)
60
61/* OPAMPx_CSR values */
62#define OPAMP1_CSR_VP_SEL_DAC3CH1 (0x3)
63#define OPAMP2_CSR_VP_SEL_VINP3 (0x3)
64#define OPAMP3_CSR_VP_SEL_DAC3CH2 (0x3)
65#define OPAMP4_CSR_VP_SEL_DAC4CH1 (0x3)
66#define OPAMP5_CSR_VP_SEL_DAC4CH2 (0x3)
67#define OPAMP6_CSR_VP_SEL_DAC3CH1 (0x3)
68
69/**@}*/
70#endif