1 /***************************************************************************//** 2 * @file 3 * @brief Default PA power conversion structures with curves calibrated by the 4 * RAIL team. 5 * @details This file contains the curves that convert PA power levels to dBm 6 * powers. 7 ******************************************************************************* 8 * # License 9 * <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b> 10 ******************************************************************************* 11 * 12 * SPDX-License-Identifier: Zlib 13 * 14 * The licensor of this software is Silicon Laboratories Inc. 15 * 16 * This software is provided 'as-is', without any express or implied 17 * warranty. In no event will the authors be held liable for any damages 18 * arising from the use of this software. 19 * 20 * Permission is granted to anyone to use this software for any purpose, 21 * including commercial applications, and to alter it and redistribute it 22 * freely, subject to the following restrictions: 23 * 24 * 1. The origin of this software must not be misrepresented; you must not 25 * claim that you wrote the original software. If you use this software 26 * in a product, an acknowledgment in the product documentation would be 27 * appreciated but is not required. 28 * 2. Altered source versions must be plainly marked as such, and must not be 29 * misrepresented as being the original software. 30 * 3. This notice may not be removed or altered from any source distribution. 31 * 32 ******************************************************************************/ 33 34 // This entire file should never be used on FCC pre-certified modules 35 #ifndef _SILICON_LABS_MODULE 36 37 #include "em_device.h" 38 #include "pa_conversions_efr32.h" 39 40 #if defined(_SILICON_LABS_32B_SERIES_1) 41 42 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHpVbat = { 43 RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, 44 RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, 45 RAIL_PA_CURVES_2P4_HP_VBAT_CURVES 46 }; 47 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataSgVbat = { 48 RAIL_PA_CURVES_SG_VBAT_MAX_POWER, 49 RAIL_PA_CURVES_SG_VBAT_MIN_POWER, 50 RAIL_PA_CURVES_SG_VBAT_CURVES 51 }; 52 static const int16_t RAIL_curves24LpVbat[RAIL_PA_CURVES_LP_VALUES] = 53 RAIL_PA_CURVES_2P4_LP; 54 55 // This macro is defined when Silicon Labs builds this into the library as WEAK 56 // to ensure it can be overriden by customer versions of these functions. It 57 // should *not* be defined in a customer build. 58 #ifdef RAIL_PA_CONVERSIONS_WEAK 59 __WEAK 60 #endif 61 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = { 62 .curves = { 63 { 64 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 65 .segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, 66 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 67 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 68 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 69 }, 70 { 71 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, 72 .segments = 0U, 73 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, 74 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, 75 .conversion = { .mappingTable = &RAIL_curves24LpVbat[0] }, 76 }, 77 { 78 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 79 .segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, 80 .min = RAIL_TX_POWER_LEVEL_SUBGIG_MIN, 81 .max = RAIL_TX_POWER_LEVEL_SUBGIG_HP_MAX, 82 .conversion = { .powerCurve = &RAIL_piecewiseDataSgVbat }, 83 }, 84 }, 85 }; 86 87 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHpDcdc = { 88 RAIL_PA_CURVES_2P4_HP_DCDC_MAX_POWER, 89 RAIL_PA_CURVES_2P4_HP_DCDC_MIN_POWER, 90 RAIL_PA_CURVES_2P4_HP_DCDC_CURVES 91 }; 92 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataSgDcdc = { 93 RAIL_PA_CURVES_SG_DCDC_MAX_POWER, 94 RAIL_PA_CURVES_SG_DCDC_MIN_POWER, 95 RAIL_PA_CURVES_SG_DCDC_CURVES 96 }; 97 static const int16_t RAIL_curves24LpDcdc[RAIL_PA_CURVES_LP_VALUES] = 98 RAIL_PA_CURVES_2P4_LP; 99 100 #ifdef RAIL_PA_CONVERSIONS_WEAK 101 __WEAK 102 #endif 103 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = { 104 .curves = { 105 { 106 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 107 .segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, 108 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 109 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 110 .conversion = { .powerCurve = &RAIL_piecewiseDataHpDcdc }, 111 }, 112 { 113 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, 114 .segments = 0U, 115 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, 116 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, 117 .conversion = { .mappingTable = &RAIL_curves24LpDcdc[0] }, 118 }, 119 { 120 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 121 .segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, 122 .min = RAIL_TX_POWER_LEVEL_SUBGIG_MIN, 123 .max = RAIL_TX_POWER_LEVEL_SUBGIG_HP_MAX, 124 .conversion = { .powerCurve = &RAIL_piecewiseDataSgDcdc }, 125 }, 126 }, 127 }; 128 129 #elif ((_SILICON_LABS_32B_SERIES_2_CONFIG == 2) || (_SILICON_LABS_32B_SERIES_2_CONFIG == 7)) 130 131 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHpVbat = { 132 RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, 133 RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, 134 RAIL_PA_CURVES_2P4_HP_VBAT_CURVES, 135 }; 136 static const int16_t RAIL_curves24Lp[RAIL_PA_CURVES_LP_VALUES] = 137 RAIL_PA_CURVES_2P4_LP_VBAT_CURVES; 138 139 #ifdef RAIL_PA_CONVERSIONS_WEAK 140 __WEAK 141 #endif 142 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = { 143 .curves = { 144 { 145 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 146 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 147 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 148 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 149 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 150 }, 151 { \ 152 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, \ 153 .segments = 0U, \ 154 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, \ 155 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, \ 156 .conversion = { .mappingTable = &RAIL_curves24Lp[0] }, \ 157 }, 158 } 159 }; 160 161 #ifdef RAIL_PA_CONVERSIONS_WEAK 162 __WEAK 163 #endif 164 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = { 165 .curves = { 166 { 167 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 168 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 169 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 170 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 171 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 172 }, 173 { \ 174 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, \ 175 .segments = 0U, \ 176 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, \ 177 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, \ 178 .conversion = { .mappingTable = &RAIL_curves24Lp[0] }, \ 179 }, 180 } 181 }; 182 183 #elif ((_SILICON_LABS_32B_SERIES_2_CONFIG == 3) || (_SILICON_LABS_32B_SERIES_2_CONFIG == 8)) 184 185 RAIL_DECLARE_TX_POWER_VBAT_CURVES_ALT; 186 187 // This chip has the same curve for Vbat and DCDC 188 #ifdef RAIL_PA_CONVERSIONS_WEAK 189 __WEAK 190 #endif 191 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = RAIL_DECLARE_TX_POWER_CURVES_CONFIG_ALT; 192 193 #ifdef RAIL_PA_CONVERSIONS_WEAK 194 __WEAK 195 #endif 196 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = RAIL_DECLARE_TX_POWER_CURVES_CONFIG_ALT; 197 198 #elif defined(_SILICON_LABS_32B_SERIES_2_CONFIG_5) 199 200 static const int32_t RAIL_curvesOFDM[RAIL_PA_CURVES_OFDM_CURVES_NUM_VALUES] = 201 RAIL_PA_CURVES_OFDM_CURVES; 202 203 static const int32_t RAIL_curvesEffOFDM[RAIL_PA_CURVES_EFF_OFDM_CURVES_NUM_VALUES] = 204 RAIL_PA_CURVES_EFF_OFDM_CURVES; 205 206 static const int32_t RAIL_curvesSubgig[RAIL_PA_CURVES_SUBGIG_CURVES_NUM_VALUES] = 207 RAIL_PA_CURVES_SUBGIG_CURVES; 208 209 static const int32_t RAIL_curvesEffSubgig[RAIL_PA_CURVES_EFF_SUBGIG_CURVES_NUM_VALUES] = 210 RAIL_PA_CURVES_EFF_SUBGIG_CURVES; 211 212 RAIL_DECLARE_TX_POWER_VBAT_CURVES_ALT; 213 214 // This chip has the same curve for Vbat and DCDC 215 #ifdef RAIL_PA_CONVERSIONS_WEAK 216 __WEAK 217 #endif 218 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = RAIL_DECLARE_TX_POWER_CURVES_CONFIG_ALT; 219 220 #ifdef RAIL_PA_CONVERSIONS_WEAK 221 __WEAK 222 #endif 223 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = RAIL_DECLARE_TX_POWER_CURVES_CONFIG_ALT; 224 225 #elif defined(_SILICON_LABS_32B_SERIES_2_CONFIG_1) 226 227 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHpVbat = { 228 RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, 229 RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, 230 RAIL_PA_CURVES_2P4_HP_VBAT_CURVES, 231 }; 232 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataMpVbat = { 233 RAIL_PA_CURVES_2P4_MP_VBAT_MAX_POWER, 234 RAIL_PA_CURVES_2P4_MP_VBAT_MIN_POWER, 235 RAIL_PA_CURVES_2P4_MP_VBAT_CURVES, 236 }; 237 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataLpVbat = { 238 RAIL_PA_CURVES_2P4_LP_VBAT_MAX_POWER, 239 RAIL_PA_CURVES_2P4_LP_VBAT_MIN_POWER, 240 RAIL_PA_CURVES_2P4_LP, 241 }; 242 243 #ifdef RAIL_PA_CONVERSIONS_WEAK 244 __WEAK 245 #endif 246 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = { 247 .curves = { 248 { 249 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 250 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 251 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 252 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 253 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 254 }, 255 #if _SILICON_LABS_32B_SERIES_2_CONFIG == 1 256 { 257 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 258 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 259 .min = RAIL_TX_POWER_LEVEL_2P4_MP_MIN, 260 .max = RAIL_TX_POWER_LEVEL_2P4_MP_MAX, 261 .conversion = { .powerCurve = &RAIL_piecewiseDataMpVbat }, 262 }, 263 #endif // _SILICON_LABS_32B_SERIES_2_CONFIG == 1 264 { 265 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 266 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 267 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, 268 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, 269 .conversion = { .powerCurve = &RAIL_piecewiseDataLpVbat }, 270 }, 271 } 272 }; 273 274 #ifdef RAIL_PA_CONVERSIONS_WEAK 275 __WEAK 276 #endif 277 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = { 278 .curves = { 279 { 280 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 281 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 282 .min = RAIL_TX_POWER_LEVEL_HP_MIN, 283 .max = RAIL_TX_POWER_LEVEL_HP_MAX, 284 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 285 }, 286 { 287 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 288 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 289 .min = RAIL_TX_POWER_LEVEL_MP_MIN, 290 .max = RAIL_TX_POWER_LEVEL_MP_MAX, 291 .conversion = { .powerCurve = &RAIL_piecewiseDataMpVbat }, 292 }, 293 { 294 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 295 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 296 .min = RAIL_TX_POWER_LEVEL_LP_MIN, 297 .max = RAIL_TX_POWER_LEVEL_LP_MAX, 298 .conversion = { .powerCurve = &RAIL_piecewiseDataLpVbat }, 299 }, 300 } 301 }; 302 #elif defined(_SILICON_LABS_32B_SERIES_2_CONFIG_4) 303 static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHpVbat = { 304 RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, 305 RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, 306 RAIL_PA_CURVES_2P4_HP_VBAT_CURVES, 307 }; 308 static const int16_t RAIL_curves24Lp[RAIL_PA_CURVES_LP_VALUES] = 309 RAIL_PA_CURVES_2P4_LP_VBAT_CURVES; 310 311 #ifdef RAIL_PA_CONVERSIONS_WEAK 312 __WEAK 313 #endif 314 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesVbat = { 315 .curves = { 316 { 317 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 318 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 319 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 320 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 321 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 322 }, 323 { \ 324 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, \ 325 .segments = 0U, \ 326 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, \ 327 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, \ 328 .conversion = { .mappingTable = &RAIL_curves24Lp[0] }, \ 329 }, 330 } 331 }; 332 333 #ifdef RAIL_PA_CONVERSIONS_WEAK 334 __WEAK 335 #endif 336 const RAIL_TxPowerCurvesConfigAlt_t RAIL_TxPowerCurvesDcdc = { 337 .curves = { 338 { 339 .algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, 340 .segments = RAIL_PA_CURVES_PIECEWISE_SEGMENTS, 341 .min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, 342 .max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, 343 .conversion = { .powerCurve = &RAIL_piecewiseDataHpVbat }, 344 }, 345 { \ 346 .algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, \ 347 .segments = 0U, \ 348 .min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, \ 349 .max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, \ 350 .conversion = { .mappingTable = &RAIL_curves24Lp[0] }, \ 351 }, 352 } 353 }; 354 355 #else 356 #error "Unsupported platform!" 357 #endif 358 359 #endif //_SILICON_LABS_MODULE 360