Skip to content

Commit

Permalink
nimble/ll: Add dummy FEM option
Browse files Browse the repository at this point in the history
Dummy FEM stubs PA and/or LNA APIs so it's possible to test FEM code
with out actualy FEM driver. Only PA/LNA-enable lines are active.
  • Loading branch information
andrzej-kaczmarek committed Sep 11, 2022
1 parent 6b15688 commit 176ec7a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions nimble/controller/include/controller/ble_ll_fem.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,28 @@ extern "C" {
#include "syscfg/syscfg.h"

#if MYNEWT_VAL(BLE_LL_FEM_PA)
#if MYNEWT_VAL(BLE_LL_FEM_DUMMY)
static inline void ble_ll_fem_pa_init(void) {}
static inline void ble_ll_fem_pa_enable(void) {}
static inline void ble_ll_fem_pa_disable(void) {}
#else
void ble_ll_fem_pa_init(void);
void ble_ll_fem_pa_enable(void);
void ble_ll_fem_pa_disable(void);
#endif
#endif

#if MYNEWT_VAL(BLE_LL_FEM_LNA)
#if MYNEWT_VAL(BLE_LL_FEM_DUMMY)
static inline void ble_ll_fem_lna_init(void) {}
static inline void ble_ll_fem_lna_enable(void) {}
static inline void ble_ll_fem_lna_disable(void) {}
#else
void ble_ll_fem_lna_init(void);
void ble_ll_fem_lna_enable(void);
void ble_ll_fem_lna_disable(void);
#endif
#endif

#if MYNEWT_VAL(BLE_LL_FEM_ANTENNA)
/* 0 sets default antenna, any other value is FEM specific */
Expand Down
4 changes: 2 additions & 2 deletions nimble/controller/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pkg.req_apis:
- ble_driver
- ble_transport
- stats
pkg.req_apis.BLE_LL_FEM_PA:
pkg.req_apis.'BLE_LL_FEM_PA && !BLE_LL_FEM_DUMMY':
- ble_ll_fem_pa
pkg.req_apis.BLE_LL_FEM_LNA:
pkg.req_apis.'BLE_LL_FEM_LNA && !BLE_LL_FEM_DUMMY':
- ble_ll_fem_lna
pkg.req_apis.BLE_LL_FEM_ANTENNA:
- ble_ll_fem_antenna
Expand Down
5 changes: 5 additions & 0 deletions nimble/controller/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ syscfg.defs:
description: >
Enable support for runtime antenna selection in FEM.
value: 0
BLE_LL_FEM_DUMMY:
description: >
Enable dummy FEM APIs. This enables FEM code but witout using actual
FEM driver, i.e. only PA/LNA-enable lines are active.
value: 0

BLE_LL_SYSINIT_STAGE:
description: >
Expand Down

0 comments on commit 176ec7a

Please sign in to comment.