mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-17 23:41:55 +00:00
Merge branch 'feature/esp32c61_lp_io_support' into 'master'
feat(lp_io): Add LP_IO support for ESP32C61 Closes IDF-9317 See merge request espressif/esp-idf!33013
This commit is contained in:
@@ -255,6 +255,10 @@ config SOC_GPIO_SUPPORT_RTC_INDEPENDENT
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_LP_IO_CLOCK_IS_INDEPENDENT
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GPIO_IN_RANGE_MAX
|
||||
int
|
||||
default 21
|
||||
@@ -291,6 +295,22 @@ config SOC_GPIO_CLOCKOUT_CHANNEL_NUM
|
||||
int
|
||||
default 3
|
||||
|
||||
config SOC_RTCIO_PIN_COUNT
|
||||
int
|
||||
default 7
|
||||
|
||||
config SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_RTCIO_HOLD_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_RTCIO_WAKE_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
||||
int
|
||||
default 8
|
||||
|
@@ -135,43 +135,6 @@ extern "C" {
|
||||
#define HIGH_IO_HOLD_BIT_SHIFT 32
|
||||
|
||||
#define REG_IO_MUX_BASE DR_REG_IO_MUX_BASE
|
||||
#define PIN_CTRL (REG_IO_MUX_BASE +0x00)
|
||||
#define PAD_POWER_SEL BIT(15)
|
||||
#define PAD_POWER_SEL_V 0x1
|
||||
#define PAD_POWER_SEL_M BIT(15)
|
||||
#define PAD_POWER_SEL_S 15
|
||||
|
||||
#define PAD_POWER_SWITCH_DELAY 0x7
|
||||
#define PAD_POWER_SWITCH_DELAY_V 0x7
|
||||
#define PAD_POWER_SWITCH_DELAY_M (PAD_POWER_SWITCH_DELAY_V << PAD_POWER_SWITCH_DELAY_S)
|
||||
#define PAD_POWER_SWITCH_DELAY_S 12
|
||||
|
||||
//TODO: [ESP32C61] IDF-9316, copy from verify
|
||||
#define IO_MUX_CLK_OUT3 0x0000000F
|
||||
#define IO_MUX_CLK_OUT3_M ((IO_MUX_CLK_OUT3_V)<<(IO_MUX_CLK_OUT3_S))
|
||||
#define IO_MUX_CLK_OUT3_V 0xF
|
||||
#define IO_MUX_CLK_OUT3_S 8
|
||||
#define IO_MUX_CLK_OUT2 0x0000000F
|
||||
#define IO_MUX_CLK_OUT2_M ((IO_MUX_CLK_OUT2_V)<<(IO_MUX_CLK_OUT2_S))
|
||||
#define IO_MUX_CLK_OUT2_V 0xF
|
||||
#define IO_MUX_CLK_OUT2_S 4
|
||||
#define IO_MUX_CLK_OUT1 0x0000000F
|
||||
#define IO_MUX_CLK_OUT1_M ((IO_MUX_CLK_OUT1_V)<<(IO_MUX_CLK_OUT1_S))
|
||||
#define IO_MUX_CLK_OUT1_V 0xF
|
||||
#define IO_MUX_CLK_OUT1_S 0
|
||||
|
||||
#define CLK_OUT3 IO_MUX_CLK_OUT3
|
||||
#define CLK_OUT3_V IO_MUX_CLK_OUT3_V
|
||||
#define CLK_OUT3_S IO_MUX_CLK_OUT3_S
|
||||
#define CLK_OUT3_M IO_MUX_CLK_OUT3_M
|
||||
#define CLK_OUT2 IO_MUX_CLK_OUT2
|
||||
#define CLK_OUT2_V IO_MUX_CLK_OUT2_V
|
||||
#define CLK_OUT2_S IO_MUX_CLK_OUT2_S
|
||||
#define CLK_OUT2_M IO_MUX_CLK_OUT2_M
|
||||
#define CLK_OUT1 IO_MUX_CLK_OUT1
|
||||
#define CLK_OUT1_V IO_MUX_CLK_OUT1_V
|
||||
#define CLK_OUT1_S IO_MUX_CLK_OUT1_S
|
||||
#define CLK_OUT1_M IO_MUX_CLK_OUT1_M
|
||||
// definitions above are inherited from previous version of code, should double check
|
||||
|
||||
// definitions below are generated from pin_txt.csv
|
||||
|
28
components/soc/esp32c61/include/soc/rtc_io_channel.h
Normal file
28
components/soc/esp32c61/include/soc/rtc_io_channel.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define RTCIO_GPIO0_CHANNEL 0 //RTCIO_CHANNEL_0
|
||||
#define RTCIO_CHANNEL_0_GPIO_NUM 0
|
||||
|
||||
#define RTCIO_GPIO1_CHANNEL 1 //RTCIO_CHANNEL_1
|
||||
#define RTCIO_CHANNEL_1_GPIO_NUM 1
|
||||
|
||||
#define RTCIO_GPIO2_CHANNEL 2 //RTCIO_CHANNEL_2
|
||||
#define RTCIO_CHANNEL_2_GPIO_NUM 2
|
||||
|
||||
#define RTCIO_GPIO3_CHANNEL 3 //RTCIO_CHANNEL_3
|
||||
#define RTCIO_CHANNEL_3_GPIO_NUM 3
|
||||
|
||||
#define RTCIO_GPIO4_CHANNEL 4 //RTCIO_CHANNEL_4
|
||||
#define RTCIO_CHANNEL_4_GPIO_NUM 4
|
||||
|
||||
#define RTCIO_GPIO5_CHANNEL 5 //RTCIO_CHANNEL_5
|
||||
#define RTCIO_CHANNEL_5_GPIO_NUM 5
|
||||
|
||||
#define RTCIO_GPIO6_CHANNEL 6 //RTCIO_CHANNEL_6
|
||||
#define RTCIO_CHANNEL_6_GPIO_NUM 6
|
@@ -167,8 +167,9 @@
|
||||
// Target has the full LP IO subsystem
|
||||
// On ESP32-C61, Digital IOs have their own registers to control pullup/down capability, independent of LP registers.
|
||||
#define SOC_GPIO_SUPPORT_RTC_INDEPENDENT (1)
|
||||
// GPIO0~7 on ESP32C61 can support chip deep sleep wakeup
|
||||
// \#define SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP (1) //TODO:reopen
|
||||
|
||||
// LP IO peripherals have independent clock gating to manage
|
||||
#define SOC_LP_IO_CLOCK_IS_INDEPENDENT (1)
|
||||
|
||||
#define SOC_GPIO_VALID_GPIO_MASK ((1U<<SOC_GPIO_PIN_COUNT) - 1)
|
||||
#define SOC_GPIO_VALID_OUTPUT_GPIO_MASK SOC_GPIO_VALID_GPIO_MASK
|
||||
@@ -176,6 +177,8 @@
|
||||
#define SOC_GPIO_IN_RANGE_MAX 21
|
||||
#define SOC_GPIO_OUT_RANGE_MAX 21
|
||||
|
||||
// GPIO0~6 on ESP32C61 can support chip deep sleep wakeup
|
||||
// \#define SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP (1) //TODO: IDF-9245
|
||||
#define SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK (0ULL | BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | BIT5 | BIT6)
|
||||
#define SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT (7)
|
||||
|
||||
@@ -185,7 +188,7 @@
|
||||
// Support to force hold all IOs
|
||||
#define SOC_GPIO_SUPPORT_FORCE_HOLD (1)
|
||||
// "LP"_IOs and DIG_IOs can be hold during deep sleep and after waking up
|
||||
#define SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP (1)
|
||||
#define SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP (1)
|
||||
// Support to hold a single digital I/O when the digital domain is powered off
|
||||
#define SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP (1)
|
||||
|
||||
@@ -194,14 +197,13 @@
|
||||
#define SOC_GPIO_CLOCKOUT_CHANNEL_NUM (3)
|
||||
|
||||
/*-------------------------- RTCIO CAPS --------------------------------------*/
|
||||
//TODO: [ESP32C61] IDF-9317
|
||||
// \#define SOC_RTCIO_PIN_COUNT 8
|
||||
// \#define SOC_RTCIO_INPUT_OUTPUT_SUPPORTED 1 /* This macro indicates that the target has separate RTC IOMUX hardware feature,
|
||||
// * so it supports unique IOMUX configuration (including IE, OE, PU, PD, DRV etc.)
|
||||
// * when the pins are switched to RTC function.
|
||||
// */
|
||||
// \#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||
// \#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||
#define SOC_RTCIO_PIN_COUNT 7
|
||||
#define SOC_RTCIO_INPUT_OUTPUT_SUPPORTED 1 /* This macro indicates that the target has separate RTC IOMUX hardware feature,
|
||||
* so it supports unique IOMUX configuration (including IE, OE, PU, PD, DRV etc.)
|
||||
* when the pins are switched to RTC function.
|
||||
*/
|
||||
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||
|
||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||
|
Reference in New Issue
Block a user