/***************************************************************************//**
* @file
* @brief Clock Manager - Oscillators configuration file.
*******************************************************************************
* # License
* Copyright 2024 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
#ifndef SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H
#define SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H
#if defined(SL_COMPONENT_CATALOG_PRESENT)
#include "sl_component_catalog.h"
#endif
// Internal Defines: DO NOT MODIFY
#define SL_CLOCK_MANAGER_HFXO_EN_ENABLE 1
#define SL_CLOCK_MANAGER_HFXO_EN_DISABLE 0
#if defined(SL_CATALOG_RAIL_LIB_PRESENT)
#define SL_CLOCK_MANAGER_HFXO_EN_AUTO SL_CLOCK_MANAGER_HFXO_EN_ENABLE
#else
#define SL_CLOCK_MANAGER_HFXO_EN_AUTO SL_CLOCK_MANAGER_HFXO_EN_DISABLE
#endif
// <<< Use Configuration Wizard in Context Menu >>>
// Oscillators Settings
// HFXO Settings (if High Frequency crystal is used)
// Enable
// Enable to configure HFXO
// AUTO enables HFXO if a radio is used
// AUTO
// ENABLE
// DISABLE
// SL_CLOCK_MANAGER_HFXO_EN_AUTO
#ifndef SL_CLOCK_MANAGER_HFXO_EN
#define SL_CLOCK_MANAGER_HFXO_EN SL_CLOCK_MANAGER_HFXO_EN_ENABLE
#endif
// Mode
//
// XTAL
// EXTCLK
// EXTCLKPKDET
// HFXO_CFG_MODE_XTAL
#ifndef SL_CLOCK_MANAGER_HFXO_MODE
#define SL_CLOCK_MANAGER_HFXO_MODE HFXO_CFG_MODE_XTAL
#endif
// Frequency in Hz <38000000-40000000>
// 39000000
#ifndef SL_CLOCK_MANAGER_HFXO_FREQ
#define SL_CLOCK_MANAGER_HFXO_FREQ 39000000
#endif
// CTUNE <0-255>
// 140
#ifndef SL_CLOCK_MANAGER_HFXO_CTUNE
#define SL_CLOCK_MANAGER_HFXO_CTUNE 140
#endif
// Precision in PPM <0-65535>
// 50
#ifndef SL_CLOCK_MANAGER_HFXO_PRECISION
#define SL_CLOCK_MANAGER_HFXO_PRECISION 50
#endif
// CTUNE HXFO manufacturing
// Enable to use CTUNE HFXO manufacturing value for calibration
// 1
#ifndef SL_CLOCK_MANAGER_CTUNE_MFG_HFXO_EN
#define SL_CLOCK_MANAGER_CTUNE_MFG_HFXO_EN 1
#endif
// HFXO crystal sharing feature
// Enable to configure HFXO crystal sharing leader or follower
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_EN 0
#endif
// Crystal sharing leader
// Enable to configure HFXO crystal sharing leader
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN 0
#endif
// Crystal sharing leader minimum startup delay
// If enabled, BUFOUT does not start until timeout set in
// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP expires.
// This prevents waste of power if BUFOUT is ready too early.
// 1
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_MIN_STARTUP_DELAY_EN 1
#endif
// Wait duration of oscillator startup sequence
//
// T42US
// T83US
// T108US
// T133US
// T158US
// T183US
// T208US
// T233US
// T258US
// T283US
// T333US
// T375US
// T417US
// T458US
// T500US
// T667US
// HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_TIMEOUT_STARTUP HFXO_BUFOUTCTRL_TIMEOUTSTARTUP_T208US
#endif
//
//
// Crystal sharing follower
// Enable to configure HFXO crystal sharing follower
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN 0
#endif
//
// GPIO Port
// Bufout request GPIO port. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN
// is enabled, this port will be used to receive the BUFOUT request. If
// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this port
// will be used to request BUFOUT from the crystal sharing leader.
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PORT 0
#endif
// GPIO Pin
// Bufout request GPIO pin. If SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_LEADER_EN
// is enabled, this pin will be used to receive the BUFOUT request. If
// SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_FOLLOWER_EN is enabled this pin
// will be used to request BUFOUT from the crystal sharing leader.
#ifndef SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN
#define SL_CLOCK_MANAGER_HFXO_CRYSTAL_SHARING_GPIO_PIN 10
#endif
//
//
// LFXO Settings (if Low Frequency crystal is used)
// Enable to configure LFXO
#ifndef SL_CLOCK_MANAGER_LFXO_EN
#define SL_CLOCK_MANAGER_LFXO_EN 1
#endif
// Mode
//
// XTAL
// BUFEXTCLK
// DIGEXTCLK
// LFXO_CFG_MODE_XTAL
#ifndef SL_CLOCK_MANAGER_LFXO_MODE
#define SL_CLOCK_MANAGER_LFXO_MODE LFXO_CFG_MODE_XTAL
#endif
// CTUNE <0-127>
// 63
#ifndef SL_CLOCK_MANAGER_LFXO_CTUNE
#define SL_CLOCK_MANAGER_LFXO_CTUNE 63
#endif
// LFXO precision in PPM <0-65535>
// 50
#ifndef SL_CLOCK_MANAGER_LFXO_PRECISION
#define SL_CLOCK_MANAGER_LFXO_PRECISION 50
#endif
// Startup Timeout Delay
//
// CYCLES2
// CYCLES256
// CYCLES1K
// CYCLES2K
// CYCLES4K
// CYCLES8K
// CYCLES16K
// CYCLES32K
// LFXO_CFG_TIMEOUT_CYCLES4K
#ifndef SL_CLOCK_MANAGER_LFXO_TIMEOUT
#define SL_CLOCK_MANAGER_LFXO_TIMEOUT LFXO_CFG_TIMEOUT_CYCLES4K
#endif
// CTUNE LXFO manufacturing
// Enable to use CTUNE LFXO manufacturing value for calibration
// 1
#ifndef SL_CLOCK_MANAGER_CTUNE_MFG_LFXO_EN
#define SL_CLOCK_MANAGER_CTUNE_MFG_LFXO_EN 1
#endif
//
// HFRCO and DPLL Settings
// Frequency Band
// RC Oscillator Frequency Band
// 1 MHz
// 2 MHz
// 4 MHz
// 7 MHz
// 13 MHz
// 16 MHz
// 19 MHz
// 26 MHz
// 32 MHz
// 38 MHz
// 48 MHz
// 56 MHz
// 64 MHz
// 80 MHz
// cmuHFRCODPLLFreq_80M0Hz
#ifndef SL_CLOCK_MANAGER_HFRCO_BAND
#define SL_CLOCK_MANAGER_HFRCO_BAND cmuHFRCODPLLFreq_80M0Hz
#endif
// Use DPLL
// Enable to use the DPLL with HFRCO
#ifndef SL_CLOCK_MANAGER_HFRCO_DPLL_EN
#define SL_CLOCK_MANAGER_HFRCO_DPLL_EN 0
#endif
// Target Frequency in Hz <1000000-80000000>
// DPLL target frequency
// 78000000
#ifndef SL_CLOCK_MANAGER_DPLL_FREQ
#define SL_CLOCK_MANAGER_DPLL_FREQ 78000000
#endif
// Numerator (N) <300-4095>
// Value of N for output frequency calculation fout = fref * (N+1) / (M+1)
// 3839
#ifndef SL_CLOCK_MANAGER_DPLL_N
#define SL_CLOCK_MANAGER_DPLL_N 3839
#endif
// Denominator (M) <0-4095>
// Value of M for output frequency calculation fout = fref * (N+1) / (M+1)
// 1919
#ifndef SL_CLOCK_MANAGER_DPLL_M
#define SL_CLOCK_MANAGER_DPLL_M 1919
#endif
// Reference Clock
// Reference clock source for DPLL
// DISABLED
// HFXO
// LFXO
// CLKIN0
// CMU_DPLLREFCLKCTRL_CLKSEL_HFXO
#ifndef SL_CLOCK_MANAGER_DPLL_REFCLK
#define SL_CLOCK_MANAGER_DPLL_REFCLK CMU_DPLLREFCLKCTRL_CLKSEL_HFXO
#endif
// Reference Clock Edge Detect
// Edge detection for reference clock
// Falling Edge
// Rising Edge
// cmuDPLLEdgeSel_Fall
#ifndef SL_CLOCK_MANAGER_DPLL_EDGE
#define SL_CLOCK_MANAGER_DPLL_EDGE cmuDPLLEdgeSel_Fall
#endif
// DPLL Lock Mode
// Lock mode
// Frequency-Lock Loop
// Phase-Lock Loop
// cmuDPLLLockMode_Freq
#ifndef SL_CLOCK_MANAGER_DPLL_LOCKMODE
#define SL_CLOCK_MANAGER_DPLL_LOCKMODE cmuDPLLLockMode_Phase
#endif
// Automatic Lock Recovery
// 1
#ifndef SL_CLOCK_MANAGER_DPLL_AUTORECOVER
#define SL_CLOCK_MANAGER_DPLL_AUTORECOVER 1
#endif
// Enable Dither
// 0
#ifndef SL_CLOCK_MANAGER_DPLL_DITHER
#define SL_CLOCK_MANAGER_DPLL_DITHER 0
#endif
//
//
// HFRCOEM23 Settings
// Frequency Band
// RC Oscillator Frequency Band
// 1 MHz
// 2 MHz
// 4 MHz
// 13 MHz
// 16 MHz
// 19 MHz
// 26 MHz
// 32 MHz
// 40 MHz
// cmuHFRCOEM23Freq_19M0Hz
#ifndef SL_CLOCK_MANAGER_HFRCOEM23_BAND
#define SL_CLOCK_MANAGER_HFRCOEM23_BAND cmuHFRCOEM23Freq_19M0Hz
#endif
//
// LFRCO Settings
// Precision Mode
// Precision mode uses hardware to automatically re-calibrate the LFRCO
// against a crystal driven by the HFXO. Hardware detects temperature
// changes and initiates a re-calibration of the LFRCO as needed when
// operating in EM0, EM1, or EM2. If a re-calibration is necessary and the
// HFXO is not active, the precision mode hardware will automatically
// enable HFXO for a short time to perform the calibration. EM4 operation is
// not allowed while precision mode is enabled.
// If high precision is selected on devices that do not support it, default
// precision will be used.
// Default precision
// High precision
// cmuPrecisionDefault
#ifndef SL_CLOCK_MANAGER_LFRCO_PRECISION
#define SL_CLOCK_MANAGER_LFRCO_PRECISION cmuPrecisionDefault
#endif
//
// CLKIN0 Settings
// Frequency in Hz <1000000-38000000>
// 38000000
#ifndef SL_CLOCK_MANAGER_CLKIN0_FREQ
#define SL_CLOCK_MANAGER_CLKIN0_FREQ 38000000
#endif
//
//
// <<< end of configuration section >>>
// <<< sl:start pin_tool >>>
// SL_CLOCK_MANAGER_CLKIN0
// $[CMU_SL_CLOCK_MANAGER_CLKIN0]
// [CMU_SL_CLOCK_MANAGER_CLKIN0]$
// <<< sl:end pin_tool >>>
#endif /* SL_CLOCK_MANAGER_OSCILLATOR_CONFIG_H */