1. Update nxp irtc driver to fix issue in init and alarm function.
2. Update RTC device tree binding to support "share-counter".
3. Update RT700 dtsi to support rtc0 for cpu0 and rtc1 for cpu1.
4. Update readme.
5. Update unit test project conf for RT700.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Change backup domain access gating in STM32 RTC interrupt handler
to only request access when RTC registers ar to be modified
instead of during the whole RTC interrupts service including
interrupt consumer callback execution.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Fix the backup domain access request in STM32 RTC initialization that
was unbalanced in case of clock configuration failure.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
The basic characteristics of "atmel,sam-rtc" is the same as the ones
of sama7g5.
Differences between the RTCs listed bellow:
| atmel,sam-rtc | rtc in sama7g5
--------------------|---------------|----------------------
Persian calendar | Y | N
UTC Mode support | N | Y
Tamper Timestamping | N | Y
Signed-off-by: Tony Han <tony.han@microchip.com>
Use recently added SoCs functions to request access to SoC backup
domain resources These function use a reference counter to track these
request and ensure the resources are accessible as long as at least a
consumer requires access.
By the way, move inclusion of stm32_hsem.h header file after inclusion
of the LL header files and Zephyr header standard files.
Fixes issue 90942.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
While getting alarm time, BIT(7) of each register is checked if it is
set, which send the alarm time as 0 to the requestor. Fix it by checking
if the BIT(7) of each register is not set.
Signed-off-by: Thiyagarajan Pandiyan <psvthiyagarajan@gmail.com>
alarm flags only need to be cleared if PORF flag is set; otherwise,
the RTC is already running and alarm flags must not be cleared
Signed-off-by: Vixay Phimmasane <visuphi@gmail.com>
- Define alarm_set_callback() only when CONFIG_RTC_ALARM is set otherwise
a warning will be generated at runtime for the function not being
used.
- add "static" keyword to all internal functions.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
clean up usage of select USE_STM32_LL_RCC and
select USE_STM32_LL_PWR from Kconfig.stm32
this modifications due to the include unconditionally of
stm32xxxx_ll_rcc.h and stm32xxxx_ll_pwr.h in HAL.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
RTC alarm is not supported by the driver for now due to the complexity it
would take to work around an hardware erratum. However, it is not possible
to prevent CONFIG_RTC_ALARM from being enabled at Kconfig level.
Modify the RTC driver such that enabling CONFIG_RTC_ALARM on STM32WB0
series does not cause build errors anymore.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
The day alarm was not being set correctly. The day alarm should be set
using the WADA bit in the control register. This patch fixes the issue
by setting the WADA bit in the control register when setting the day alarm.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
This PR adds support for Maxim Integrated
DS1337 RTC chip.
Supported functionalities:
* Alarm interrupt (both alarms trigger INTA pin)
* Time setting/reading
* Both alarms setting/reading
* SQW frequency configuration
Tested on nRF52833-DK using rtc_api test set.
Signed-off-by: Marcin Lyda <elektromarcin@gmail.com>
Because of wrong integer type syntax following error occurred:
drivers/rtc/rtc_ds3231.c:361:76: error: unknown type name 'u'
361 | static int rtc_ds3231_alarm_get_supported_fields(
| const struct device *dev, u int16_t id,
| ^
Signed-off-by: Stephan Linz <linz@li-pro.net>
Compile warnings occurred in common standard use case
w/o RTC alarm and update.
Warning was:
drivers/rtc/rtc_ds3231.c: In function 'rtc_ds3231_init':
drivers/rtc/rtc_ds3231.c:808:33: warning: unused variable 'data'
[-Wunused-variable]
808 | struct rtc_ds3231_data *data = dev->data;
| ^~~~
drivers/rtc/rtc_ds3231.c: At top level:
drivers/rtc/rtc_ds3231.c:195:12:
warning: 'rtc_ds3231_get_ctrl_sts' defined but not used
[-Wunused-function]
195 | static int rtc_ds3231_get_ctrl_sts(const struct device *dev,
| uint8_t *buf)
| ^~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Stephan Linz <linz@li-pro.net>
This commit introduces a driver for the Epson RX8130CE rtc.
The driver provides the following functionalities:
- Time setting and retrieval
- Periodic update interrupt support (1Hz)
- Alarm setting and retrieval (minute, hour, day)
- Frequency output control (32.768kHz, 1.024kHz, 1Hz, off)
- Power management (automatic power switching & battery charging)
- Calibration setting and retrieval
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
This PR adds support for BQ32002 RTC chip.
Supported functionalities:
* Time setting/reading
* Alarm setting/reading
* Calibration setting/reading
* IRQ frequency configuration
Tested on nRF52833-DK board.
Signed-off-by: Marcin Lyda <elektromarcin@gmail.com>
This PR fixes the issue that building the driver with either
CONFIG_RTC_CALIBRATION=y or CONFIG_RTC_ALARM=y and without
'int-gpios' used will cause
'undefined reference to `rv8803_write_reg8'' error.
Signed-off-by: Marcin Lyda <elektromarcin@gmail.com>
This is a squash of all the groundwork needed to
get a functioning driver for the DS3231 with the RTC API.
Signed-off-by: Gergo Vari <work@gergovari.com>
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
The #64939 introduced a few convenience function like
rtc_utils_validate_rtc_time. However the PR did not replace all
occurrences which result on a build error. This add the missing
header include to remove a building warning and replace the old
function by the new one.
Fixes#81454
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
We read/modify/write the CH/SECONDS register at initialisation to clear
only the Clock Halt bit and only if it is set.
The previous implementation zeroes the entire register unconditionally at
initialisation, which wipes the SECONDS fields.
Fixes#77354.
Signed-off-by: Andrew Feldhaus <github@feldhaus.co.uk>
- Fix typos for alarm field identification
- Fix a bug where an alarm interrupt starts
update interrupts
- Rework interrupt code to reduce code size
and complexity
Signed-off-by: Daniel Kampert <danielkampert@kampis-elektroecke.de>
Added NXP IRTC Driver support and binding.
This driver is expected for users needing
Time Date info in their application.
The driver additionally has an alarm mode that
can be enabled to fire an intterupt when the time
and alarm values match.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Adds support for settings/getting RTC time and using alarm/update feature.
The alarm option needs all fields to be set due to a hardware limitation.
RTC shares the same interrupt with the watchdog. Thus shared
interrupts must be enabled when WDT and RTC both need to trigger the ISR.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Add support for HSE as the RTC clock source.
The initial implementation has the following limitations:
- Only whole MHz HSE frequency is supported, e.g. 24.5 MHz will generate a
compile error.
- Frequencies equal or above 64 MHz are not supported and will generate a
compile error.
The implementation has been tested on nucleo_h563zi with:
- 8 MHz (via hse-bypass)
- 25 MHz (via external crystal)
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
1. tm_mon in rtc_time structure has a range [0, 11],
while the RTC expects [1, 12]. Add missing
increasing / decreasing of this value.
2. Fix typo in debug log
Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>