You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/03/28 22:43:40 UTC
[nuttx] branch master updated (6a2152aa44 -> da47c468b8)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 6a2152aa44 boards/nrf5340-dk: add buttons example
new f9f41bbd95 arch/nrf53: add RTC support
new d23759d457 arch/nrf53: add tickless support
new da47c468b8 boards/nrf5340-dk: add ostest_tickless configuration
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/arm/src/nrf53/Kconfig | 36 +++
arch/arm/src/nrf53/Make.defs | 9 +
.../src/{nrf52/nrf52_rtc.c => nrf53/nrf53_rtc.c} | 353 ++++++++++-----------
arch/arm/src/nrf53/nrf53_rtc.h | 139 ++++++++
.../nrf53_tickless_rtc.c} | 82 +++--
.../defconfig | 3 +-
6 files changed, 391 insertions(+), 231 deletions(-)
copy arch/arm/src/{nrf52/nrf52_rtc.c => nrf53/nrf53_rtc.c} (62%)
create mode 100644 arch/arm/src/nrf53/nrf53_rtc.h
copy arch/arm/src/{nrf52/nrf52_tickless_rtc.c => nrf53/nrf53_tickless_rtc.c} (78%)
copy boards/arm/nrf53/nrf5340-dk/configs/{timer_cpuapp => ostest_tickless_cpuapp}/defconfig (96%)
[nuttx] 02/03: arch/nrf53: add tickless support
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit d23759d45719dc1bf4396e9203d43784eac67b5c
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Mar 13 16:05:38 2023 +0100
arch/nrf53: add tickless support
---
arch/arm/src/nrf53/Kconfig | 21 ++
arch/arm/src/nrf53/Make.defs | 5 +
arch/arm/src/nrf53/nrf53_tickless_rtc.c | 342 ++++++++++++++++++++++++++++++++
3 files changed, 368 insertions(+)
diff --git a/arch/arm/src/nrf53/Kconfig b/arch/arm/src/nrf53/Kconfig
index b4b8e07c7a..4cf7b88105 100644
--- a/arch/arm/src/nrf53/Kconfig
+++ b/arch/arm/src/nrf53/Kconfig
@@ -248,8 +248,29 @@ config NRF53_SYSTIMER_SYSTICK
you choose this option, WFE/WFI will not be used
in idle loop.
+config NRF53_SYSTIMER_RTC
+ bool "RTC"
+ select NRF53_RTC
+ select SCHED_TICKLESS
+ select SCHED_TICKLESS_ALARM
+ select NRF53_USE_LFCLK
+ ---help---
+ Use RTC timer in tickless mode.
+
endchoice
+if NRF53_SYSTIMER_RTC
+
+config NRF53_SYSTIMER_RTC_INSTANCE
+ int "RTC timer instance"
+ default 0 if !NRF53_SOFTDEVICE_CONTROLLER
+ default 1 if NRF53_SOFTDEVICE_CONTROLLER
+ range 0 1
+ ---help---
+ Which RTC instance to use to drive the system timer
+
+endif
+
endmenu # System Timer
menu "PWM configuration"
diff --git a/arch/arm/src/nrf53/Make.defs b/arch/arm/src/nrf53/Make.defs
index 81f78f16e8..77b2916452 100644
--- a/arch/arm/src/nrf53/Make.defs
+++ b/arch/arm/src/nrf53/Make.defs
@@ -22,7 +22,12 @@ include armv8-m/Make.defs
ifeq ($(CONFIG_NRF53_SYSTIMER_SYSTICK),y)
CHIP_CSRCS += nrf53_systick.c
+else
+ifeq ($(CONFIG_NRF53_SYSTIMER_RTC),y)
+CHIP_CSRCS += nrf53_tickless_rtc.c
endif
+endif
+
CHIP_CSRCS += nrf53_start.c nrf53_clockconfig.c nrf53_irq.c nrf53_utils.c
CHIP_CSRCS += nrf53_allocateheap.c nrf53_lowputc.c nrf53_gpio.c
CHIP_CSRCS += nrf53_uid.c
diff --git a/arch/arm/src/nrf53/nrf53_tickless_rtc.c b/arch/arm/src/nrf53/nrf53_tickless_rtc.c
new file mode 100644
index 0000000000..418fee3288
--- /dev/null
+++ b/arch/arm/src/nrf53/nrf53_tickless_rtc.c
@@ -0,0 +1,342 @@
+/****************************************************************************
+ * arch/arm/src/nrf53/nrf53_tickless_rtc.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 <sys/types.h>
+#include <stdbool.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/arch.h>
+
+#include "arm_internal.h"
+#include "hardware/nrf53_rtc.h"
+#include "nrf53_rtc.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Check configuration */
+
+#ifdef CONFIG_TIMER_ARCH
+# error CONFIG_TIMER_ARCH must be not set
+#endif
+
+/* Check corresponding RTC support */
+
+#if (CONFIG_NRF53_SYSTIMER_RTC_INSTANCE == 0) && !defined(CONFIG_NRF53_RTC0)
+# error "Support for RTC0 is not enabled"
+#elif (CONFIG_NRF53_SYSTIMER_RTC_INSTANCE == 1) && !defined(CONFIG_NRF53_RTC1)
+# error "Support for RTC1 is not enabled"
+#endif
+
+#define NRF53_RTC_PERIOD (512)
+#define NRF53_RTC_MAX (0x00ffffff)
+#define NRF53_RTC_MAX_TIME (NRF53_RTC_MAX * 31)
+
+/* Convert uS to timer count for f = 32768Hz, using more precision
+ * when possible:
+ * (1 / 32768) s ~ 30.51 uS ~ 31 uS
+ * 512 * (1 / 32768) s = 0.015625 s = 15625 uS
+ * So, instead of always dividing by 31, if t * 512 < (2**32 - 1), we can do:
+ * (t * 512) / 15625 ~ t / 30.51
+ */
+
+#define USEC_TO_COUNTER(t) (t > 0x7fffff ? (t / 31) : ((t * 512) / 15625))
+
+/* To convert from counter to uS we split the counter into one second worth
+ * of counts (32768) and a fractional part we can safely multiply first
+ * by (USEC_PER_SEC/8) and still be within 32 bit value
+ */
+
+#define COUNTER_TO_USEC(c) ((c / 32768) * USEC_PER_SEC) + \
+ (((c % 32768) * (USEC_PER_SEC / 8)) / (32768 / 8))
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct nrf53_tickless_dev_s
+{
+ struct nrf53_rtc_dev_s *rtc; /* nrf53 RTC driver */
+ uint32_t periods; /* how many times the timer overflowed */
+ bool alarm_set; /* is the alarm set? */
+ struct timespec alarm; /* absolute time of alarm */
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int rtc_handler(int irq, void *context, void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+struct nrf53_tickless_dev_s g_tickless_dev;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static inline void rtc_counter_to_ts(uint32_t counter, struct timespec *now)
+{
+ uint32_t usec;
+
+ usec = COUNTER_TO_USEC(counter);
+ now->tv_sec = usec / USEC_PER_SEC;
+ now->tv_nsec = (usec % USEC_PER_SEC) * NSEC_PER_USEC;
+
+ now->tv_sec += g_tickless_dev.periods * NRF53_RTC_PERIOD;
+}
+
+static void rtc_prepare_alarm(void)
+{
+ struct timespec now;
+ struct timespec delta;
+ uint32_t usec;
+ uint32_t counter;
+ uint32_t target_counter;
+ const uint32_t rtc_base = NRF53_RTC_GETBASE(g_tickless_dev.rtc);
+
+ /* Get current absolute time */
+
+ counter = NRF53_RTC_GETCOUNTER_REG(rtc_base);
+ rtc_counter_to_ts(counter, &now);
+
+ /* Obtain relative time to alarm */
+
+ clock_timespec_subtract(&g_tickless_dev.alarm, &now, &delta);
+ usec = delta.tv_sec * USEC_PER_SEC + delta.tv_nsec / NSEC_PER_USEC;
+
+ /* Check if the alarm is to expire within one RTC period, if so we can set
+ * the CC.
+ */
+
+ if (usec < NRF53_RTC_PERIOD * USEC_PER_SEC)
+ {
+ /* Obtain absolute number of microseconds of alarm within current
+ * RTC period.
+ */
+
+ usec = (g_tickless_dev.alarm.tv_sec % NRF53_RTC_PERIOD) *
+ USEC_PER_SEC + g_tickless_dev.alarm.tv_nsec / NSEC_PER_USEC;
+
+ /* Compute counter value for that point in time */
+
+ target_counter = USEC_TO_COUNTER(usec);
+
+ /* Enable interrupt. First set CC to distant value to ensure
+ * no match will be generated. Doing things this way we now that
+ * once we write a CC value it should be ready to match.
+ */
+
+ NRF53_RTC_SETCC_REG(rtc_base, 0, counter - 1);
+ NRF53_RTC_ENABLEINT(g_tickless_dev.rtc, NRF53_RTC_EVT_COMPARE0);
+
+ /* Set CC to desired value */
+
+ NRF53_RTC_SETCC_REG(rtc_base, 0, target_counter);
+
+ /* Ensure counter fires: from nrf53832_PS_v1.4 (p. 245) we know that
+ * "If the COUNTER is N, writing N+2 to a CC register is
+ * guaranteed to trigger a COMPARE event at N+2.", so anything
+ * less than that is not guaranteed and it may not ever match.
+ *
+ * To ensure this, we check if CC < N + 2, and if so we set CC = N+2.
+ * We repeat this until this is satisfied (as the counter may change
+ * in between calculations).
+ */
+
+ while (NRF53_RTC_GETCC_REG(rtc_base, 0) <
+ NRF53_RTC_GETCOUNTER_REG(rtc_base) + 2)
+ {
+ NRF53_RTC_SETCC_REG(rtc_base, 0,
+ NRF53_RTC_GETCOUNTER_REG(rtc_base) + 2);
+ }
+ }
+}
+
+/****************************************************************************
+ * Name: rtc_handler
+ ****************************************************************************/
+
+static int rtc_handler(int irq, void *context, void *arg)
+{
+ irqstate_t flags;
+
+ flags = enter_critical_section();
+
+ /* if the timer wrapped-around */
+
+ if (NRF53_RTC_CHECKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_OVRFLW))
+ {
+ /* ack interrupt */
+
+ NRF53_RTC_ACKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_OVRFLW);
+
+ /* count one more period */
+
+ g_tickless_dev.periods++;
+
+ /* check if the currently set alarm is to fire in this new period */
+
+ if (g_tickless_dev.alarm_set)
+ {
+ rtc_prepare_alarm();
+ }
+ }
+
+ /* if the compare event fired */
+
+ if (NRF53_RTC_CHECKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_COMPARE0))
+ {
+ struct timespec now;
+
+ /* cancel alarm and get current time */
+
+ up_alarm_cancel(&now);
+
+ /* let scheduler now of alarm firing */
+
+ nxsched_alarm_expiration(&now);
+ }
+
+ leave_critical_section(flags);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_alarm_cancel
+ ****************************************************************************/
+
+int up_alarm_cancel(struct timespec *ts)
+{
+ uint32_t counter;
+ irqstate_t flags;
+
+ flags = enter_critical_section();
+
+ NRF53_RTC_DISABLEINT(g_tickless_dev.rtc, NRF53_RTC_EVT_COMPARE0);
+ NRF53_RTC_GETCOUNTER(g_tickless_dev.rtc, &counter);
+ rtc_counter_to_ts(counter, ts);
+
+ NRF53_RTC_ACKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_COMPARE0);
+ g_tickless_dev.alarm_set = false;
+
+ leave_critical_section(flags);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: up_alarm_start
+ ****************************************************************************/
+
+int up_alarm_start(const struct timespec *ts)
+{
+ irqstate_t flags;
+ flags = enter_critical_section();
+
+ /* remember the alarm time */
+
+ g_tickless_dev.alarm_set = true;
+ g_tickless_dev.alarm = *ts;
+
+ rtc_prepare_alarm();
+
+ leave_critical_section(flags);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: up_timer_gettime
+ ****************************************************************************/
+
+int up_timer_gettime(struct timespec *ts)
+{
+ uint32_t counter;
+ irqstate_t flags;
+
+ flags = enter_critical_section();
+
+ NRF53_RTC_GETCOUNTER(g_tickless_dev.rtc, &counter);
+ rtc_counter_to_ts(counter, ts);
+
+ leave_critical_section(flags);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: up_timer_initialize
+ ****************************************************************************/
+
+void up_timer_initialize(void)
+{
+ struct timespec ts;
+
+ memset(&g_tickless_dev, 0, sizeof(struct nrf53_tickless_dev_s));
+
+ g_tickless_dev.rtc = nrf53_rtc_init(CONFIG_NRF53_SYSTIMER_RTC_INSTANCE);
+
+ /* Ensure we have support for the selected RTC instance */
+
+ ASSERT(g_tickless_dev.rtc);
+
+ /* Configure prescaler */
+
+ NRF53_RTC_SETPRE(g_tickless_dev.rtc, 0);
+
+ /* Configure ISR */
+
+ NRF53_RTC_SETISR(g_tickless_dev.rtc, rtc_handler, NULL);
+
+ /* Enable overflow interrupt */
+
+ NRF53_RTC_ENABLEINT(g_tickless_dev.rtc, NRF53_RTC_EVT_OVRFLW);
+
+ /* Start counting */
+
+ NRF53_RTC_CLEAR(g_tickless_dev.rtc);
+ NRF53_RTC_ACKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_OVRFLW);
+ NRF53_RTC_ACKINT(g_tickless_dev.rtc, NRF53_RTC_EVT_COMPARE0);
+ NRF53_RTC_START(g_tickless_dev.rtc);
+
+ /* kick off alarm scheduling */
+
+ ts.tv_sec = ts.tv_nsec = 0;
+ nxsched_alarm_expiration(&ts);
+}
[nuttx] 01/03: arch/nrf53: add RTC support
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit f9f41bbd95d7250e3d7505d81fcf8d1bbc95a29e
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Mar 13 12:55:17 2023 +0100
arch/nrf53: add RTC support
---
arch/arm/src/nrf53/Kconfig | 15 +
arch/arm/src/nrf53/Make.defs | 4 +
arch/arm/src/nrf53/nrf53_rtc.c | 801 +++++++++++++++++++++++++++++++++++++++++
arch/arm/src/nrf53/nrf53_rtc.h | 139 +++++++
4 files changed, 959 insertions(+)
diff --git a/arch/arm/src/nrf53/Kconfig b/arch/arm/src/nrf53/Kconfig
index 890c7a1dc3..b4b8e07c7a 100644
--- a/arch/arm/src/nrf53/Kconfig
+++ b/arch/arm/src/nrf53/Kconfig
@@ -106,6 +106,10 @@ config NRF53_PWM
bool
default n
+config NRF53_RTC
+ bool
+ default n
+
menu "NRF53 Peripheral Selection"
config NRF53_GPIOTE
@@ -159,6 +163,17 @@ config NRF53_SAADC
bool "SAADC"
default n
+config NRF53_RTC0
+ bool "RTC0"
+ select NRF53_RTC
+ depends on !NRF53_SOFTDEVICE_CONTROLLER
+ default n
+
+config NRF53_RTC1
+ bool "RTC1"
+ select NRF53_RTC
+ default n
+
endmenu # NRF53 Peripheral Selection
menu "Clock Configuration"
diff --git a/arch/arm/src/nrf53/Make.defs b/arch/arm/src/nrf53/Make.defs
index b90a88b948..81f78f16e8 100644
--- a/arch/arm/src/nrf53/Make.defs
+++ b/arch/arm/src/nrf53/Make.defs
@@ -70,6 +70,10 @@ ifeq ($(CONFIG_NRF53_SAADC),y)
CHIP_CSRCS += nrf53_adc.c
endif
+ifeq ($(CONFIG_NRF53_RTC),y)
+CHIP_CSRCS += nrf53_rtc.c
+endif
+
ifeq ($(CONFIG_PM),y)
CHIP_CSRCS += nrf53_pminitialize.c
endif
diff --git a/arch/arm/src/nrf53/nrf53_rtc.c b/arch/arm/src/nrf53/nrf53_rtc.c
new file mode 100644
index 0000000000..d104feb6c9
--- /dev/null
+++ b/arch/arm/src/nrf53/nrf53_rtc.c
@@ -0,0 +1,801 @@
+/****************************************************************************
+ * arch/arm/src/nrf53/nrf53_rtc.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 <nuttx/arch.h>
+#include <nuttx/irq.h>
+
+#include "arm_internal.h"
+#include "hardware/nrf53_rtc.h"
+
+#include "nrf53_rtc.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct nrf53_rtc_priv_s
+{
+ struct nrf53_rtc_ops_s *ops;
+ uint32_t base;
+ uint32_t irq;
+ uint8_t chan;
+ bool inuse;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/* RTC registers access *****************************************************/
+
+static uint32_t nrf53_rtc_getreg(struct nrf53_rtc_dev_s *dev,
+ uint32_t offset);
+static void nrf53_rtc_putreg(struct nrf53_rtc_dev_s *dev,
+ uint32_t offset,
+ uint32_t value);
+
+/* RTC helpers **************************************************************/
+
+static uint32_t nrf53_rtc_irq2reg(struct nrf53_rtc_dev_s *dev,
+ uint8_t s);
+static uint32_t nrf53_rtc_evt2reg(struct nrf53_rtc_dev_s *dev,
+ uint8_t evt);
+
+/* RTC operations ***********************************************************/
+
+static int nrf53_rtc_start(struct nrf53_rtc_dev_s *dev);
+static int nrf53_rtc_stop(struct nrf53_rtc_dev_s *dev);
+static int nrf53_rtc_clear(struct nrf53_rtc_dev_s *dev);
+static int nrf53_rtc_trgovrflw(struct nrf53_rtc_dev_s *dev);
+static int nrf53_rtc_getcounter(struct nrf53_rtc_dev_s *dev,
+ uint32_t *cc);
+static int nrf53_rtc_setcc(struct nrf53_rtc_dev_s *dev, uint8_t i,
+ uint32_t cc);
+static int nrf53_rtc_getcc(struct nrf53_rtc_dev_s *dev, uint8_t i,
+ uint32_t *cc);
+static int nrf53_rtc_setpre(struct nrf53_rtc_dev_s *dev, uint16_t pre);
+static int nrf53_rtc_setisr(struct nrf53_rtc_dev_s *dev, xcpt_t handler,
+ void * arg);
+static int nrf53_rtc_enableint(struct nrf53_rtc_dev_s *dev, uint8_t s);
+static int nrf53_rtc_disableint(struct nrf53_rtc_dev_s *dev, uint8_t s);
+static int nrf53_rtc_checkint(struct nrf53_rtc_dev_s *dev, uint8_t s);
+static int nrf53_rtc_ackint(struct nrf53_rtc_dev_s *dev, uint8_t s);
+static int nrf53_rtc_enableevt(struct nrf53_rtc_dev_s *dev, uint8_t evt);
+static int nrf53_rtc_disableevt(struct nrf53_rtc_dev_s *dev,
+ uint8_t evt);
+static uint32_t nrf53_rtc_getbase(struct nrf53_rtc_dev_s *dev);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* NRF53 RTC ops */
+
+struct nrf53_rtc_ops_s nrf53_rtc_ops =
+{
+ .start = nrf53_rtc_start,
+ .stop = nrf53_rtc_stop,
+ .clear = nrf53_rtc_clear,
+ .trgovrflw = nrf53_rtc_trgovrflw,
+ .getcounter = nrf53_rtc_getcounter,
+ .setcc = nrf53_rtc_setcc,
+ .getcc = nrf53_rtc_getcc,
+ .setpre = nrf53_rtc_setpre,
+ .setisr = nrf53_rtc_setisr,
+ .enableint = nrf53_rtc_enableint,
+ .disableint = nrf53_rtc_disableint,
+ .checkint = nrf53_rtc_checkint,
+ .ackint = nrf53_rtc_ackint,
+ .enableevt = nrf53_rtc_enableevt,
+ .disableevt = nrf53_rtc_disableevt,
+ .getbase = nrf53_rtc_getbase,
+};
+
+#ifdef CONFIG_NRF53_RTC0
+/* RTC0 */
+
+struct nrf53_rtc_priv_s g_nrf53_rtc0_priv =
+{
+ .ops = &nrf53_rtc_ops,
+ .base = NRF53_RTC0_BASE,
+ .irq = NRF53_IRQ_RTC0,
+ .chan = 4,
+ .inuse = false,
+};
+#endif
+
+#ifdef CONFIG_NRF53_RTC1
+/* RTC1 */
+
+struct nrf53_rtc_priv_s g_nrf53_rtc1_priv =
+{
+ .ops = &nrf53_rtc_ops,
+ .base = NRF53_RTC1_BASE,
+ .irq = NRF53_IRQ_RTC1,
+ .chan = 4,
+ .inuse = false,
+};
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: nrf53_rtc_getreg
+ *
+ * Description:
+ * Get a 32-bit register value by offset
+ *
+ ****************************************************************************/
+
+static uint32_t nrf53_rtc_getreg(struct nrf53_rtc_dev_s *dev,
+ uint32_t offset)
+{
+ DEBUGASSERT(dev);
+
+ return getreg32(((struct nrf53_rtc_priv_s *)dev)->base + offset);
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_putreg
+ *
+ * Description:
+ * Put a 32-bit register value by offset
+ *
+ ****************************************************************************/
+
+static void nrf53_rtc_putreg(struct nrf53_rtc_dev_s *dev,
+ uint32_t offset,
+ uint32_t value)
+{
+ DEBUGASSERT(dev);
+
+ putreg32(value, ((struct nrf53_rtc_priv_s *)dev)->base + offset);
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_irq2reg
+ *
+ * Description:
+ * Get the value of the interrupt register corresponding to the given
+ * interrupt source
+ *
+ ****************************************************************************/
+
+static uint32_t nrf53_rtc_irq2reg(struct nrf53_rtc_dev_s *dev, uint8_t s)
+{
+ uint32_t regval = 0;
+
+ switch (s)
+ {
+ case NRF53_RTC_EVT_TICK:
+ {
+ regval = RTC_INT_TICK;
+ break;
+ }
+
+ case NRF53_RTC_EVT_OVRFLW:
+ {
+ regval = RTC_INT_OVRFLW;
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE0:
+ {
+ regval = RTC_INT_COMPARE(0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE1:
+ {
+ regval = RTC_INT_COMPARE(1);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE2:
+ {
+ regval = RTC_INT_COMPARE(2);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE3:
+ {
+ regval = RTC_INT_COMPARE(3);
+ break;
+ }
+
+ default:
+ {
+ rtcerr("ERROR: unsupported IRQ source %d\n", s);
+ regval = 0;
+ goto errout;
+ }
+ }
+
+errout:
+ return regval;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_evt2reg
+ *
+ * Description:
+ * Get the offset of the event register corresponding to the given event
+ *
+ ****************************************************************************/
+
+static uint32_t nrf53_rtc_evt2reg(struct nrf53_rtc_dev_s *dev,
+ uint8_t evt)
+{
+ uint32_t regval;
+
+ switch (evt)
+ {
+ case NRF53_RTC_EVT_TICK:
+ {
+ regval = RTC_EVTEN_TICK;
+ break;
+ }
+
+ case NRF53_RTC_EVT_OVRFLW:
+ {
+ regval = RTC_EVTEN_OVRFLW;
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE0:
+ {
+ regval = RTC_EVTEN_COMPARE(0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE1:
+ {
+ regval = RTC_EVTEN_COMPARE(1);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE2:
+ {
+ regval = RTC_EVTEN_COMPARE(2);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE3:
+ {
+ regval = RTC_EVTEN_COMPARE(3);
+ break;
+ }
+
+ default:
+ {
+ rtcerr("ERROR: unsupported EVENT %d\n", evt);
+ regval = 0;
+ goto errout;
+ }
+ }
+
+errout:
+ return regval;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_start
+ ****************************************************************************/
+
+static int nrf53_rtc_start(struct nrf53_rtc_dev_s *dev)
+{
+ DEBUGASSERT(dev);
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_TASKS_START_OFFSET, RTC_TASKS_START);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_stop
+ ****************************************************************************/
+
+static int nrf53_rtc_stop(struct nrf53_rtc_dev_s *dev)
+{
+ DEBUGASSERT(dev);
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_TASKS_STOP_OFFSET, RTC_TASKS_STOP);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_clear
+ ****************************************************************************/
+
+static int nrf53_rtc_clear(struct nrf53_rtc_dev_s *dev)
+{
+ DEBUGASSERT(dev);
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_TASKS_CLEAR_OFFSET, RTC_TASKS_CLEAR);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_trgovrflw
+ ****************************************************************************/
+
+static int nrf53_rtc_trgovrflw(struct nrf53_rtc_dev_s *dev)
+{
+ DEBUGASSERT(dev);
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_TASKS_TRIGOVRFLW_OFFSET,
+ RTC_TASKS_TRIGOVRFLW);
+
+ return OK;
+}
+
+static int nrf53_rtc_getcounter(struct nrf53_rtc_dev_s *dev,
+ uint32_t *ctr)
+{
+ DEBUGASSERT(dev);
+ DEBUGASSERT(ctr);
+
+ *ctr = nrf53_rtc_getreg(dev, NRF53_RTC_COUNTER_OFFSET);
+
+ return OK;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_setcc
+ ****************************************************************************/
+
+static int nrf53_rtc_setcc(struct nrf53_rtc_dev_s *dev, uint8_t i,
+ uint32_t cc)
+{
+ struct nrf53_rtc_priv_s *rtc = NULL;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ rtc = (struct nrf53_rtc_priv_s *)dev;
+
+ /* Is the channel supported? */
+
+ if (i > rtc->chan)
+ {
+ rtcerr("ERROR: unsupported RTCER channel %d\n", i);
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_CC_OFFSET(i), cc);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_getcc
+ ****************************************************************************/
+
+static int nrf53_rtc_getcc(struct nrf53_rtc_dev_s *dev, uint8_t i,
+ uint32_t *cc)
+{
+ struct nrf53_rtc_priv_s *rtc = NULL;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+ DEBUGASSERT(cc);
+
+ rtc = (struct nrf53_rtc_priv_s *)dev;
+
+ /* Is the channel supported? */
+
+ if (i > rtc->chan)
+ {
+ rtcerr("ERROR: unsupported RTCER channel %d\n", i);
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ *cc = nrf53_rtc_getreg(dev, NRF53_RTC_CC_OFFSET(i));
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_setpre
+ ****************************************************************************/
+
+static int nrf53_rtc_setpre(struct nrf53_rtc_dev_s *dev, uint16_t pre)
+{
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ if (pre > RTC_PRESCALER_MAX)
+ {
+ rtcerr("ERROR: unsupported RTC prescaler %d\n", pre);
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_PRESCALER_OFFSET, pre);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_setisr
+ ****************************************************************************/
+
+static int nrf53_rtc_setisr(struct nrf53_rtc_dev_s *dev, xcpt_t handler,
+ void *arg)
+{
+ struct nrf53_rtc_priv_s *rtc = NULL;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ rtc = (struct nrf53_rtc_priv_s *)dev;
+
+ /* Disable interrupt when callback is removed */
+
+ if (!handler)
+ {
+ up_disable_irq(rtc->irq);
+ irq_detach(rtc->irq);
+ ret = OK;
+ goto errout;
+ }
+
+ /* Otherwise set callback and enable interrupt */
+
+ irq_attach(rtc->irq, handler, arg);
+ up_enable_irq(rtc->irq);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_enableint
+ ****************************************************************************/
+
+static int nrf53_rtc_enableint(struct nrf53_rtc_dev_s *dev, uint8_t s)
+{
+ uint32_t regval = 0;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ /* Get register value for given interrupt source */
+
+ regval = nrf53_rtc_irq2reg(dev, s);
+ if (regval == 0)
+ {
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_INTENSET_OFFSET, regval);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_disableint
+ ****************************************************************************/
+
+static int nrf53_rtc_disableint(struct nrf53_rtc_dev_s *dev, uint8_t s)
+{
+ uint32_t regval = 0;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ /* Get register value for given interrupt source */
+
+ regval = nrf53_rtc_irq2reg(dev, s);
+ if (regval == 0)
+ {
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_INTENCLR_OFFSET, regval);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_checkint
+ ****************************************************************************/
+
+static int nrf53_rtc_checkint(struct nrf53_rtc_dev_s *dev, uint8_t s)
+{
+ int ret = 0;
+
+ DEBUGASSERT(dev);
+
+ switch (s)
+ {
+ case NRF53_RTC_EVT_TICK:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_TICK_OFFSET);
+ break;
+ }
+
+ case NRF53_RTC_EVT_OVRFLW:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_OVRFLW_OFFSET);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE0:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(0));
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE1:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(1));
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE2:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(2));
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE3:
+ {
+ ret = nrf53_rtc_getreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(3));
+ break;
+ }
+
+ default:
+ {
+ rtcerr("ERROR: unsupported IRQ source %d\n", s);
+ ret = -EINVAL;
+ goto errout;
+ }
+ }
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_ackint
+ ****************************************************************************/
+
+static int nrf53_rtc_ackint(struct nrf53_rtc_dev_s *dev, uint8_t s)
+{
+ int ret = 0;
+
+ DEBUGASSERT(dev);
+
+ switch (s)
+ {
+ case NRF53_RTC_EVT_TICK:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_TICK_OFFSET, 0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_OVRFLW:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_OVRFLW_OFFSET, 0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE0:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(0), 0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE1:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(1), 0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE2:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(2), 0);
+ break;
+ }
+
+ case NRF53_RTC_EVT_COMPARE3:
+ {
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVENTS_COMPARE_OFFSET(3), 0);
+ break;
+ }
+
+ default:
+ {
+ rtcerr("ERROR: unsupported IRQ source %d\n", s);
+ ret = -EINVAL;
+ goto errout;
+ }
+ }
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_enableevt
+ ****************************************************************************/
+
+static int nrf53_rtc_enableevt(struct nrf53_rtc_dev_s *dev, uint8_t evt)
+{
+ uint32_t regval = 0;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ /* Get register value for given event */
+
+ regval = nrf53_rtc_evt2reg(dev, evt);
+ if (regval == 0)
+ {
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVTENSET_OFFSET, regval);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_disableevt
+ ****************************************************************************/
+
+static int nrf53_rtc_disableevt(struct nrf53_rtc_dev_s *dev, uint8_t evt)
+{
+ uint32_t regval = 0;
+ int ret = OK;
+
+ DEBUGASSERT(dev);
+
+ /* Get register value for given event */
+
+ regval = nrf53_rtc_evt2reg(dev, evt);
+ if (regval == 0)
+ {
+ ret = -EINVAL;
+ goto errout;
+ }
+
+ nrf53_rtc_putreg(dev, NRF53_RTC_EVTENCLR_OFFSET, regval);
+
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_getbase
+ ****************************************************************************/
+
+static uint32_t nrf53_rtc_getbase(struct nrf53_rtc_dev_s *dev)
+{
+ struct nrf53_rtc_priv_s *rtc = (struct nrf53_rtc_priv_s *)dev;
+ DEBUGASSERT(dev);
+
+ return rtc->base;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: nrf53_rtc_init
+ *
+ * Description:
+ * Initialize RTC device
+ *
+ ****************************************************************************/
+
+struct nrf53_rtc_dev_s *nrf53_rtc_init(int rtc)
+{
+ struct nrf53_rtc_priv_s *priv = NULL;
+
+ /* Get RTC instance */
+
+ switch (rtc)
+ {
+#ifdef CONFIG_NRF53_RTC0
+ case 0:
+ {
+ priv = &g_nrf53_rtc0_priv;
+ break;
+ }
+#endif
+
+#ifdef CONFIG_NRF53_RTC1
+ case 1:
+ {
+ priv = &g_nrf53_rtc1_priv;
+ break;
+ }
+#endif
+
+ default:
+ {
+ rtcerr("ERROR: unsupported RTC %d\n", rtc);
+ goto errout;
+ }
+ }
+
+ if (priv->inuse != false)
+ {
+ /* RTC already in use */
+
+ priv = NULL;
+ }
+
+errout:
+ return (struct nrf53_rtc_dev_s *)priv;
+}
+
+/****************************************************************************
+ * Name: nrf53_rtc_deinit
+ *
+ * Description:
+ * Deinit RTC device
+ *
+ ****************************************************************************/
+
+int nrf53_rtc_deinit(struct nrf53_rtc_dev_s *dev)
+{
+ struct nrf53_rtc_priv_s *rtc = NULL;
+
+ DEBUGASSERT(dev);
+
+ rtc = (struct nrf53_rtc_priv_s *)dev;
+
+ rtc->inuse = false;
+
+ return OK;
+}
diff --git a/arch/arm/src/nrf53/nrf53_rtc.h b/arch/arm/src/nrf53/nrf53_rtc.h
new file mode 100644
index 0000000000..b086e2972d
--- /dev/null
+++ b/arch/arm/src/nrf53/nrf53_rtc.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+ * arch/arm/src/nrf53/nrf53_rtc.h
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_ARM_SRC_NRF53_NRF53_RTC_H
+#define __ARCH_ARM_SRC_NRF53_NRF53_RTC_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Helpers ******************************************************************/
+
+#define NRF53_RTC_START(d) ((d)->ops->start(d))
+#define NRF53_RTC_STOP(d) ((d)->ops->stop(d))
+#define NRF53_RTC_CLEAR(d) ((d)->ops->clear(d))
+#define NRF53_RTC_TRGOVRFLW(d) ((d)->ops->trgovrflw(d))
+#define NRF53_RTC_GETCOUNTER(d, c) ((d)->ops->getcounter(d, c))
+#define NRF53_RTC_SETCC(d, i, cc) ((d)->ops->setcc(d, i, cc))
+#define NRF53_RTC_GETCC(d, i, cc) ((d)->ops->setcc(d, i, cc))
+#define NRF53_RTC_SETPRE(d, pre) ((d)->ops->setpre(d, pre))
+#define NRF53_RTC_SETISR(d, hnd, arg) ((d)->ops->setisr(d, hnd, arg))
+#define NRF53_RTC_ENABLEINT(d, s) ((d)->ops->enableint(d, s))
+#define NRF53_RTC_DISABLEINT(d, s) ((d)->ops->disableint(d, s))
+#define NRF53_RTC_CHECKINT(d, s) ((d)->ops->checkint(d, s))
+#define NRF53_RTC_ACKINT(d, s) ((d)->ops->ackint(d, s))
+#define NRF53_RTC_ENABLEEVT(d, s) ((d)->ops->enableevt(d, s))
+#define NRF53_RTC_DISABLEEVT(d, s) ((d)->ops->disableevt(d, s))
+#define NRF53_RTC_GETBASE(d) ((d)->ops->getbase(d))
+
+/* These are defined for direct access to registers, which is needed in some
+ * critical parts where access speed is important
+ */
+
+#define NRF53_RTC_GETCOUNTER_REG(base) (getreg32(base + NRF53_RTC_COUNTER_OFFSET))
+#define NRF53_RTC_SETCC_REG(base, ch, cc) (putreg32(cc, base + NRF53_RTC_CC_OFFSET(ch)))
+#define NRF53_RTC_GETCC_REG(base, ch) (getreg32(base + NRF53_RTC_CC_OFFSET(ch)))
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* RTC CC index */
+
+enum nrf53_rtc_cc_e
+{
+ NRF53_RTC_CC0 = 0,
+ NRF53_RTC_CC1 = 1,
+ NRF53_RTC_CC2 = 2,
+ NRF53_RTC_CC3 = 3,
+};
+
+/* RTC Interrupts/Events */
+
+enum nrf53_rtc_evt_e
+{
+ NRF53_RTC_EVT_TICK = 0,
+ NRF53_RTC_EVT_OVRFLW = 1,
+ NRF53_RTC_EVT_COMPARE0 = 2,
+ NRF53_RTC_EVT_COMPARE1 = 3,
+ NRF53_RTC_EVT_COMPARE2 = 4,
+ NRF53_RTC_EVT_COMPARE3 = 5,
+};
+
+/* NRF53 RTC device */
+
+struct nrf53_rtc_dev_s
+{
+ struct nrf53_rtc_ops_s *ops;
+};
+
+/* NRF53 RTC ops */
+
+struct nrf53_rtc_ops_s
+{
+ /* RTC tasks */
+
+ int (*start)(struct nrf53_rtc_dev_s *dev);
+ int (*stop)(struct nrf53_rtc_dev_s *dev);
+ int (*clear)(struct nrf53_rtc_dev_s *dev);
+ int (*trgovrflw)(struct nrf53_rtc_dev_s *dev);
+
+ /* RTC operations */
+
+ int (*getcounter)(struct nrf53_rtc_dev_s *dev, uint32_t *cc);
+ int (*setcc)(struct nrf53_rtc_dev_s *dev, uint8_t i, uint32_t cc);
+ int (*getcc)(struct nrf53_rtc_dev_s *dev, uint8_t i, uint32_t *cc);
+ int (*setpre)(struct nrf53_rtc_dev_s *dev, uint16_t pre);
+
+ /* RTC interrupts */
+
+ int (*setisr)(struct nrf53_rtc_dev_s *dev, xcpt_t handler, void *arg);
+ int (*enableint)(struct nrf53_rtc_dev_s *dev, uint8_t source);
+ int (*disableint)(struct nrf53_rtc_dev_s *dev, uint8_t source);
+ int (*checkint)(struct nrf53_rtc_dev_s *dev, uint8_t source);
+ int (*ackint)(struct nrf53_rtc_dev_s *dev, uint8_t source);
+
+ /* RTC events */
+
+ int (*enableevt)(struct nrf53_rtc_dev_s *dev, uint8_t evt);
+ int (*disableevt)(struct nrf53_rtc_dev_s *dev, uint8_t evt);
+
+ /* Utility */
+
+ uint32_t (*getbase)(struct nrf53_rtc_dev_s *dev);
+};
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+struct nrf53_rtc_dev_s *nrf53_rtc_init(int rtc);
+int nrf53_rtc_deinit(struct nrf53_rtc_dev_s *dev);
+
+#endif /* __ARCH_ARM_SRC_NRF53_NRF53_RTC_H */
[nuttx] 03/03: boards/nrf5340-dk: add ostest_tickless configuration
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit da47c468b8897ccaee18173512d6df523e439bc6
Author: raiden00pl <ra...@railab.me>
AuthorDate: Thu Mar 16 10:01:55 2023 +0100
boards/nrf5340-dk: add ostest_tickless configuration
---
.../configs/ostest_tickless_cpuapp/defconfig | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/boards/arm/nrf53/nrf5340-dk/configs/ostest_tickless_cpuapp/defconfig b/boards/arm/nrf53/nrf5340-dk/configs/ostest_tickless_cpuapp/defconfig
new file mode 100644
index 0000000000..9011dd5980
--- /dev/null
+++ b/boards/arm/nrf53/nrf5340-dk/configs/ostest_tickless_cpuapp/defconfig
@@ -0,0 +1,47 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_STANDARD_SERIAL is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="nrf5340-dk"
+CONFIG_ARCH_BOARD_NRF5340_DK=y
+CONFIG_ARCH_CHIP="nrf53"
+CONFIG_ARCH_CHIP_NRF5340=y
+CONFIG_ARCH_CHIP_NRF5340_CPUAPP=y
+CONFIG_ARCH_CHIP_NRF53=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARCH_STDARG_H=y
+CONFIG_BOARD_LOOPSPERMSEC=5500
+CONFIG_BUILTIN=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FS_FAT=y
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_MM_REGIONS=2
+CONFIG_NRF53_UART0=y
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=524288
+CONFIG_RAM_START=0x20000000
+CONFIG_RAW_BINARY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=26
+CONFIG_START_MONTH=3
+CONFIG_SYMTAB_ORDEREDBYNAME=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_TESTING_OSTEST=y
+CONFIG_UART0_SERIAL_CONSOLE=y