ADCLPF3.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  * @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  ******************************************************************************
43  */
44 #ifndef ti_drivers_adc_ADCLPF3__include
45 #define ti_drivers_adc_ADCLPF3__include
46 
47 #include <stdint.h>
48 #include <stdbool.h>
49 
50 #include <ti/drivers/ADC.h>
51 #include <ti/drivers/Power.h>
52 
53 #include <ti/devices/DeviceFamily.h>
54 #include DeviceFamily_constructPath(driverlib/adc.h)
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
66 typedef enum
67 {
68  ADCLPF3_RESOLUTION_12_BIT = ADC_RESOLUTION_12_BIT,
69  ADCLPF3_RESOLUTION_10_BIT = ADC_RESOLUTION_10_BIT,
70  ADCLPF3_RESOLUTION_8_BIT = ADC_RESOLUTION_8_BIT,
72 
89 typedef enum
90 {
91  ADCLPF3_FIXED_REFERENCE_1V4 = ADC_FIXED_REFERENCE_1V4,
92  ADCLPF3_FIXED_REFERENCE_2V5 = ADC_FIXED_REFERENCE_2V5,
93  ADCLPF3_VDDS_REFERENCE = ADC_VDDS_REFERENCE,
94  ADCLPF3_EXTERNAL_REFERENCE = ADC_EXTERNAL_REFERENCE
96 
102 typedef enum
103 {
104  ADCLPF3_CLKDIV_1 = ADC_CLOCK_DIVIDER_1,
105  ADCLPF3_CLKDIV_2 = ADC_CLOCK_DIVIDER_2,
106  ADCLPF3_CLKDIV_4 = ADC_CLOCK_DIVIDER_4,
107  ADCLPF3_CLKDIV_8 = ADC_CLOCK_DIVIDER_8,
108  ADCLPF3_CLKDIV_16 = ADC_CLOCK_DIVIDER_16,
109  ADCLPF3_CLKDIV_24 = ADC_CLOCK_DIVIDER_24,
110  ADCLPF3_CLKDIV_32 = ADC_CLOCK_DIVIDER_32,
111  ADCLPF3_CLKDIV_48 = ADC_CLOCK_DIVIDER_48
113 
114 /* ADC function table pointer */
115 extern const ADC_FxnTable ADCLPF3_fxnTable;
116 
123 typedef struct
124 {
126  uint8_t adcInputDIO;
128  uint8_t adcRefPosDIO;
130  uint8_t adcRefNegDIO;
136  uint_fast32_t refVoltage;
138  ADCLPF3_Reference_Source refSource;
142  ADCLPF3_Resolution_Bits resolutionBits;
144  ADCLPF3_Clock_Divider adcClkkDivider;
145 
147 
153 typedef struct
154 {
156  bool isOpen;
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif /* ti_drivers_adc_ADCLPF3__include */
Definition: ADCLPF3.h:104
Definition: ADCLPF3.h:68
Definition: ADCLPF3.h:92
ADCLPF3 Hardware attributes These fields are used by driverlib APIs and therefore must be populated b...
Definition: ADCLPF3.h:123
Power Manager.
ADCLPF3_Reference_Source
Specifies the source of the ADC reference voltage.
Definition: ADCLPF3.h:89
uint8_t internalChannel
Definition: ADCLPF3.h:132
Definition: ADCLPF3.h:108
ADCLPF3_Resolution_Bits resolutionBits
Definition: ADCLPF3.h:142
uint16_t samplingDuration
Definition: ADCLPF3.h:140
Definition: ADCLPF3.h:105
ADCLPF3 Object.
Definition: ADCLPF3.h:153
Definition: ADCLPF3.h:91
uint8_t adcInputDIO
Definition: ADCLPF3.h:126
Definition: ADCLPF3.h:69
uint8_t adcRefNegDIO
Definition: ADCLPF3.h:130
const ADC_FxnTable ADCLPF3_fxnTable
uint_fast32_t refVoltage
Definition: ADCLPF3.h:136
ADCLPF3_Clock_Divider adcClkkDivider
Definition: ADCLPF3.h:144
Analog to Digital Conversion (ADC) Input Driver.
Definition: ADCLPF3.h:106
Definition: ADCLPF3.h:93
Definition: ADCLPF3.h:109
bool returnAdjustedVal
Definition: ADCLPF3.h:134
Definition: ADCLPF3.h:110
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:138
bool isOpen
Definition: ADCLPF3.h:156
uint8_t adcRefPosDIO
Definition: ADCLPF3.h:128
ADCLPF3_Clock_Divider
ADC clock-divider.
Definition: ADCLPF3.h:102
Definition: ADCLPF3.h:70
Definition: ADCLPF3.h:107
bool isProtected
Definition: ADCLPF3.h:158
Definition: ADCLPF3.h:94
Definition: ADCLPF3.h:111
ADCLPF3_Resolution_Bits
Resolution of ADC-conversion.
Definition: ADCLPF3.h:66
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale