From 7afcda3714ee3d5197f97dd457400cce0d4db4a0 Mon Sep 17 00:00:00 2001 From: Tahsin Mutlugun Date: Mon, 13 Jan 2025 21:30:52 +0300 Subject: [PATCH] Deprecate clock source selection from RTC driver 32K clock is shared by RTC, WUTs, timers and system so it is better be handled by the system driver. Signed-off-by: Tahsin Mutlugun --- .../PeriphDrivers/Include/MAX32657/rtc.h | 18 +----------- Libraries/PeriphDrivers/Source/RTC/rtc_me30.c | 29 +------------------ 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/Libraries/PeriphDrivers/Include/MAX32657/rtc.h b/Libraries/PeriphDrivers/Include/MAX32657/rtc.h index b7c44376df..ae4bd41dd1 100644 --- a/Libraries/PeriphDrivers/Include/MAX32657/rtc.h +++ b/Libraries/PeriphDrivers/Include/MAX32657/rtc.h @@ -5,7 +5,7 @@ /****************************************************************************** * - * Copyright (C) 2024 Analog Devices, Inc. + * Copyright (C) 2024-2025 Analog Devices, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,15 +75,6 @@ typedef enum { MXC_RTC_INT_FL_READY = MXC_F_RTC_CTRL_RDY, /**< Timer ready interrupt flag */ } mxc_rtc_int_fl_t; -/** - * @brief Clock settings - */ -typedef enum { - MXC_RTC_ERTCO_CLK = 0, - MXC_RTC_INRO_CLK = 1, - MXC_RTC_EXT_CLK = 2, -} mxc_rtc_clock_t; - /** * @brief Set Time-of-Day alarm value and enable Interrupt * @param ras 20-bit value 0-0xFFFFF @@ -99,13 +90,6 @@ int MXC_RTC_SetTimeofdayAlarm(uint32_t ras); */ int MXC_RTC_SetSubsecondAlarm(uint32_t rssa); -/** - * @brief Set the RTC clock source - * @param clk_src Clock source to use - * @retval returns Success or Fail, see \ref MXC_ERROR_CODES - */ -int MXC_RTC_SetClockSource(mxc_rtc_clock_t clk_src); - /** * @brief Start the Real Time Clock (Blocking function) * @retval returns Success or Fail, see \ref MXC_ERROR_CODES diff --git a/Libraries/PeriphDrivers/Source/RTC/rtc_me30.c b/Libraries/PeriphDrivers/Source/RTC/rtc_me30.c index 546ebf5279..0c1ee8dc6d 100644 --- a/Libraries/PeriphDrivers/Source/RTC/rtc_me30.c +++ b/Libraries/PeriphDrivers/Source/RTC/rtc_me30.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 2024 Analog Devices, Inc. + * Copyright (C) 2024-2025 Analog Devices, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,33 +65,6 @@ int MXC_RTC_SetSubsecondAlarm(uint32_t rssa) return MXC_RTC_RevA_SetSubsecondAlarm((mxc_rtc_reva_regs_t *)MXC_RTC, rssa); } -int MXC_RTC_SetClockSource(mxc_rtc_clock_t clk_src) -{ - uint8_t retval = E_NO_ERROR; - - switch (clk_src) { - case MXC_RTC_ERTCO_CLK: -#ifndef MSDK_NO_GPIO_CLK_INIT - retval = MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_ERTCO); -#endif // MSDK_NO_GPIO_CLK_INIT - MXC_SETFIELD(MXC_MCR->ctrl, MXC_F_MCR_CTRL_CLKSEL, MXC_S_MCR_CTRL_CLKSEL_ERTCO); - break; - - case MXC_RTC_INRO_CLK: - MXC_SETFIELD(MXC_MCR->ctrl, MXC_F_MCR_CTRL_CLKSEL, MXC_S_MCR_CTRL_CLKSEL_INRO_DIV4); - break; - - case MXC_RTC_EXT_CLK: - return E_NOT_SUPPORTED; - - default: - // Invalid clock source - return E_BAD_PARAM; - } - - return retval; -} - int MXC_RTC_Start(void) { return MXC_RTC_RevA_Start((mxc_rtc_reva_regs_t *)MXC_RTC);