93 lines
11 KiB
C
93 lines
11 KiB
C
// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include "soc/rtc_io_periph.h"
|
|
|
|
const int rtc_io_num_map[GPIO_PIN_COUNT] = {
|
|
RTCIO_GPIO0_CHANNEL, //GPIO0
|
|
RTCIO_GPIO1_CHANNEL, //GPIO1
|
|
RTCIO_GPIO2_CHANNEL, //GPIO2
|
|
RTCIO_GPIO3_CHANNEL, //GPIO3
|
|
RTCIO_GPIO4_CHANNEL, //GPIO4
|
|
RTCIO_GPIO5_CHANNEL, //GPIO5
|
|
RTCIO_GPIO6_CHANNEL, //GPIO6
|
|
RTCIO_GPIO7_CHANNEL, //GPIO7
|
|
RTCIO_GPIO8_CHANNEL, //GPIO8
|
|
RTCIO_GPIO9_CHANNEL, //GPIO9
|
|
RTCIO_GPIO10_CHANNEL, //GPIO10
|
|
RTCIO_GPIO11_CHANNEL, //GPIO11
|
|
RTCIO_GPIO12_CHANNEL, //GPIO12
|
|
RTCIO_GPIO13_CHANNEL, //GPIO13
|
|
RTCIO_GPIO14_CHANNEL, //GPIO14
|
|
RTCIO_GPIO15_CHANNEL, //GPIO15
|
|
RTCIO_GPIO16_CHANNEL, //GPIO16
|
|
RTCIO_GPIO17_CHANNEL, //GPIO17
|
|
RTCIO_GPIO18_CHANNEL, //GPIO18
|
|
RTCIO_GPIO19_CHANNEL, //GPIO19
|
|
RTCIO_GPIO20_CHANNEL, //GPIO20
|
|
RTCIO_GPIO21_CHANNEL, //GPIO21
|
|
-1,//GPIO22
|
|
-1,//GPIO23
|
|
-1,//GPIO24
|
|
-1,//GPIO25
|
|
-1,//GPIO26
|
|
-1,//GPIO27
|
|
-1,//GPIO28
|
|
-1,//GPIO29
|
|
-1,//GPIO30
|
|
-1,//GPIO31
|
|
-1,//GPIO32
|
|
-1,//GPIO33
|
|
-1,//GPIO34
|
|
-1,//GPIO35
|
|
-1,//GPIO36
|
|
-1,//GPIO37
|
|
-1,//GPIO38
|
|
-1,//GPIO39
|
|
-1,//GPIO40
|
|
-1,//GPIO41
|
|
-1,//GPIO42
|
|
-1,//GPIO43
|
|
-1,//GPIO44
|
|
-1,//GPIO45
|
|
-1,//GPIO46
|
|
-1,//GPIO47
|
|
};
|
|
|
|
//Reg,Mux,Fun,IE,Up,Down,Rtc_number
|
|
const rtc_io_desc_t rtc_io_desc[SOC_RTC_IO_PIN_COUNT] = {
|
|
/*REG MUX select function select Input enable Pullup Pulldown Sleep select Sleep input enable Sleep output enable PAD hold Pad force hold Mask of drive capability Offset gpio number */
|
|
{RTC_IO_TOUCH_PAD0_REG, RTC_IO_TOUCH_PAD0_MUX_SEL_M, RTC_IO_TOUCH_PAD0_FUN_SEL_S, RTC_IO_TOUCH_PAD0_FUN_IE_M, RTC_IO_TOUCH_PAD0_RUE_M, RTC_IO_TOUCH_PAD0_RDE_M, RTC_IO_TOUCH_PAD0_SLP_SEL_M, RTC_IO_TOUCH_PAD0_SLP_IE_M, RTC_IO_TOUCH_PAD0_SLP_OE_M, 0, RTC_CNTL_TOUCH_PAD0_HOLD_M, RTC_IO_TOUCH_PAD0_DRV_V, RTC_IO_TOUCH_PAD0_DRV_S, RTCIO_CHANNEL_0_GPIO_NUM}, //0
|
|
{RTC_IO_TOUCH_PAD1_REG, RTC_IO_TOUCH_PAD1_MUX_SEL_M, RTC_IO_TOUCH_PAD1_FUN_SEL_S, RTC_IO_TOUCH_PAD1_FUN_IE_M, RTC_IO_TOUCH_PAD1_RUE_M, RTC_IO_TOUCH_PAD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IO_PAD20_FUN_IE_M, RTC_IO_PAD20_RUE_M, RTC_IO_PAD20_RDE_M, RTC_IO_PAD20_SLP_SEL_M, RTC_IO_PAD20_SLP_IE_M, RTC_IO_PAD20_SLP_OE_M, 0, RTC_CNTL_PAD20_HOLD_M, RTC_IO_PAD20_DRV_V, RTC_IO_PAD20_DRV_S, RTCIO_CHANNEL_20_GPIO_NUM}, //20
|
|
{RTC_IO_RTC_PAD21_REG, RTC_IO_PAD21_MUX_SEL_M, RTC_IO_PAD21_FUN_SEL_S, RTC_IO_PAD21_FUN_IE_M, RTC_IO_PAD21_RUE_M, RTC_IO_PAD21_RDE_M, RTC_IO_PAD21_SLP_SEL_M, RTC_IO_PAD21_SLP_IE_M, RTC_IO_PAD21_SLP_OE_M, 0, RTC_CNTL_PAD21_HOLD_M, RTC_IO_PAD21_DRV_V, RTC_IO_PAD21_DRV_S, RTCIO_CHANNEL_21_GPIO_NUM}, //21
|
|
};
|