ADCCC26XX.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2021, 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 ADCCC26XX.h
34  * @brief ADC driver implementation for the ADC peripheral on CC26XX
35  *
36  * This ADC driver implementation is designed to operate on a ADC peripheral
37  * for CC26XX.
38  *
39  * Refer to @ref ADC.h for a complete description of APIs & example of use.
40  *
41  ******************************************************************************
42  */
43 #ifndef ti_drivers_adc_ADCCC26XX__include
44 #define ti_drivers_adc_ADCCC26XX__include
45 
46 #include <stdint.h>
47 #include <stdbool.h>
48 
49 #include <ti/drivers/ADC.h>
50 #include <ti/drivers/Power.h>
52 
53 #include <ti/devices/DeviceFamily.h>
54 #include DeviceFamily_constructPath(driverlib/aux_adc.h)
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
69 typedef enum
70 {
71  ADCCC26XX_SAMPLING_DURATION_2P7_US = AUXADC_SAMPLE_TIME_2P7_US,
72  ADCCC26XX_SAMPLING_DURATION_5P3_US = AUXADC_SAMPLE_TIME_5P3_US,
73  ADCCC26XX_SAMPLING_DURATION_10P6_US = AUXADC_SAMPLE_TIME_10P6_US,
74  ADCCC26XX_SAMPLING_DURATION_21P3_US = AUXADC_SAMPLE_TIME_21P3_US,
75  ADCCC26XX_SAMPLING_DURATION_42P6_US = AUXADC_SAMPLE_TIME_42P6_US,
76  ADCCC26XX_SAMPLING_DURATION_85P3_US = AUXADC_SAMPLE_TIME_85P3_US,
77  ADCCC26XX_SAMPLING_DURATION_170_US = AUXADC_SAMPLE_TIME_170_US,
78  ADCCC26XX_SAMPLING_DURATION_341_US = AUXADC_SAMPLE_TIME_341_US,
79  ADCCC26XX_SAMPLING_DURATION_682_US = AUXADC_SAMPLE_TIME_682_US,
80  ADCCC26XX_SAMPLING_DURATION_1P37_MS = AUXADC_SAMPLE_TIME_1P37_MS,
81  ADCCC26XX_SAMPLING_DURATION_2P73_MS = AUXADC_SAMPLE_TIME_2P73_MS,
82  ADCCC26XX_SAMPLING_DURATION_5P46_MS = AUXADC_SAMPLE_TIME_5P46_MS,
83  ADCCC26XX_SAMPLING_DURATION_10P9_MS = AUXADC_SAMPLE_TIME_10P9_MS
85 
118 typedef enum
119 {
120  ADCCC26XX_FIXED_REFERENCE = AUXADC_REF_FIXED,
121  ADCCC26XX_VDDS_REFERENCE = AUXADC_REF_VDDS_REL
123 
130 typedef enum
131 {
132  ADCCC26XX_TRIGGER_MANUAL = AUXADC_TRIGGER_MANUAL,
134 
135 /* ADC function table pointer */
136 extern const ADC_FxnTable ADCCC26XX_fxnTable;
137 
144 typedef struct
145 {
147  uint8_t adcDIO;
149  uint8_t adcCompBInput;
155  uint_fast32_t refVoltage;
157  ADCCC26XX_Reference_Source refSource;
159  ADCCC26XX_Sampling_Duration samplingDuration;
161  ADCCC26XX_Trigger_Source triggerSource;
163 
169 typedef struct
170 {
172  bool isOpen;
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif /* ti_drivers_adc_ADCCC26XX__include */
ADCCC26XX_Trigger_Source triggerSource
Definition: ADCCC26XX.h:161
Definition: ADCCC26XX.h:83
Definition: ADCCC26XX.h:76
ADCCC26XX_Reference_Source refSource
Definition: ADCCC26XX.h:157
ADCCC26XX Object.
Definition: ADCCC26XX.h:169
Definition: ADCCC26XX.h:120
Power Manager.
bool returnAdjustedVal
Definition: ADCCC26XX.h:151
bool isProtected
Definition: ADCCC26XX.h:174
Power manager interface for CC26XX/CC13XX.
ADCCC26XX_Sampling_Duration
Amount of time the ADC spends sampling the analogue input.
Definition: ADCCC26XX.h:69
const ADC_FxnTable ADCCC26XX_fxnTable
ADCCC26XX_Trigger_Source
List of sources the ADC can be configured to trigger off of.
Definition: ADCCC26XX.h:130
Definition: ADCCC26XX.h:82
Analog to Digital Conversion (ADC) Input Driver.
Definition: ADCCC26XX.h:77
Definition: ADCCC26XX.h:80
Definition: ADCCC26XX.h:81
uint8_t adcCompBInput
Definition: ADCCC26XX.h:149
The definition of an ADC function table that contains the required set of functions to control a spec...
Definition: ADC.h:354
Definition: ADCCC26XX.h:72
uint8_t adcDIO
Definition: ADCCC26XX.h:147
bool isOpen
Definition: ADCCC26XX.h:172
ADCCC26XX Hardware attributes These fields are used by driverlib APIs and therefore must be populated...
Definition: ADCCC26XX.h:144
Definition: ADCCC26XX.h:75
Definition: ADCCC26XX.h:71
Definition: ADCCC26XX.h:78
Definition: ADCCC26XX.h:73
bool inputScalingEnabled
Definition: ADCCC26XX.h:153
ADCCC26XX_Sampling_Duration samplingDuration
Definition: ADCCC26XX.h:159
Definition: ADCCC26XX.h:132
uint_fast32_t refVoltage
Definition: ADCCC26XX.h:155
Definition: ADCCC26XX.h:74
Definition: ADCCC26XX.h:79
ADCCC26XX_Reference_Source
Specifies whether the internal reference of the ADC is sourced from the battery voltage or a fixed in...
Definition: ADCCC26XX.h:118
Definition: ADCCC26XX.h:121
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale