1 /***************************************************************************//**
2  * @file
3  * @brief Device initialization for HFXO.
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b>
7  *******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  ******************************************************************************/
30 #ifndef SL_DEVICE_INIT_HFXO_H
31 #define SL_DEVICE_INIT_HFXO_H
32 
33 #include "sl_status.h"
34 
35 /**
36  * @addtogroup device_init
37  * @{
38  * @addtogroup device_init_hfxo HFXO Initialization
39  * @brief Initialize the HFXO oscillator.
40  * @details
41  * Configure the HFXO for crystal or externally-generated waveform operation.
42  *
43  * When operating in crystal mode, the value of the variable tuning capacitor
44  * C<sub>tune</sub> is sourced from a prioritized list of locations:
45  *
46  * 1. Device-specific tuning value in Device Information page (factory calibrated PCB and SiP modules with integrated HFXO)
47  * 2. Device-specific tuning value in User Data page at offset 0x100 (manufacturing token `TOKEN_MFG_CTUNE`)
48  * 3. Application-specific tuning value in configuration header `sl_device_init_hfxo_config.h`
49  * 4. Default value in EMLIB initialization struct for HFXO
50  *
51  * If using Simplicity Studio, this configuration header is also configurable through the Project Configurator by selecting the
52  * "Device Init: HFXO" configuration component.
53  * @{
54  */
55 
56 /**
57  * Initialize HFXO
58  *
59  * @details
60  * Configure the HFXO for crystal or externally-generated waveform operation.
61  *
62  * When operating in crystal mode, the value of the variable tuning capacitor
63  * C<sub>tune</sub> is sourced from a prioritized list of locations:
64  *
65  * 1. Device-specific tuning value in Device Information page (PCB and SiP modules with integrated HFXO)
66  * 2. Device-specific tuning value in User Data page at offset 0x100 ("manufacturing token")
67  * 3. Application-specific tuning value in configuration header `sl_device_init_hfxo_config.h`
68  * 4. Default value in EMLIB initialization struct for HFXO
69  *
70  * @return Status code
71  * @retval SL_STATUS_OK HFXO started successfully
72  */
73 sl_status_t sl_device_init_hfxo(void);
74 
75 /**
76  * @} device_init_hfxo
77  * @} device_init
78  */
79 
80 #endif // SL_DEVICE_INIT_HFXO_H
81