b19a61575b89e2b6f52ec0547a8e8b3b113f4f49
[platform/upstream/connectedhomeip.git] / examples / lighting-app / efr32 / include / hal-config-app-common.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 hal-config-app-common.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 #include "em_device.h"
38 #include "hal-config-types.h"
39
40 #if defined(FEATURE_IOEXPANDER)
41 #include "hal-config-ioexp.h"
42 #endif
43
44 #define HAL_EXTFLASH_FREQUENCY (1000000)
45
46 #define HAL_PTI_ENABLE (1)
47 #define HAL_PTI_MODE (HAL_PTI_MODE_UART)
48 #define HAL_PTI_BAUD_RATE (1600000)
49
50 #define HAL_PA_RAMP (10)
51 #define HAL_PA_2P4_LOWPOWER (0)
52 #define HAL_PA_POWER (252)
53 #define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
54
55 #define HAL_PA_VOLTAGE BSP_PA_VOLTAGE
56
57 // Select antenna path on EFR32xG2x devices:
58 //   - RF2G2_IO1: 0
59 //   - RF2G2_IO2: 1
60 #define GECKO_RF_ANTENNA 1
61 #if defined(FEATURE_EXP_HEADER_USART3)
62
63 #define BSP_EXP_USART USART3
64
65 #define BSP_EXP_USART_CTS_PIN BSP_USART3_CTS_PIN
66 #define BSP_EXP_USART_CTS_PORT BSP_USART3_CTS_PORT
67 #define BSP_EXP_USART_CTS_LOC BSP_USART3_CTS_LOC
68
69 #define BSP_EXP_USART_RTS_PIN BSP_USART3_RTS_PIN
70 #define BSP_EXP_USART_RTS_PORT BSP_USART3_RTS_PORT
71 #define BSP_EXP_USART_RTS_LOC BSP_USART3_RTS_LOC
72
73 #define BSP_EXP_USART_RX_PIN BSP_USART3_RX_PIN
74 #define BSP_EXP_USART_RX_PORT BSP_USART3_RX_PORT
75 #define BSP_EXP_USART_RX_LOC BSP_USART3_RX_LOC
76
77 #define BSP_EXP_USART_TX_PIN BSP_USART3_TX_PIN
78 #define BSP_EXP_USART_TX_PORT BSP_USART3_TX_PORT
79 #define BSP_EXP_USART_TX_LOC BSP_USART3_TX_LOC
80
81 #elif defined(FEATURE_EXP_HEADER_USART1)
82
83 #define BSP_EXP_USART USART1
84
85 #define BSP_EXP_USART_CTS_PIN BSP_USART1_CTS_PIN
86 #define BSP_EXP_USART_CTS_PORT BSP_USART1_CTS_PORT
87 #define BSP_EXP_USART_CTS_LOC BSP_USART1_CTS_LOC
88
89 #define BSP_EXP_USART_RTS_PIN BSP_USART1_RTS_PIN
90 #define BSP_EXP_USART_RTS_PORT BSP_USART1_RTS_PORT
91 #define BSP_EXP_USART_RTS_LOC BSP_USART1_RTS_LOC
92
93 #define BSP_EXP_USART_RX_PIN BSP_USART1_RX_PIN
94 #define BSP_EXP_USART_RX_PORT BSP_USART1_RX_PORT
95 #define BSP_EXP_USART_RX_LOC BSP_USART1_RX_LOC
96
97 #define BSP_EXP_USART_TX_PIN BSP_USART1_TX_PIN
98 #define BSP_EXP_USART_TX_PORT BSP_USART1_TX_PORT
99 #define BSP_EXP_USART_TX_LOC BSP_USART1_TX_LOC
100
101 #else
102
103 #define BSP_EXP_USART USART0
104
105 #define BSP_EXP_USART_CTS_PIN BSP_USART0_CTS_PIN
106 #define BSP_EXP_USART_CTS_PORT BSP_USART0_CTS_PORT
107 #define BSP_EXP_USART_CTS_LOC BSP_USART0_CTS_LOC
108
109 #define BSP_EXP_USART_RTS_PIN BSP_USART0_RTS_PIN
110 #define BSP_EXP_USART_RTS_PORT BSP_USART0_RTS_PORT
111 #define BSP_EXP_USART_RTS_LOC BSP_USART0_RTS_LOC
112
113 #define BSP_EXP_USART_RX_PIN BSP_USART0_RX_PIN
114 #define BSP_EXP_USART_RX_PORT BSP_USART0_RX_PORT
115 #define BSP_EXP_USART_RX_LOC BSP_USART0_RX_LOC
116
117 #define BSP_EXP_USART_TX_PIN BSP_USART0_TX_PIN
118 #define BSP_EXP_USART_TX_PORT BSP_USART0_TX_PORT
119 #define BSP_EXP_USART_TX_LOC BSP_USART0_TX_LOC
120
121 #endif // FEATURE_EXP_HEADER_USART3