ADCLPF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2024, 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  * @file ADCLPF3.h
34  * @brief ADC driver implementation for the ADC peripheral on Low Power F3
35  * devices
36  *
37  * This ADC driver implementation is designed to operate on a ADC peripheral
38  * for Low Power F3 devices.
39  *
40  * Refer to @ref ADC.h for a complete description of APIs & example of use.
41  *
42  * # Limitations #
43  *
44  * ## #ADC_Params Attributes Limitations ##
45  *
46  * Some attributes in the #ADC_Params structure have a limited set of supported
47  * values. These limitations are described below:
48  * - #ADC_Params.isProtected
49  * - Must be true. If this is false, #ADC_open() will fail and return NULL.
50  *
51  ******************************************************************************
52  */
53 #ifndef ti_drivers_adc_ADCLPF3__include
54 #define ti_drivers_adc_ADCLPF3__include
55 
56 #include <stdint.h>
57 #include <stdbool.h>
58 
59 #include <ti/drivers/ADC.h>
60 #include <ti/drivers/Power.h>
61 
62 #include <ti/devices/DeviceFamily.h>
63 #include DeviceFamily_constructPath(driverlib/adc.h)
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
75 typedef enum
76 {
77  ADCLPF3_RESOLUTION_12_BIT = ADC_RESOLUTION_12_BIT,
78  ADCLPF3_RESOLUTION_10_BIT = ADC_RESOLUTION_10_BIT,
79  ADCLPF3_RESOLUTION_8_BIT = ADC_RESOLUTION_8_BIT,
81 
98 typedef enum
99 {
100  ADCLPF3_FIXED_REFERENCE_1V4 = ADC_FIXED_REFERENCE_1V4,
101  ADCLPF3_FIXED_REFERENCE_2V5 = ADC_FIXED_REFERENCE_2V5,
102  ADCLPF3_VDDS_REFERENCE = ADC_VDDS_REFERENCE,
103  ADCLPF3_EXTERNAL_REFERENCE = ADC_EXTERNAL_REFERENCE
105 
111 typedef enum
112 {
113  ADCLPF3_CLKDIV_1 = ADC_CLOCK_DIVIDER_1,
114  ADCLPF3_CLKDIV_2 = ADC_CLOCK_DIVIDER_2,
115  ADCLPF3_CLKDIV_4 = ADC_CLOCK_DIVIDER_4,
116  ADCLPF3_CLKDIV_8 = ADC_CLOCK_DIVIDER_8,
117  ADCLPF3_CLKDIV_16 = ADC_CLOCK_DIVIDER_16,
118  ADCLPF3_CLKDIV_24 = ADC_CLOCK_DIVIDER_24,
119  ADCLPF3_CLKDIV_32 = ADC_CLOCK_DIVIDER_32,
120  ADCLPF3_CLKDIV_48 = ADC_CLOCK_DIVIDER_48
122 
123 /* ADC function table pointer */
124 extern const ADC_FxnTable ADCLPF3_fxnTable;
125 
132 typedef struct
133 {
135  uint8_t adcInputDIO;
137  uint8_t adcRefPosDIO;
139  uint8_t adcRefNegDIO;
145  uint_fast32_t refVoltage;
147  ADCLPF3_Reference_Source refSource;
151  ADCLPF3_Resolution_Bits resolutionBits;
153  ADCLPF3_Clock_Divider adcClkkDivider;
154 
156 
162 typedef struct
163 {
165  bool isOpen;
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif /* ti_drivers_adc_ADCLPF3__include */
Definition: ADCLPF3.h:113
Definition: ADCLPF3.h:77
Definition: ADCLPF3.h:101
ADCLPF3 Hardware attributes These fields are used by driverlib APIs and therefore must be populated b...
Definition: ADCLPF3.h:132
Power Manager.
ADCLPF3_Reference_Source
Specifies the source of the ADC reference voltage.
Definition: ADCLPF3.h:98
uint8_t internalChannel
Definition: ADCLPF3.h:141
Definition: ADCLPF3.h:117
ADCLPF3_Resolution_Bits resolutionBits
Definition: ADCLPF3.h:151
uint16_t samplingDuration
Definition: ADCLPF3.h:149
Definition: ADCLPF3.h:114
ADCLPF3 Object.
Definition: ADCLPF3.h:162
Definition: ADCLPF3.h:100
uint8_t adcInputDIO
Definition: ADCLPF3.h:135
Definition: ADCLPF3.h:78
uint8_t adcRefNegDIO
Definition: ADCLPF3.h:139
const ADC_FxnTable ADCLPF3_fxnTable
uint_fast32_t refVoltage
Definition: ADCLPF3.h:145
ADCLPF3_Clock_Divider adcClkkDivider
Definition: ADCLPF3.h:153
Analog to Digital Conversion (ADC) Input Driver.
Definition: ADCLPF3.h:115
Definition: ADCLPF3.h:102
Definition: ADCLPF3.h:118
bool returnAdjustedVal
Definition: ADCLPF3.h:143
Definition: ADCLPF3.h:119
The definition of an ADC function table that contains the required set of functions to control a spec...
Definition: ADC.h:354
ADCLPF3_Reference_Source refSource
Definition: ADCLPF3.h:147
bool isOpen
Definition: ADCLPF3.h:165
uint8_t adcRefPosDIO
Definition: ADCLPF3.h:137
ADCLPF3_Clock_Divider
ADC clock-divider.
Definition: ADCLPF3.h:111
Definition: ADCLPF3.h:79
Definition: ADCLPF3.h:116
Definition: ADCLPF3.h:103
Definition: ADCLPF3.h:120
ADCLPF3_Resolution_Bits
Resolution of ADC-conversion.
Definition: ADCLPF3.h:75
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale