libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
opamp_common_v1.c
Go to the documentation of this file.
1/** @addtogroup opamp_file OPAMP peripheral API
2 * @ingroup peripheral_apis
3 */
4
5/*
6 * This file is part of the libopencm3 project.
7 *
8 * This library is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22/**@{*/
23
25
26bool opamp_read_outcal(uint32_t base)
27{
28 return (OPAMP_CSR(base) >> OPAMP_CSR_OUTCAL_SHIFT)
30}
31
32void opamp_tcm_enable(uint32_t base)
33{
35}
36
37void opamp_tcm_disable(uint32_t base)
38{
39 OPAMP_CSR(base) &= ~OPAMP_CSR_TCM_EN;
40}
41
42void opamp_vps_select(uint32_t base, uint32_t vps)
43{
46 OPAMP_CSR(base) |= vps << OPAMP_CSR_VPS_SEL_SHIFT;
47}
48
49void opamp_vms_select(uint32_t base, uint32_t vms)
50{
53 OPAMP_CSR(base) |= vms << OPAMP_CSR_VMS_SEL_SHIFT;
54}
55
56/**@}*/
#define OPAMP_CSR_VMS_SEL_MASK
#define OPAMP_CSR_TCM_EN
#define OPAMP_CSR_VPS_SEL_MASK
#define OPAMP_CSR_OUTCAL_SHIFT
#define OPAMP_CSR_OUTCAL_MASK
#define OPAMP_CSR_VMS_SEL_SHIFT
#define OPAMP_CSR_VPS_SEL_SHIFT
#define OPAMP_CSR(opamp_base)
bool opamp_read_outcal(uint32_t base)
void opamp_vms_select(uint32_t base, uint32_t vms)
void opamp_vps_select(uint32_t base, uint32_t vps)
void opamp_tcm_enable(uint32_t base)
void opamp_tcm_disable(uint32_t base)