mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-02-06 12:22:00 -05:00
* Switching VDD_SOC_IN only after PLL2 is turned off. * Weak LDO stabilization delay. * Removed switching to 1.275V before frequency change. * Cleanups in LDO switching. * Removed switching PeriphClk2Div for fCPU <= 24MHz, using AhbDiv instead. * Removed log from _exit that caused logger mutex deadlock
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "RT1051DriverSEMC.hpp"
|
|
#include "critical.hpp"
|
|
#include "board/clock_config.h"
|
|
|
|
namespace drivers
|
|
{
|
|
|
|
RT1051DriverSEMC::RT1051DriverSEMC(std::string name) : DriverSEMC(std::move(name))
|
|
{
|
|
SwitchToPLL2ClockSource();
|
|
}
|
|
|
|
void RT1051DriverSEMC::Enable()
|
|
{}
|
|
|
|
void RT1051DriverSEMC::Disable()
|
|
{}
|
|
|
|
void RT1051DriverSEMC::SwitchToPLL2ClockSource()
|
|
{
|
|
cpp_freertos::CriticalSection::Enter();
|
|
if (pll2Driver == nullptr) {
|
|
pll2Driver = std::make_shared<RT1051DriverPLL2>();
|
|
}
|
|
CLOCK_SetMux(kCLOCK_SemcMux, SemcMuxPLL2Clock);
|
|
cpp_freertos::CriticalSection::Exit();
|
|
}
|
|
|
|
void RT1051DriverSEMC::SwitchToPeripheralClockSource()
|
|
{
|
|
cpp_freertos::CriticalSection::Enter();
|
|
CLOCK_SetMux(kCLOCK_SemcMux, SemcMuxPeripheralClock);
|
|
pll2Driver.reset();
|
|
cpp_freertos::CriticalSection::Exit();
|
|
}
|
|
|
|
} // namespace drivers
|