-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_board.c
50 lines (44 loc) · 1.45 KB
/
init_board.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***************************************************************************//**
* @file init_board.c
*******************************************************************************
* # License
* <b>Copyright 2017 Silicon Labs, Inc. http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#if defined(HAL_CONFIG)
#include "bsphalconfig.h"
#include "hal-config.h"
#else
#include "bspconfig.h"
#endif
#include "board_features.h"
#include "em_cmu.h"
#include "em_usart.h"
#include "mx25flash_spi.h"
#include "bsp.h"
void initBoard(void)
{
// Enable clock for CRYOTIMER
CMU_ClockEnable(cmuClock_CRYOTIMER, true);
// Enable clock for PRS
CMU_ClockEnable(cmuClock_PRS, true);
#ifdef FEATURE_EXP_HEADER_USART3
// Enable clock for USART3
CMU_ClockEnable(cmuClock_USART3, true);
#else
// Enable clock for USART0
CMU_ClockEnable(cmuClock_USART0, true);
#endif
// Enable GPIO clock source
CMU_ClockEnable(cmuClock_GPIO, true);
// Put the SPI flash into Deep Power Down mode for those radio boards where it is available
MX25_init();
MX25_DP();
// We must disable SPI communication
USART_Reset(MX25_USART);
}