Wirepas SDK
bl_hardware.h
Go to the documentation of this file.
1/* Copyright 2020 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
7#ifndef HARDWARE_H_
8#define HARDWARE_H_
9
10#include <stdint.h>
11#include <stdbool.h>
12
13#if defined(NRF91_PLATFORM)
15typedef struct
16{
22 const char * at_commands;
23} platform_nrf91_t;
24#elif defined(NRF54_PLATFORM)
26typedef struct
27{
34 const uint16_t hfxo_int_cap_ff;
35
42 const uint16_t lfxo_int_cap_ff;
43
50 const uint32_t override_ficr_info_part;
51} platform_nrf54_t;
52#elif defined(EFR32_PLATFORM)
53#include "em_cmu.h"
54
55#if (_SILICON_LABS_32B_SERIES == 1)
56
58typedef struct
59{
63 const CMU_HFXOInit_TypeDef * const hfxoInit;
67 const CMU_LFXOInit_TypeDef * const lfxoInit;
68} platform_efr32_t;
69
70#elif (_SILICON_LABS_32B_SERIES == 2)
71
79typedef struct {
80 uint8_t timeoutCbLsb;
81 uint8_t timeoutSteadyFirstLock;
82 uint8_t timeoutSteady;
83 uint8_t ctuneXoStartup;
84 uint8_t ctuneXiStartup;
85 uint8_t coreBiasStartup;
86 uint8_t imCoreBiasStartup;
87 uint8_t coreDegenAna;
88 uint8_t ctuneFixAna;
89 uint8_t ctuneXoAna;
90 uint8_t ctuneXiAna;
91 uint8_t coreBiasAna;
92 bool enXiDcBiasAna;
93 uint8_t mode;
94 bool forceXo2GndAna;
95 bool forceXi2GndAna;
96 bool disOnDemand;
97 bool forceEn;
98#if defined(HFXO_CTRL_EM23ONDEMAND)
99 bool em23OnDemand;
100#endif
101 bool regLock;
102} Legacy_CMU_HFXOInit_TypeDef;
103
104#if defined(HFXO_CTRL_EM23ONDEMAND)
105 _Static_assert((sizeof(Legacy_CMU_HFXOInit_TypeDef) == 20), "sizeof Legacy HFXO Init is not 20");
106#else
107 _Static_assert((sizeof(Legacy_CMU_HFXOInit_TypeDef) == 19), "sizeof Legacy HFXO Init is not 19");
108#endif
109
117typedef struct {
118 uint8_t gain;
119 uint8_t capTune;
120 uint8_t timeout;
121 uint8_t mode;
122 bool highAmplitudeEn;
123 bool agcEn;
124 bool failDetEM4WUEn;
125 bool failDetEn;
126 bool disOnDemand;
127 bool forceEn;
128 bool regLock;
129} Legacy_CMU_LFXOInit_TypeDef;
130
131_Static_assert((sizeof(Legacy_CMU_LFXOInit_TypeDef) == 11), "sizeof Legacy LFXO Init is not 11");
132
134typedef struct
135{
139 const Legacy_CMU_HFXOInit_TypeDef * const hfxoInit;
143 const Legacy_CMU_LFXOInit_TypeDef * const lfxoInit;
144} platform_efr32_t;
145#endif // _SILICON_LABS_32B_SERIES
146#elif defined(CC13X4_PLATFORM)
148typedef struct
149{
156 const int8_t capArrDelta;
157} platform_cc13x4_t;
158#endif
159
161typedef union
162{
163#if defined(NRF52_PLATFORM)
167 const void * nrf52;
168#elif defined(NRF54_PLATFORM)
172 const platform_nrf54_t * nrf54;
173#elif defined(NRF91_PLATFORM)
177 const void * nrf91;
178#elif defined(EFR32_PLATFORM)
182 const platform_efr32_t * efr32;
183#elif defined(CC13X4_PLATFORM)
187 const platform_cc13x4_t * cc13x4;
188#endif
189} platform_t;
190
192typedef struct
193{
197 const bool crystal_32k;
201 const bool dcdc;
207
216
217#endif //HARDWARE_H_
const platform_t platform
const hardware_capabilities_t * hardware_getCapabilities(void)
Returns board hardware capabilities.
Hardware features that can be installed on a board.
Platform specific descriptions.