ComparatorLPF3LP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2023, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /* !****************************************************************************
34  * @file ComparatorLPF3LP.h
35  * @brief Comparator driver implementation for the Low-Power Comparator on
36  * the Low Power F3 family devices
37  *
38  * This Comparator driver is meant to operate the Low-Power Comparator
39  * peripheral for Low Power F3 devices.
40  *
41  * Refer to @ref Comparator.h for a complete description of APIs & example use.
42  *
43  *******************************************************************************
44  */
45 
46 #ifndef ti_drivers_comparator_ComparatorLPF3LP__include
47 #define ti_drivers_comparator_ComparatorLPF3LP__include
48 
49 #include <stdint.h>
50 #include <stdbool.h>
51 
52 #include <ti/drivers/Comparator.h>
53 #include <ti/drivers/dpl/HwiP.h>
54 #include <ti/drivers/dpl/SemaphoreP.h>
55 
56 /* Driverlib header files */
57 #include <ti/devices/DeviceFamily.h>
58 #include DeviceFamily_constructPath(driverlib/lpcmp.h)
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
80 typedef enum
81 {
82  ComparatorLPF3LP_NEG_INPUT_VDDD = LPCMP_NEG_INPUT_VDDD,
83  ComparatorLPF3LP_NEG_INPUT_VDDA = LPCMP_NEG_INPUT_VDDA,
84  ComparatorLPF3LP_NEG_INPUT_A2 = LPCMP_NEG_INPUT_A2,
85  ComparatorLPF3LP_NEG_INPUT_A3 = LPCMP_NEG_INPUT_A3
87 
106 typedef enum
107 {
108  ComparatorLPF3LP_POS_INPUT_A1 = LPCMP_POS_INPUT_A1,
109  ComparatorLPF3LP_POS_INPUT_A2 = LPCMP_POS_INPUT_A2,
110  ComparatorLPF3LP_POS_INPUT_A3 = LPCMP_POS_INPUT_A3,
111  ComparatorLPF3LP_POS_INPUT_VDDA = LPCMP_POS_INPUT_VDDA
113 
123 typedef enum
124 {
125  ComparatorLPF3LP_V_DIV_PATH_NEG = LPCMP_DIVISION_PATH_N,
126  ComparatorLPF3LP_V_DIV_PATH_POS = LPCMP_DIVISION_PATH_P
128 
144 typedef enum
145 {
146  ComparatorLPF3LP_V_DIV_FACTOR_1_1 = LPCMP_DIVISION_FACTOR_1_1,
147  ComparatorLPF3LP_V_DIV_FACTOR_3_4 = LPCMP_DIVISION_FACTOR_3_4,
148  ComparatorLPF3LP_V_DIV_FACTOR_1_2 = LPCMP_DIVISION_FACTOR_1_2,
149  ComparatorLPF3LP_V_DIV_FACTOR_1_3 = LPCMP_DIVISION_FACTOR_1_3,
150  ComparatorLPF3LP_V_DIV_FACTOR_1_4 = LPCMP_DIVISION_FACTOR_1_4
152 
176 typedef struct
177 {
178  uint32_t intNum;
179  uint32_t intPriority;
180  uint32_t intMux;
181  ComparatorLPF3LP_PositiveInputChannel positiveInputChannel;
182  ComparatorLPF3LP_NegativeInputChannel negativeInputChannel;
183  ComparatorLPF3LP_VoltageDividerPath voltageDividerPath;
184  ComparatorLPF3LP_VoltageDividerFactor voltageDividerFactor;
190 
196 typedef struct
197 {
198  HwiP_Struct hwi;
201  bool isOpen;
202  bool isRunning;
204 
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* COMPARATORLPF3LP_H_ */
uint8_t negativeInputPinMux
Definition: ComparatorLPF3LP.h:188
Definition: ComparatorLPF3LP.h:146
const Comparator_FxnTable ComparatorLPF3LP_fxnTable
Comparator function table for the ComparatorLPF3LP implementation.
The definition of a comparator function table that contains the required set of functions to control ...
Definition: Comparator.h:391
Comparator_Trigger
Comparator interrupt trigger.
Definition: Comparator.h:272
uint8_t positiveInputPinMux
Definition: ComparatorLPF3LP.h:186
uint8_t negativeInputPin
Definition: ComparatorLPF3LP.h:187
Comparator Driver.
uint32_t intNum
Definition: ComparatorLPF3LP.h:178
Definition: ComparatorLPF3LP.h:125
Definition: ComparatorLPF3LP.h:108
Definition: ComparatorLPF3LP.h:110
ComparatorLPF3LP_NegativeInputChannel
ComparatorLPF3LP Negative input channel These fields are intended to serve as the options for the Com...
Definition: ComparatorLPF3LP.h:80
ComparatorLPF3LP Object.
Definition: ComparatorLPF3LP.h:196
HwiP_Struct hwi
Definition: ComparatorLPF3LP.h:198
uint32_t intPriority
Definition: ComparatorLPF3LP.h:179
Definition: ComparatorLPF3LP.h:149
ComparatorLPF3LP Hardware attributes.
Definition: ComparatorLPF3LP.h:176
uint32_t intMux
Definition: ComparatorLPF3LP.h:180
ComparatorLPF3LP_PositiveInputChannel
ComparatorLPF3LP Positive input channel.
Definition: ComparatorLPF3LP.h:106
uint8_t positiveInputPin
Definition: ComparatorLPF3LP.h:185
Definition: ComparatorLPF3LP.h:84
ComparatorLPF3LP_VoltageDividerPath
ComparatorLPF3LP Voltage divider path.
Definition: ComparatorLPF3LP.h:123
Definition: ComparatorLPF3LP.h:126
Definition: ComparatorLPF3LP.h:148
ComparatorLPF3LP_VoltageDividerPath voltageDividerPath
Definition: ComparatorLPF3LP.h:183
Comparator_CallBackFxn callbackFxn
Definition: ComparatorLPF3LP.h:199
Definition: ComparatorLPF3LP.h:147
bool isRunning
Definition: ComparatorLPF3LP.h:202
bool isOpen
Definition: ComparatorLPF3LP.h:201
ComparatorLPF3LP_VoltageDividerFactor voltageDividerFactor
Definition: ComparatorLPF3LP.h:184
ComparatorLPF3LP_NegativeInputChannel negativeInputChannel
Definition: ComparatorLPF3LP.h:182
Comparator_Trigger trigger
Definition: ComparatorLPF3LP.h:200
Definition: ComparatorLPF3LP.h:82
Definition: ComparatorLPF3LP.h:85
Definition: ComparatorLPF3LP.h:83
ComparatorLPF3LP_VoltageDividerFactor
ComparatorLPF3LP Voltage divider factor.
Definition: ComparatorLPF3LP.h:144
ComparatorLPF3LP_PositiveInputChannel positiveInputChannel
Definition: ComparatorLPF3LP.h:181
void(* Comparator_CallBackFxn)(Comparator_Handle handle, int_fast16_t returnValue, Comparator_Trigger trigger)
Comparator callback function.
Definition: Comparator.h:320
Definition: ComparatorLPF3LP.h:111
Definition: ComparatorLPF3LP.h:109
Definition: ComparatorLPF3LP.h:150
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale