mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-02 06:38:47 +00:00
Merge branch 'feature/support_adc_on_c6' into 'master'
adc: support adc on c6 Closes IDF-5310, IDF-5311, IDF-5917, and IDF-6567 See merge request espressif/esp-idf!21431
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
# using gen_soc_caps_kconfig.py, do not edit manually
|
||||
#####################################################
|
||||
|
||||
config SOC_ADC_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_DEDICATED_GPIO_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
@@ -127,10 +131,6 @@ config SOC_ADC_DIG_CTRL_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_ARBITER_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_FILTER_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
@@ -139,13 +139,17 @@ config SOC_ADC_MONITOR_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_DMA_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_PERIPH_NUM
|
||||
int
|
||||
default 2
|
||||
default 1
|
||||
|
||||
config SOC_ADC_MAX_CHANNEL_NUM
|
||||
int
|
||||
default 5
|
||||
default 7
|
||||
|
||||
config SOC_ADC_ATTEN_NUM
|
||||
int
|
||||
@@ -163,6 +167,10 @@ config SOC_ADC_DIGI_MAX_BITWIDTH
|
||||
int
|
||||
default 12
|
||||
|
||||
config SOC_ADC_DIGI_MIN_BITWIDTH
|
||||
int
|
||||
default 12
|
||||
|
||||
config SOC_ADC_DIGI_FILTER_NUM
|
||||
int
|
||||
default 2
|
||||
@@ -171,6 +179,14 @@ config SOC_ADC_DIGI_MONITOR_NUM
|
||||
int
|
||||
default 2
|
||||
|
||||
config SOC_ADC_DIGI_RESULT_BYTES
|
||||
int
|
||||
default 4
|
||||
|
||||
config SOC_ADC_DIGI_DATA_BYTES_PER_CONV
|
||||
int
|
||||
default 4
|
||||
|
||||
config SOC_ADC_SAMPLE_FREQ_THRES_HIGH
|
||||
int
|
||||
default 83333
|
||||
|
@@ -21,5 +21,8 @@
|
||||
#define ADC1_GPIO4_CHANNEL ADC1_CHANNEL_4
|
||||
#define ADC1_CHANNEL_4_GPIO_NUM 4
|
||||
|
||||
#define ADC2_GPIO5_CHANNEL ADC2_CHANNEL_0
|
||||
#define ADC2_CHANNEL_0_GPIO_NUM 5
|
||||
#define ADC1_GPIO5_CHANNEL ADC1_CHANNEL_5
|
||||
#define ADC1_CHANNEL_5_GPIO_NUM 5
|
||||
|
||||
#define ADC1_GPIO6_CHANNEL ADC1_CHANNEL_6
|
||||
#define ADC1_CHANNEL_6_GPIO_NUM 6
|
||||
|
@@ -316,6 +316,23 @@ typedef enum {
|
||||
TWAI_CLK_SRC_DEFAULT = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the default clock choice */
|
||||
} soc_periph_twai_clk_src_t;
|
||||
|
||||
//////////////////////////////////////////////////ADC///////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @brief Array initializer for all supported clock sources of ADC digital controller
|
||||
*/
|
||||
#define SOC_ADC_DIGI_CLKS {SOC_MOD_CLK_XTAL, SOC_MOD_CLK_PLL_F80M, SOC_MOD_CLK_RC_FAST}
|
||||
|
||||
/**
|
||||
* @brief ADC digital controller clock source
|
||||
*/
|
||||
typedef enum {
|
||||
ADC_DIGI_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the source clock */
|
||||
ADC_DIGI_CLK_SRC_PLL_F80M = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M as the source clock */
|
||||
ADC_DIGI_CLK_SRC_RC_FAST = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST as the source clock */
|
||||
ADC_DIGI_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M as the default clock choice */
|
||||
} soc_periph_adc_digi_clk_src_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -751,7 +751,7 @@ typedef union {
|
||||
*/
|
||||
uint32_t saradc_clkm_div_num:8;
|
||||
/** saradc_clkm_sel : R/W; bitpos: [21:20]; default: 0;
|
||||
* set this field to select clock-source. 0(default): XTAL, 1: 240MHz, 2: FOSC, 3:
|
||||
* set this field to select clock-source. 0(default): XTAL, 1: 80MHz, 2: FOSC, 3:
|
||||
* reserved.
|
||||
*/
|
||||
uint32_t saradc_clkm_sel:2;
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#pragma once
|
||||
|
||||
/*-------------------------- COMMON CAPS ---------------------------------------*/
|
||||
// #define SOC_ADC_SUPPORTED 1 // TODO: IDF-5310
|
||||
#define SOC_ADC_SUPPORTED 1
|
||||
#define SOC_DEDICATED_GPIO_SUPPORTED 1
|
||||
#define SOC_GDMA_SUPPORTED 1
|
||||
#define SOC_PCNT_SUPPORTED 1
|
||||
@@ -72,25 +72,28 @@
|
||||
#define SOC_AES_SUPPORT_AES_128 (1)
|
||||
#define SOC_AES_SUPPORT_AES_256 (1)
|
||||
|
||||
// TODO: IDF-5310 (Copy from esp32c3, need check)
|
||||
/*-------------------------- ADC CAPS -------------------------------*/
|
||||
/*!< SAR ADC Module*/
|
||||
#define SOC_ADC_DIG_CTRL_SUPPORTED 1
|
||||
#define SOC_ADC_ARBITER_SUPPORTED 1
|
||||
#define SOC_ADC_FILTER_SUPPORTED 1
|
||||
#define SOC_ADC_MONITOR_SUPPORTED 1
|
||||
#define SOC_ADC_PERIPH_NUM (2)
|
||||
#define SOC_ADC_CHANNEL_NUM(PERIPH_NUM) ((PERIPH_NUM==0)? 5 : 1)
|
||||
#define SOC_ADC_MAX_CHANNEL_NUM (5)
|
||||
#define SOC_ADC_DIG_SUPPORTED_UNIT(UNIT) 1 //Digital controller supported ADC unit
|
||||
#define SOC_ADC_DMA_SUPPORTED 1
|
||||
#define SOC_ADC_PERIPH_NUM (1U)
|
||||
#define SOC_ADC_CHANNEL_NUM(PERIPH_NUM) (7)
|
||||
#define SOC_ADC_MAX_CHANNEL_NUM (7)
|
||||
#define SOC_ADC_ATTEN_NUM (4)
|
||||
|
||||
/*!< Digital */
|
||||
#define SOC_ADC_DIGI_CONTROLLER_NUM (1U)
|
||||
#define SOC_ADC_PATT_LEN_MAX (8) /*!< One pattern table, each contains 8 items. Each item takes 1 byte */
|
||||
#define SOC_ADC_PATT_LEN_MAX (8) /*!< Two pattern tables, each contains 4 items. Each item takes 1 byte */
|
||||
#define SOC_ADC_DIGI_MAX_BITWIDTH (12)
|
||||
#define SOC_ADC_DIGI_MIN_BITWIDTH (12)
|
||||
#define SOC_ADC_DIGI_FILTER_NUM (2)
|
||||
#define SOC_ADC_DIGI_MONITOR_NUM (2)
|
||||
/*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interva <= 4095 */
|
||||
#define SOC_ADC_DIGI_RESULT_BYTES (4)
|
||||
#define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4)
|
||||
/*!< F_sample = F_digi_con / 2 / interval. F_digi_con = 5M for now. 30 <= interval <= 4095 */
|
||||
#define SOC_ADC_SAMPLE_FREQ_THRES_HIGH 83333
|
||||
#define SOC_ADC_SAMPLE_FREQ_THRES_LOW 611
|
||||
|
||||
|
Reference in New Issue
Block a user