mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Merge branch 'esp32p4/add_adc_support' into 'master'
feat(adc): support ADC oneshot/continuous mode on ESP32P4 Closes IDF-6496 and IDF-6497 See merge request espressif/esp-idf!28281
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -7,4 +7,15 @@
|
||||
#include "soc/adc_periph.h"
|
||||
|
||||
/* Store IO number corresponding to the ADC channel number. */
|
||||
const int adc_channel_io_map[SOC_ADC_PERIPH_NUM][SOC_ADC_MAX_CHANNEL_NUM] = {};
|
||||
const int adc_channel_io_map[SOC_ADC_PERIPH_NUM][SOC_ADC_MAX_CHANNEL_NUM] = {
|
||||
/* ADC1 */
|
||||
{
|
||||
ADC1_CHANNEL_0_GPIO_NUM, ADC1_CHANNEL_1_GPIO_NUM, ADC1_CHANNEL_2_GPIO_NUM, ADC1_CHANNEL_3_GPIO_NUM,
|
||||
ADC1_CHANNEL_4_GPIO_NUM, ADC1_CHANNEL_5_GPIO_NUM, ADC1_CHANNEL_6_GPIO_NUM, ADC1_CHANNEL_7_GPIO_NUM
|
||||
},
|
||||
/* ADC2 */
|
||||
{
|
||||
ADC2_CHANNEL_0_GPIO_NUM, ADC2_CHANNEL_1_GPIO_NUM, ADC2_CHANNEL_2_GPIO_NUM,
|
||||
ADC2_CHANNEL_3_GPIO_NUM, ADC2_CHANNEL_4_GPIO_NUM, ADC2_CHANNEL_5_GPIO_NUM
|
||||
}
|
||||
};
|
||||
|
@@ -3,6 +3,10 @@
|
||||
# using gen_soc_caps_kconfig.py, do not edit manually
|
||||
#####################################################
|
||||
|
||||
config SOC_ADC_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ANA_CMPR_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
@@ -311,13 +315,25 @@ config SOC_AES_SUPPORT_AES_256
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_RTC_CTRL_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_DIG_CTRL_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_DMA_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_ADC_PERIPH_NUM
|
||||
int
|
||||
default 1
|
||||
default 2
|
||||
|
||||
config SOC_ADC_MAX_CHANNEL_NUM
|
||||
int
|
||||
default 7
|
||||
default 8
|
||||
|
||||
config SOC_ADC_ATTEN_NUM
|
||||
int
|
||||
@@ -325,11 +341,11 @@ config SOC_ADC_ATTEN_NUM
|
||||
|
||||
config SOC_ADC_DIGI_CONTROLLER_NUM
|
||||
int
|
||||
default 1
|
||||
default 2
|
||||
|
||||
config SOC_ADC_PATT_LEN_MAX
|
||||
int
|
||||
default 8
|
||||
default 16
|
||||
|
||||
config SOC_ADC_DIGI_MAX_BITWIDTH
|
||||
int
|
||||
@@ -375,6 +391,10 @@ config SOC_ADC_CALIBRATION_V1_SUPPORTED
|
||||
bool
|
||||
default n
|
||||
|
||||
config SOC_ADC_SHARED_POWER
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_APB_BACKUP_DMA
|
||||
bool
|
||||
default n
|
||||
|
@@ -1,7 +1,49 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ADC1_GPIO16_CHANNEL 0
|
||||
#define ADC1_CHANNEL_0_GPIO_NUM 16
|
||||
|
||||
#define ADC1_GPIO17_CHANNEL 1
|
||||
#define ADC1_CHANNEL_1_GPIO_NUM 17
|
||||
|
||||
#define ADC1_GPIO18_CHANNEL 2
|
||||
#define ADC1_CHANNEL_2_GPIO_NUM 18
|
||||
|
||||
#define ADC1_GPIO19_CHANNEL 3
|
||||
#define ADC1_CHANNEL_3_GPIO_NUM 19
|
||||
|
||||
#define ADC1_GPIO20_CHANNEL 4
|
||||
#define ADC1_CHANNEL_4_GPIO_NUM 20
|
||||
|
||||
#define ADC1_GPIO21_CHANNEL 5
|
||||
#define ADC1_CHANNEL_5_GPIO_NUM 21
|
||||
|
||||
#define ADC1_GPIO22_CHANNEL 6
|
||||
#define ADC1_CHANNEL_6_GPIO_NUM 22
|
||||
|
||||
#define ADC1_GPIO23_CHANNEL 7
|
||||
#define ADC1_CHANNEL_7_GPIO_NUM 23
|
||||
|
||||
#define ADC2_GPIO49_CHANNEL 0
|
||||
#define ADC2_CHANNEL_0_GPIO_NUM 49
|
||||
|
||||
#define ADC2_GPIO50_CHANNEL 1
|
||||
#define ADC2_CHANNEL_1_GPIO_NUM 50
|
||||
|
||||
#define ADC2_GPIO51_CHANNEL 2
|
||||
#define ADC2_CHANNEL_2_GPIO_NUM 51
|
||||
|
||||
#define ADC2_GPIO52_CHANNEL 3
|
||||
#define ADC2_CHANNEL_3_GPIO_NUM 52
|
||||
|
||||
#define ADC2_GPIO53_CHANNEL 4
|
||||
#define ADC2_CHANNEL_4_GPIO_NUM 53
|
||||
|
||||
#define ADC2_GPIO54_CHANNEL 5
|
||||
#define ADC2_CHANNEL_5_GPIO_NUM 54
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -195,6 +195,26 @@ extern "C" {
|
||||
#define ADC_FILTER_FACTOR0_V 0x00000007U
|
||||
#define ADC_FILTER_FACTOR0_S 29
|
||||
|
||||
#define ADC_FSM_WAIT_REG (DR_REG_ADC_BASE + 0xC)
|
||||
/* ADC_STANDBY_WAIT : R/W ;bitpos:[23:16] ;default: 8'd255 ; */
|
||||
/*description: need_des.*/
|
||||
#define ADC_STANDBY_WAIT 0x000000FF
|
||||
#define ADC_STANDBY_WAIT_M ((ADC_STANDBY_WAIT_V)<<(ADC_STANDBY_WAIT_S))
|
||||
#define ADC_STANDBY_WAIT_V 0xFF
|
||||
#define ADC_STANDBY_WAIT_S 16
|
||||
/* ADC_RSTB_WAIT : R/W ;bitpos:[15:8] ;default: 8'd8 ; */
|
||||
/*description: need_des.*/
|
||||
#define ADC_RSTB_WAIT 0x000000FF
|
||||
#define ADC_RSTB_WAIT_M ((ADC_RSTB_WAIT_V)<<(ADC_RSTB_WAIT_S))
|
||||
#define ADC_RSTB_WAIT_V 0xFF
|
||||
#define ADC_RSTB_WAIT_S 8
|
||||
/* ADC_XPD_WAIT : R/W ;bitpos:[7:0] ;default: 8'd8 ; */
|
||||
/*description: need_des.*/
|
||||
#define ADC_XPD_WAIT 0x000000FF
|
||||
#define ADC_XPD_WAIT_M ((ADC_XPD_WAIT_V)<<(ADC_XPD_WAIT_S))
|
||||
#define ADC_XPD_WAIT_V 0xFF
|
||||
#define ADC_XPD_WAIT_S 0
|
||||
|
||||
/** ADC_SAR1_PATT_TAB1_REG register
|
||||
* Register
|
||||
*/
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -137,117 +137,46 @@ typedef union {
|
||||
uint32_t val;
|
||||
} adc_filter_ctrl1_reg_t;
|
||||
|
||||
/** Type of sar1_patt_tab1 register
|
||||
/** Type of filter_ctrl1 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar1_patt_tab1 : R/W; bitpos: [23:0]; default: 0;
|
||||
uint32_t xpd_wait:8;
|
||||
uint32_t rstb_wait:8;
|
||||
uint32_t standby_wait:8;
|
||||
uint32_t reserved24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_fsm_wait_reg_t;
|
||||
|
||||
/** Type of sar1_patt_tab register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar1_patt_tab : R/W; bitpos: [23:0]; default: 0;
|
||||
* item 0 ~ 3 for pattern table 1 (each item one byte)
|
||||
*/
|
||||
uint32_t sar1_patt_tab1:24;
|
||||
uint32_t sar1_patt_tab:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar1_patt_tab1_reg_t;
|
||||
|
||||
/** Type of sar1_patt_tab2 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar1_patt_tab2 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 4 ~ 7 for pattern table 1 (each item one byte)
|
||||
*/
|
||||
uint32_t sar1_patt_tab2:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar1_patt_tab2_reg_t;
|
||||
|
||||
/** Type of sar1_patt_tab3 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar1_patt_tab3 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 8 ~ 11 for pattern table 1 (each item one byte)
|
||||
*/
|
||||
uint32_t sar1_patt_tab3:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar1_patt_tab3_reg_t;
|
||||
|
||||
/** Type of sar1_patt_tab4 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar1_patt_tab4 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 12 ~ 15 for pattern table 1 (each item one byte)
|
||||
*/
|
||||
uint32_t sar1_patt_tab4:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar1_patt_tab4_reg_t;
|
||||
} adc_sar1_patt_tab_reg_t;
|
||||
|
||||
/** Type of sar2_patt_tab1 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar2_patt_tab1 : R/W; bitpos: [23:0]; default: 0;
|
||||
/** sar2_patt_tab : R/W; bitpos: [23:0]; default: 0;
|
||||
* item 0 ~ 3 for pattern table 2 (each item one byte)
|
||||
*/
|
||||
uint32_t sar2_patt_tab1:24;
|
||||
uint32_t sar2_patt_tab:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar2_patt_tab1_reg_t;
|
||||
|
||||
/** Type of sar2_patt_tab2 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar2_patt_tab2 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 4 ~ 7 for pattern table 2 (each item one byte)
|
||||
*/
|
||||
uint32_t sar2_patt_tab2:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar2_patt_tab2_reg_t;
|
||||
|
||||
/** Type of sar2_patt_tab3 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar2_patt_tab3 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 8 ~ 11 for pattern table 2 (each item one byte)
|
||||
*/
|
||||
uint32_t sar2_patt_tab3:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar2_patt_tab3_reg_t;
|
||||
|
||||
/** Type of sar2_patt_tab4 register
|
||||
* Register
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** sar2_patt_tab4 : R/W; bitpos: [23:0]; default: 0;
|
||||
* Item 12 ~ 15 for pattern table 2 (each item one byte)
|
||||
*/
|
||||
uint32_t sar2_patt_tab4:24;
|
||||
uint32_t reserved_24:8;
|
||||
};
|
||||
uint32_t val;
|
||||
} adc_sar2_patt_tab4_reg_t;
|
||||
} adc_sar2_patt_tab_reg_t;
|
||||
|
||||
/** Type of arb_ctrl register
|
||||
* Register
|
||||
@@ -655,15 +584,10 @@ typedef struct {
|
||||
volatile adc_ctrl_reg_reg_t ctrl_reg;
|
||||
volatile adc_ctrl2_reg_t ctrl2;
|
||||
volatile adc_filter_ctrl1_reg_t filter_ctrl1;
|
||||
uint32_t reserved_00c[3];
|
||||
volatile adc_sar1_patt_tab1_reg_t sar1_patt_tab1;
|
||||
volatile adc_sar1_patt_tab2_reg_t sar1_patt_tab2;
|
||||
volatile adc_sar1_patt_tab3_reg_t sar1_patt_tab3;
|
||||
volatile adc_sar1_patt_tab4_reg_t sar1_patt_tab4;
|
||||
volatile adc_sar2_patt_tab1_reg_t sar2_patt_tab1;
|
||||
volatile adc_sar2_patt_tab2_reg_t sar2_patt_tab2;
|
||||
volatile adc_sar2_patt_tab3_reg_t sar2_patt_tab3;
|
||||
volatile adc_sar2_patt_tab4_reg_t sar2_patt_tab4;
|
||||
volatile adc_fsm_wait_reg_t fsm_wait;
|
||||
uint32_t reserved_00c[2];
|
||||
volatile adc_sar1_patt_tab_reg_t sar1_patt_tab[4];
|
||||
volatile adc_sar2_patt_tab_reg_t sar2_patt_tab[4];
|
||||
volatile adc_arb_ctrl_reg_t arb_ctrl;
|
||||
volatile adc_filter_ctrl0_reg_t filter_ctrl0;
|
||||
volatile adc_sar1_data_status_reg_t sar1_data_status;
|
||||
@@ -684,6 +608,7 @@ typedef struct {
|
||||
volatile adc_ctrl_date_reg_t ctrl_date;
|
||||
} adc_dev_t;
|
||||
|
||||
extern adc_dev_t ADC;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(adc_dev_t) == 0x400, "Invalid size of adc_dev_t structure");
|
||||
|
@@ -590,6 +590,34 @@ typedef enum {
|
||||
|
||||
//////////////////////////////////////////////////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_RC_FAST = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST 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_DEFAULT = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M as the default clock choice */
|
||||
} soc_periph_adc_digi_clk_src_t;
|
||||
|
||||
/**
|
||||
* @brief Array initializer for all supported clock sources of ADC RTC controller
|
||||
*/
|
||||
#define SOC_ADC_RTC_CLKS {SOC_MOD_CLK_RC_FAST}
|
||||
|
||||
/**
|
||||
* @brief ADC RTC controller clock source
|
||||
*/
|
||||
typedef enum {
|
||||
ADC_RTC_CLK_SRC_RC_FAST = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST as the source clock */
|
||||
ADC_RTC_CLK_SRC_DEFAULT = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST as the default clock choice */
|
||||
} soc_periph_adc_rtc_clk_src_t;
|
||||
|
||||
//////////////////////////////////////////////////MWDT/////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
@@ -259,11 +259,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_raw:1;
|
||||
/** cocpu_saradc1_error_int_raw : R/WTC/SS; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, int raw.
|
||||
* An error occurs from ADC1, int raw.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_raw:1;
|
||||
/** cocpu_saradc2_error_int_raw : R/WTC/SS; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, int raw.
|
||||
* An error occurs from ADC2, int raw.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_raw:1;
|
||||
/** cocpu_saradc1_wake_int_raw : R/WTC/SS; bitpos: [4]; default: 0;
|
||||
@@ -293,11 +293,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_ena:1;
|
||||
/** cocpu_saradc1_error_int_ena : R/WTC; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, int enable.
|
||||
* An error occurs from ADC1, int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_ena:1;
|
||||
/** cocpu_saradc2_error_int_ena : R/WTC; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, int enable.
|
||||
* An error occurs from ADC2, int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_ena:1;
|
||||
/** cocpu_saradc1_wake_int_ena : R/WTC; bitpos: [4]; default: 0;
|
||||
@@ -327,11 +327,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_st:1;
|
||||
/** cocpu_saradc1_error_int_st : RO; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, int status.
|
||||
* An error occurs from ADC1, int status.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_st:1;
|
||||
/** cocpu_saradc2_error_int_st : RO; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, int status.
|
||||
* An error occurs from ADC2, int status.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_st:1;
|
||||
/** cocpu_saradc1_wake_int_st : RO; bitpos: [4]; default: 0;
|
||||
@@ -361,11 +361,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_clr:1;
|
||||
/** cocpu_saradc1_error_int_clr : WT; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, int clear.
|
||||
* An error occurs from ADC1, int clear.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_clr:1;
|
||||
/** cocpu_saradc2_error_int_clr : WT; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, int clear.
|
||||
* An error occurs from ADC2, int clear.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_clr:1;
|
||||
/** cocpu_saradc1_wake_int_clr : WT; bitpos: [4]; default: 0;
|
||||
@@ -395,11 +395,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_ena_w1ts:1;
|
||||
/** cocpu_saradc1_error_int_ena_w1ts : WT; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, write 1 to assert int enable.
|
||||
* An error occurs from ADC1, write 1 to assert int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_ena_w1ts:1;
|
||||
/** cocpu_saradc2_error_int_ena_w1ts : WT; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, write 1 to assert int enable.
|
||||
* An error occurs from ADC2, write 1 to assert int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_ena_w1ts:1;
|
||||
/** cocpu_saradc1_wake_int_ena_w1ts : WT; bitpos: [4]; default: 0;
|
||||
@@ -429,11 +429,11 @@ typedef union {
|
||||
*/
|
||||
uint32_t cocpu_saradc2_int_ena_w1tc:1;
|
||||
/** cocpu_saradc1_error_int_ena_w1tc : WT; bitpos: [2]; default: 0;
|
||||
* An errro occurs from ADC1, write 1 to deassert int enable.
|
||||
* An error occurs from ADC1, write 1 to deassert int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc1_error_int_ena_w1tc:1;
|
||||
/** cocpu_saradc2_error_int_ena_w1tc : WT; bitpos: [3]; default: 0;
|
||||
* An errro occurs from ADC2, write 1 to deassert int enable.
|
||||
* An error occurs from ADC2, write 1 to deassert int enable.
|
||||
*/
|
||||
uint32_t cocpu_saradc2_error_int_ena_w1tc:1;
|
||||
/** cocpu_saradc1_wake_int_ena_w1tc : WT; bitpos: [4]; default: 0;
|
||||
@@ -592,6 +592,7 @@ typedef struct {
|
||||
volatile rtcadc_sar2_hw_wakeup_reg_t sar2_hw_wakeup;
|
||||
} rtcadc_dev_t;
|
||||
|
||||
extern rtcadc_dev_t LP_ADC;
|
||||
|
||||
#ifndef __cplusplus
|
||||
_Static_assert(sizeof(rtcadc_dev_t) == 0x74, "Invalid size of rtcadc_dev_t structure");
|
@@ -43,7 +43,7 @@
|
||||
#define DR_REG_REGDMA_BASE (DR_REG_HPPERIPH0_BASE + 0x82000)
|
||||
#define DR_REG_SDMMC_BASE (DR_REG_HPPERIPH0_BASE + 0x83000)
|
||||
#define DR_REG_H264_CORE_BASE (DR_REG_HPPERIPH0_BASE + 0x84000)
|
||||
#define DR_REG_AHB_PDMA_BASE (DR_REG_HPPERIPH0_BASE + 0x85000)
|
||||
#define DR_REG_AHB_DMA_BASE (DR_REG_HPPERIPH0_BASE + 0x85000)
|
||||
#define DR_REG_JPEG_BASE (DR_REG_HPPERIPH0_BASE + 0x86000)
|
||||
#define DR_REG_PPA_BASE (DR_REG_HPPERIPH0_BASE + 0x87000)
|
||||
#define DR_REG_DMA2D_BASE (DR_REG_HPPERIPH0_BASE + 0x88000)
|
||||
|
@@ -37,3 +37,44 @@
|
||||
#define I2C_SAR_ADC_DTEST_VDD_GRP1 9
|
||||
#define I2C_SAR_ADC_DTEST_VDD_GRP1_MSB 3
|
||||
#define I2C_SAR_ADC_DTEST_VDD_GRP1_LSB 0
|
||||
|
||||
#define ADC_SAR1_SAMPLE_CYCLE_ADDR 0x2
|
||||
#define ADC_SAR1_SAMPLE_CYCLE_ADDR_MSB 0x2
|
||||
#define ADC_SAR1_SAMPLE_CYCLE_ADDR_LSB 0x0
|
||||
|
||||
#define ADC_SAR1_DREF_ADDR 0x2
|
||||
#define ADC_SAR1_DREF_ADDR_MSB 0x6
|
||||
#define ADC_SAR1_DREF_ADDR_LSB 0x4
|
||||
|
||||
#define ADC_SAR2_INITIAL_CODE_LOW_ADDR 0x3
|
||||
#define ADC_SAR2_INITIAL_CODE_LOW_ADDR_MSB 0x7
|
||||
#define ADC_SAR2_INITIAL_CODE_LOW_ADDR_LSB 0x0
|
||||
|
||||
#define ADC_SAR2_INITIAL_CODE_HIGH_ADDR 0x4
|
||||
#define ADC_SAR2_INITIAL_CODE_HIGH_ADDR_MSB 0x3
|
||||
#define ADC_SAR2_INITIAL_CODE_HIGH_ADDR_LSB 0x0
|
||||
|
||||
|
||||
#define ADC_SAR2_SAMPLE_CYCLE_ADDR 0x5
|
||||
#define ADC_SAR2_SAMPLE_CYCLE_ADDR_MSB 0x2
|
||||
#define ADC_SAR2_SAMPLE_CYCLE_ADDR_LSB 0x0
|
||||
|
||||
#define ADC_SAR2_DREF_ADDR 0x5
|
||||
#define ADC_SAR2_DREF_ADDR_MSB 0x6
|
||||
#define ADC_SAR2_DREF_ADDR_LSB 0x4
|
||||
|
||||
#define ADC_SAR1_ENCAL_REF_ADDR 0x7
|
||||
#define ADC_SAR1_ENCAL_REF_ADDR_MSB 4
|
||||
#define ADC_SAR1_ENCAL_REF_ADDR_LSB 4
|
||||
|
||||
#define ADC_SAR1_ENCAL_GND_ADDR 0x7
|
||||
#define ADC_SAR1_ENCAL_GND_ADDR_MSB 5
|
||||
#define ADC_SAR1_ENCAL_GND_ADDR_LSB 5
|
||||
|
||||
#define ADC_SAR2_ENCAL_REF_ADDR 0x7
|
||||
#define ADC_SAR2_ENCAL_REF_ADDR_MSB 6
|
||||
#define ADC_SAR2_ENCAL_REF_ADDR_LSB 6
|
||||
|
||||
#define ADC_SAR2_ENCAL_GND_ADDR 0x7
|
||||
#define ADC_SAR2_ENCAL_GND_ADDR_MSB 7
|
||||
#define ADC_SAR2_ENCAL_GND_ADDR_LSB 7
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
/*-------------------------- COMMON CAPS ---------------------------------------*/
|
||||
// #define SOC_ADC_SUPPORTED 1 //TODO: IDF-6496
|
||||
#define SOC_ADC_SUPPORTED 1
|
||||
#define SOC_ANA_CMPR_SUPPORTED 1
|
||||
#define SOC_DEDICATED_GPIO_SUPPORTED 1
|
||||
#define SOC_UART_SUPPORTED 1
|
||||
@@ -108,19 +108,20 @@
|
||||
|
||||
/*-------------------------- ADC CAPS -------------------------------*/
|
||||
/*!< SAR ADC Module*/
|
||||
// #define SOC_ADC_DIG_CTRL_SUPPORTED 1 //TODO: IDF-6496, TODO: IDF-6497
|
||||
#define SOC_ADC_RTC_CTRL_SUPPORTED 1
|
||||
#define SOC_ADC_DIG_CTRL_SUPPORTED 1
|
||||
// #define SOC_ADC_DIG_IIR_FILTER_SUPPORTED 1
|
||||
// #define SOC_ADC_MONITOR_SUPPORTED 1
|
||||
#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_DMA_SUPPORTED 1
|
||||
#define SOC_ADC_PERIPH_NUM (2)
|
||||
#define SOC_ADC_CHANNEL_NUM(PERIPH_NUM) ((PERIPH_NUM==0)? 6: 8)
|
||||
#define SOC_ADC_MAX_CHANNEL_NUM (8)
|
||||
#define SOC_ADC_ATTEN_NUM (4)
|
||||
|
||||
/*!< Digital */
|
||||
#define SOC_ADC_DIGI_CONTROLLER_NUM (1U)
|
||||
#define SOC_ADC_PATT_LEN_MAX (8) /*!< Two pattern tables, each contains 4 items. Each item takes 1 byte */
|
||||
#define SOC_ADC_DIGI_CONTROLLER_NUM (2)
|
||||
#define SOC_ADC_PATT_LEN_MAX (16) /*!< Four 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_IIR_FILTER_NUM (2)
|
||||
@@ -138,6 +139,9 @@
|
||||
/*!< Calibration */
|
||||
#define SOC_ADC_CALIBRATION_V1_SUPPORTED (0) /*!< support HW offset calibration version 1*/
|
||||
|
||||
/*!< ADC power control is shared by PWDET, TempSensor */
|
||||
#define SOC_ADC_SHARED_POWER 1
|
||||
|
||||
// ESP32P4-TODO: Copy from esp32c6, need check
|
||||
/*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
|
||||
#define SOC_APB_BACKUP_DMA (0)
|
||||
|
@@ -80,6 +80,7 @@ PROVIDE ( LP_I2C = 0x50122000 );
|
||||
PROVIDE ( LP_SPI = 0x50123000 );
|
||||
PROVIDE ( LP_WDT = 0x50116000 );
|
||||
PROVIDE ( LP_I2S = 0x50125000 );
|
||||
PROVIDE ( LP_ADC = 0x50127000 );
|
||||
PROVIDE ( LP_TOUCH = 0x50128000 );
|
||||
PROVIDE ( LP_GPIO = 0x5012A000 );
|
||||
PROVIDE ( LP_PERI_PMS = 0x5012E000 );
|
||||
|
Reference in New Issue
Block a user