arch/xtensa/esp32[-s2|-s3]: Add RTC GPIO write/read calls support
Add RTC GPIO write/read calls support for esp32[-s2|-s3] Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
This commit is contained in:
parent
bb9639bd2b
commit
36616025c7
6 changed files with 148 additions and 0 deletions
|
|
@ -38,6 +38,7 @@
|
|||
#include "esp32s2_rtc_gpio.h"
|
||||
#include "hardware/esp32s2_rtc_io.h"
|
||||
#include "hardware/esp32s2_sens.h"
|
||||
#include "driver/rtc_io.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
@ -342,6 +343,45 @@ int esp32s2_configrtcio(int rtcio_num, rtcio_pinattr_t attr)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtcioread
|
||||
*
|
||||
* Description:
|
||||
* Read one or zero from the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - RTCIO rtcio_num to be read.
|
||||
*
|
||||
* Returned Value:
|
||||
* The boolean representation of the input value (true/false).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s2_rtcioread(int rtcio_num)
|
||||
{
|
||||
return rtc_gpio_get_level(rtcio_num);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtciowrite
|
||||
*
|
||||
* Description:
|
||||
* Write one or zero to the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - GPIO pin to be modified.
|
||||
* value - The value to be written (0 or 1).
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void esp32s2_rtciowrite(int rtcio_num, bool value)
|
||||
{
|
||||
rtc_gpio_set_level(rtcio_num, value);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtcioirqinitialize
|
||||
*
|
||||
|
|
|
|||
|
|
@ -574,6 +574,39 @@ static const rtc_io_desc_t g_rtc_io_desc[RTC_GPIO_NUMBER] =
|
|||
|
||||
int esp32s2_configrtcio(int rtcio_num, rtcio_pinattr_t attr);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtcioread
|
||||
*
|
||||
* Description:
|
||||
* Read one or zero from the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - RTCIO rtcio_num to be read.
|
||||
*
|
||||
* Returned Value:
|
||||
* The boolean representation of the input value (true/false).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s2_rtcioread(int rtcio_num);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtciowrite
|
||||
*
|
||||
* Description:
|
||||
* Write one or zero to the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - GPIO pin to be modified.
|
||||
* value - The value to be written (0 or 1).
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void esp32s2_rtciowrite(int rtcio_num, bool value);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s2_rtcioirqinitialize
|
||||
*
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$
|
|||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)ledc_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)pcnt_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)rmt_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)rtc_io_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)sdm_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)i2c_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)i2s_periph.c
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "hardware/esp32s3_rtc_io.h"
|
||||
#include "hardware/esp32s3_sens.h"
|
||||
#include "hardware/esp32s3_usb_serial_jtag.h"
|
||||
#include "driver/rtc_io.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
@ -386,6 +387,45 @@ int esp32s3_configrtcio(int rtcio_num, rtcio_pinattr_t attr)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtcioread
|
||||
*
|
||||
* Description:
|
||||
* Read one or zero from the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - RTCIO rtcio_num to be read.
|
||||
*
|
||||
* Returned Value:
|
||||
* The boolean representation of the input value (true/false).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s3_rtcioread(int rtcio_num)
|
||||
{
|
||||
return rtc_gpio_get_level(rtcio_num);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtciowrite
|
||||
*
|
||||
* Description:
|
||||
* Write one or zero to the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - GPIO pin to be modified.
|
||||
* value - The value to be written (0 or 1).
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void esp32s3_rtciowrite(int rtcio_num, bool value)
|
||||
{
|
||||
rtc_gpio_set_level(rtcio_num, value);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtcioirqinitialize
|
||||
*
|
||||
|
|
|
|||
|
|
@ -575,6 +575,39 @@ static const rtc_io_desc_t g_rtc_io_desc[RTC_GPIO_NUMBER] =
|
|||
|
||||
int esp32s3_configrtcio(int rtcio_num, rtcio_pinattr_t attr);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtcioread
|
||||
*
|
||||
* Description:
|
||||
* Read one or zero from the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - RTCIO rtcio_num to be read.
|
||||
*
|
||||
* Returned Value:
|
||||
* The boolean representation of the input value (true/false).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s3_rtcioread(int rtcio_num);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtciowrite
|
||||
*
|
||||
* Description:
|
||||
* Write one or zero to the selected RTC GPIO pin
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcio_num - GPIO pin to be modified.
|
||||
* value - The value to be written (0 or 1).
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void esp32s3_rtciowrite(int rtcio_num, bool value);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_rtcioirqinitialize
|
||||
*
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$
|
|||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)ledc_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)pcnt_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)rmt_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)rtc_io_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)sdm_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)i2c_periph.c
|
||||
CHIP_CSRCS += chip$(DELIM)$(ESP_HAL_3RDPARTY_REPO)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)i2s_periph.c
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue