]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/arm_atsam/adc.h
Merge pull request #4501 from amayer5125/ergodox-ez-cleanup
[qmk_firmware.git] / tmk_core / protocol / arm_atsam / adc.h
1 /*
2 Copyright 2018 Massdrop Inc.
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef _ADC_H_
19 #define _ADC_H_
20
21 #define ADC_5V_START_LEVEL              2365
22
23 #define ADC_5V     ADC_INPUTCTRL_MUXPOS_AIN12_Val
24 #define ADC_CON1   ADC_INPUTCTRL_MUXPOS_AIN14_Val
25 #define ADC_CON2   ADC_INPUTCTRL_MUXPOS_AIN13_Val
26
27 extern uint16_t v_5v;
28 extern uint16_t v_5v_avg;
29 extern uint16_t v_con_1;
30 extern uint16_t v_con_2;
31 extern uint16_t v_con_1_boot;
32 extern uint16_t v_con_2_boot;
33
34 void ADC0_clock_init(void);
35 void ADC0_init(void);
36
37 #endif //_ADC_H_