You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/12 12:38:49 UTC

[GitHub] [nuttx] lucasssvaz opened a new pull request, #8096: arch/xtensa/esp32s2: Add initial support for touch pad polling

lucasssvaz opened a new pull request, #8096:
URL: https://github.com/apache/nuttx/pull/8096

   ## Summary
   
   Adds support for polling the touch pad values on ESP32-S2.
   
   ## Impact
   
   None at first, the ESP32-S2-Kaluga-1 implementation will be done next.
   
   ## Testing
   
   Tested using a modified buttons config with a modified ESP32-S2-Saola-1.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 merged pull request #8096: arch/xtensa/esp32s2: Add initial support for touch pad polling

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #8096:
URL: https://github.com/apache/nuttx/pull/8096


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #8096: arch/xtensa/esp32s2: Add initial support for touch pad polling

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #8096:
URL: https://github.com/apache/nuttx/pull/8096#discussion_r1068699181


##########
arch/xtensa/src/esp32s2/hardware/esp32s2_rtccntl.h:
##########
@@ -4418,29 +5030,44 @@
 #define RTC_CNTL_FORCE_DOWNLOAD_BOOT_S  0
 
 /* RTC_CNTL_SLP_WAKEUP_CAUSE_REG register
- * sleep wakeup cause state register
+ * Stores the sleep-to-wakeup cause.
  */
 
 #define RTC_CNTL_SLP_WAKEUP_CAUSE_REG (DR_REG_RTCCNTL_BASE + 0x12c)
 
 /* RTC_CNTL_WAKEUP_CAUSE : RO; bitpos: [16:0]; default: 0;
- * sleep wakeup cause
+ * Stores the wakeup cause.
  */
 
-#define RTC_CNTL_WAKEUP_CAUSE    0x0001FFFF
+#define RTC_CNTL_WAKEUP_CAUSE    0x0001ffff

Review Comment:
   It's a bit confusing why part of the files use lower case and other part an upper case



##########
arch/xtensa/src/esp32s2/esp32s2_rtc_gpio.c:
##########
@@ -0,0 +1,251 @@
+/****************************************************************************
+ * arch/xtensa/src/esp32s2/esp32s2_rtc_gpio.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <assert.h>
+#include <debug.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <nuttx/arch.h>
+
+#include "xtensa.h"
+#include "esp32s2_rtc_gpio.h"
+#include "hardware/esp32s2_rtc_io.h"
+#include "hardware/esp32s2_sens.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define setbits(a, bs)   modifyreg32(a, 0, bs)
+#define resetbits(a, bs) modifyreg32(a, bs, 0)
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+enum rtcio_lh_out_mode_e
+{
+  RTCIO_OUTPUT_NORMAL = 0,    /* RTCIO output mode is normal. */
+  RTCIO_OUTPUT_OD = 0x1,      /* RTCIO output mode is open-drain. */
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const uint32_t rtc_gpio_to_addr[] =
+{
+  RTCIO_RTC_GPIO_PIN0_REG,
+  RTCIO_RTC_GPIO_PIN1_REG,
+  RTCIO_RTC_GPIO_PIN2_REG,
+  RTCIO_RTC_GPIO_PIN3_REG,
+  RTCIO_RTC_GPIO_PIN4_REG,
+  RTCIO_RTC_GPIO_PIN5_REG,
+  RTCIO_RTC_GPIO_PIN6_REG,
+  RTCIO_RTC_GPIO_PIN7_REG,
+  RTCIO_RTC_GPIO_PIN8_REG,
+  RTCIO_RTC_GPIO_PIN9_REG,
+  RTCIO_RTC_GPIO_PIN10_REG,
+  RTCIO_RTC_GPIO_PIN11_REG,
+  RTCIO_RTC_GPIO_PIN12_REG,
+  RTCIO_RTC_GPIO_PIN13_REG,
+  RTCIO_RTC_GPIO_PIN14_REG,
+  RTCIO_RTC_GPIO_PIN15_REG,
+  RTCIO_RTC_GPIO_PIN16_REG,
+  RTCIO_RTC_GPIO_PIN17_REG,
+  RTCIO_RTC_GPIO_PIN18_REG,
+  RTCIO_RTC_GPIO_PIN19_REG,
+  RTCIO_RTC_GPIO_PIN20_REG,
+  RTCIO_RTC_GPIO_PIN21_REG
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: is_valid_rtc_gpio
+ *
+ * Description:
+ *   Determine if the specified rtcio_num is a valid RTC GPIO.
+ *
+ ****************************************************************************/
+
+static inline bool is_valid_rtc_gpio(uint32_t rtcio_num)
+{
+  return (rtcio_num < RTC_GPIO_NUMBER);

Review Comment:
   no need for `()` on `return`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org