MAX32680 Peripheral Driver API
Peripheral Driver API for the MAX32680
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
lpcmp.h
1
6/******************************************************************************
7 *
8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9 * Analog Devices, Inc.),
10 * Copyright (C) 2023-2024 Analog Devices, Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 ******************************************************************************/
25
26/* Define to prevent redundant inclusion */
27#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_LPCMP_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_LPCMP_H_
29
30/* **** Includes **** */
31#include <stdint.h>
32#include "lpcmp_regs.h"
33#include "mcr_regs.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
43typedef enum {
44 MXC_LPCMP_POL_RISE = 0, //< Comparator interrupt happens on rising edge of comparator output
45 MXC_LPCMP_POL_FALL = 1, //< Comparator interrupt occurs on falling edge of comparator output
46} mxc_lpcmp_polarity_t;
47
52typedef enum {
53 MXC_LPCMP_CMP0 =
54 0, //< Comparator output high when positive input is greater than negative input
55 MXC_LPCMP_CMP1 =
56 1, //< Comparator output high when negative input is greater than positive input
57 MXC_LPCMP_CMP2 =
58 2, //< Comparator output high when negative input is greater than positive input
59 MXC_LPCMP_CMP3 =
60 3, //< Comparator output high when negative input is greater than positive input
61} mxc_lpcmp_cmpsel_t;
62
66typedef volatile uint32_t *mxc_lpcmp_ctrl_reg_t;
67
75int MXC_LPCMP_Init(mxc_lpcmp_cmpsel_t cmp);
76
84int MXC_LPCMP_Shutdown(mxc_lpcmp_cmpsel_t cmp);
85
92int MXC_LPCMP_EnableInt(mxc_lpcmp_cmpsel_t cmp, mxc_lpcmp_polarity_t pol);
93
99int MXC_LPCMP_DisableInt(mxc_lpcmp_cmpsel_t cmp);
100
108int MXC_LPCMP_GetFlags(mxc_lpcmp_cmpsel_t cmp);
109
115int MXC_LPCMP_ClearFlags(mxc_lpcmp_cmpsel_t cmp);
116
123int MXC_LPCMP_SelectPolarity(mxc_lpcmp_cmpsel_t cmp, mxc_lpcmp_polarity_t pol);
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_LPCMP_H_
Registers, Bit Masks and Bit Positions for the LPCMP Peripheral Module.
Registers, Bit Masks and Bit Positions for the MCR Peripheral Module.