1 /* 2 * Copyright (c) 2024 ENE Technology Inc. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ENE_KB1200_ADC_H 8 #define ENE_KB1200_ADC_H 9 10 /** 11 * Structure type to access Analog to Digital Converter (ADC). 12 */ 13 struct adc_regs { 14 volatile uint32_t ADCCFG; /* Configuration Register */ 15 volatile uint32_t Reserved[3]; /* Reserved */ 16 volatile uint32_t ADCDAT[14]; /* Data Register */ 17 }; 18 19 #define ADC_CHANNEL_BIT_POS 16 20 #define ADC_CHANNEL_BIT_MASK 0x3FFF0000 21 22 #define ADC_RESOLUTION 10 /* Unit:bits */ 23 #define ADC_VREF_ANALOG 3300 /* Unit:mV */ 24 #define ADC_MAX_CHAN 14 25 26 #define ADC_FUNCTION_ENABLE 0x0001 27 #define ADC_INVALID_VALUE 0x8000 28 29 #define ADC_WAIT_TIME 100 30 #define ADC_WAIT_CNT 100 31 32 #endif /* ENE_KB1200_ADDA_H */ 33