18f1bfe526ca68231755384e59d17d8f7b94a566
[platform/upstream/connectedhomeip.git] / examples / platform / efr32 / init_mcu.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    All rights reserved.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18 /*******************************************************************************
19  * @file
20  * @brief init_mcu.h
21  *******************************************************************************
22  * # License
23  * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
24  *******************************************************************************
25  *
26  * The licensor of this software is Silicon Laboratories Inc. Your use of this
27  * software is governed by the terms of Silicon Labs Master Software License
28  * Agreement (MSLA) available at
29  * www.silabs.com/about-us/legal/master-software-license-agreement. This
30  * software is distributed to you in Source Code format and is governed by the
31  * sections of the MSLA applicable to Source Code.
32  *
33  ******************************************************************************/
34
35 #pragma once
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include "board_features.h"
42 #include "hal-config-board.h"
43
44 /*
45  * If Studio is allowed to use the CTUNE value from EEPROM on Silicon Labs radio board,
46  * it will store it in the User page memory on the MFG_CTUNE_ADDR address.
47  * If not, for example user already storing a value there, then the MFG_CTUNE_EN
48  * must be set to 0, to avoid wrong value to be read out.
49  * Studio can only read out the CTUNE value from the EEPROM if that is a
50  * Silicon Labs radio board.
51  * Please verify that CTUNE value is stored at the MFG_CTUNE_ADDR of
52  * the User page, if want to overwrite the default MFG_CTUNE_EN define
53  * for self use on custom boards.
54  */
55
56 // This is a Silicon Labs radio board, the CTUNE value can be read out from EEPROM
57 #define MFG_CTUNE_EN 1
58
59 // Address for CTUNE in User page
60 #define MFG_CTUNE_ADDR 0x0FE00100UL
61 // Value of the CTUNE in User page
62 #define MFG_CTUNE_VAL (*((uint16_t *) (MFG_CTUNE_ADDR)))
63
64 void initMcu(void);
65
66 void initOtSysEFR(void);
67
68 #ifdef __cplusplus
69 }
70 #endif