3 * Copyright (c) 2020 Project CHIP Authors
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 /*******************************************************************************
21 *******************************************************************************
23 * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
24 *******************************************************************************
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.
33 ******************************************************************************/
35 #if defined(HAL_CONFIG)
36 #include "bsphalconfig.h"
37 #include "hal-config.h"
39 #include "bspconfig.h"
42 #include "board_features.h"
48 #include "mx25flash_spi.h"
50 #include "fem-control.h"
57 // Enable clock for CRYOTIMER
58 CMU_ClockEnable(cmuClock_CRYOTIMER, true);
59 #if ((HAL_VCOM_ENABLE == 1) || (HAL_USART3_ENABLE == 1) || (HAL_USART1_ENABLE == 1) || (HAL_USART0_ENABLE == 1))
60 #if defined(FEATURE_EXP_HEADER_USART3)
61 // Enable clock for USART3
62 CMU_ClockEnable(cmuClock_USART3, true);
63 #elif defined(FEATURE_EXP_HEADER_USART1)
64 // Enable clock for USART1
65 CMU_ClockEnable(cmuClock_USART1, true);
67 // Enable clock for USART0
68 CMU_ClockEnable(cmuClock_USART0, true);
70 #endif //(HAL_VCOM_ENABLE == 1)
71 #if ((HAL_I2CSENSOR_ENABLE == 1) || (HAL_VCOM_ENABLE == 1) || (HAL_SPIDISPLAY_ENABLE == 1) || (HAL_USART3_ENABLE == 1) || \
72 (HAL_USART1_ENABLE == 1) || (HAL_USART0_ENABLE == 1))
73 // Enable clock for PRS
74 CMU_ClockEnable(cmuClock_PRS, true);
75 // Enable GPIO clock source
76 CMU_ClockEnable(cmuClock_GPIO, true);
77 #endif /* ((HAL_I2CSENSOR_ENABLE == 1) \
78 || (HAL_VCOM_ENABLE == 1) \
79 || (HAL_SPIDISPLAY_ENABLE == 1) \
80 || (HAL_USART3_ENABLE == 1) \
81 || (HAL_USART1_ENABLE == 1) \
82 || (HAL_USART0_ENABLE == 1)) */
84 // Put the SPI flash into Deep Power Down mode for those radio boards where it is available
87 // We must disable SPI communication
94 void initVcomEnable(void)
96 #if defined(HAL_VCOM_ENABLE)
97 // Enable VCOM if requested
98 GPIO_PinModeSet(BSP_VCOM_ENABLE_PORT, BSP_VCOM_ENABLE_PIN, gpioModePushPull, HAL_VCOM_ENABLE);
99 #endif // HAL_VCOM_ENABLE