brazos-trapezoidal
AtodDriver_prm.h
Go to the documentation of this file.
1
11#ifndef SOURCE_SRMCATOD_PRM_H_
12 #define SOURCE_SRMCATOD_PRM_H_
13
14#include "includes.h"
15
16/****** Enable/Disable *****/
17#ifndef ENABLE
18 #define ENABLE ( 0x1 )
19#endif
20
21#ifndef DISABLE
22 #define DISABLE ( 0x0 )
23#endif
24
25#ifndef CLEAR
26 #define CLEAR ( 0x1 )
27#endif
28
29//=====================================================================================================================
30//-------------------------------------- PUBLIC (Extern Variables, Constants & Defines) -------------------------------
31//=====================================================================================================================
32
33/* These values are used to fine tune conversion trigger event in order to avoid ringing cross talk */
34#define SR_MCATOD_SAMPLING_TIME 0x7
42#define CH0_ENABLE ENABLE
43#define CH1_ENABLE ENABLE
44#define CH2_ENABLE ENABLE
45#define CH3_ENABLE ENABLE
46#define CH4_ENABLE ENABLE
47#define CH5_ENABLE ENABLE
48#define CH6_ENABLE ENABLE
49#define CH7_ENABLE ENABLE
50
59/* Brazos */
60#define ADC_TEMP 0
61#define ADC_VBUS 1
62#define ADC_VC 2
63#define ADC_VB 3
64#define ADC_VA 4
65#define ADC_IC 6
66#define ADC_IB 7
67#define ADC_IA 5
69#define ADC_NUMBER_OF_CONVERTIONS (CH0_ENABLE + CH1_ENABLE + CH2_ENABLE + CH3_ENABLE + CH4_ENABLE + CH5_ENABLE + CH6_ENABLE + CH7_ENABLE)
70#define NUM_ADC_SAMPLES ADC_NUMBER_OF_CONVERTIONS
71extern uint16_t ADC_Samples[NUM_ADC_SAMPLES];
73/* BRAZOS */
74#define ADC_CH0 PIN_PA0
75#define ADC_CH1 PIN_PA1
76#define ADC_CH2 PIN_PA2
77#define ADC_CH3 PIN_PA3
78#define ADC_CH4 PIN_PA4
79#define ADC_CH5 PIN_PA5
80#define ADC_CH6 PIN_PA6
81#define ADC_CH7 PIN_PA7
84/* Enable/Disable programmable gain
85 * ================================
86 * Options:
87 * 1: enable
88 * 0: disable
89 * */
90 #define S12AD0_PG000EN_PRM 1
91 #define S12AD0_PG001EN_PRM 1
92 #define S12AD0_PG002EN_PRM 0
93 #define S12AD1_PG000EN_PRM 0
94 #define S12AD1_PG001EN_PRM 0
95 #define S12AD1_PG002EN_PRM 0
96
97/* Selection of programmable gain
98 * ================================
99 * Options:
100 * 1: programmable gain amplifier used
101 * 0: programmable gain amplifier bypassed
102 * */
103 #define S12AD0_PG000SEL_PRM 1
104 #define S12AD0_PG001SEL_PRM 1
105 #define S12AD0_PG002SEL_PRM 0
106 #define S12AD1_PG000SEL_PRM 0
107 #define S12AD1_PG001SEL_PRM 0
108 #define S12AD1_PG002SEL_PRM 0
109
110
111/* Gain selection options
112 * ======================
113 * x2.0 : 0x00
114 * x2.5 : 0x01
115 * x3.077 : 0x04
116 * x3.636 : 0x06
117 * x4.0 : 0x07
118 * x4.444 : 0x08
119 * x5.0 : 0x09
120 * x5.714 : 0x0A
121 * x6.667 : 0x0B
122 * x10.0 : 0x0D
123 * x13.333: 0x0E
124 * */
125 #define S12AD0_PG000GAIN_PRM 0x04
126 #define S12AD0_PG001GAIN_PRM 0x04
127 #define S12AD0_PG002GAIN_PRM 0x00
128 #define S12AD1_PG000GAIN_PRM 0x00
129 #define S12AD1_PG001GAIN_PRM 0x00
130 #define S12AD1_PG002GAIN_PRM 0x00
131
132
133//=====================================================================================================================
134//-------------------------------------- PUBLIC (Function Prototypes) -------------------------------------------------
135//=====================================================================================================================
136
137#endif // SOURCE_SRMCATOD_PRM_H_
138
139
uint16_t ADC_Samples[NUM_ADC_SAMPLES]
Definition: main.c:61
#define NUM_ADC_SAMPLES