Skip to content

Commit 05538bc

Browse files
nimble/ll: Add support for PA/LNA
This adds some definitions for PA/LNA support. The actual support is implemented in phy and front-end driver.
1 parent c13d0b4 commit 05538bc

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. 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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#ifndef H_BLE_LL_PLNA_
21+
#define H_BLE_LL_PLNA_
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
#include "syscfg/syscfg.h"
28+
29+
#if MYNEWT_VAL(BLE_LL_PA)
30+
void ble_ll_plna_pa_init(void);
31+
void ble_ll_plna_pa_enable(void);
32+
void ble_ll_plna_pa_disable(void);
33+
#endif
34+
35+
#if MYNEWT_VAL(BLE_LL_LNA)
36+
void ble_ll_plna_lna_init(void);
37+
void ble_ll_plna_lna_enable(void);
38+
void ble_ll_plna_lna_disable(void);
39+
#endif
40+
41+
#ifdef __cplusplus
42+
}
43+
#endif
44+
45+
#endif /* H_BLE_LL_PLNA_ */

nimble/controller/pkg.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pkg.req_apis:
2929
- ble_driver
3030
- ble_transport
3131
- stats
32+
pkg.req_apis.BLE_LL_PA:
33+
- ble_ll_pa
34+
pkg.req_apis.BLE_LL_LNA:
35+
- ble_ll_lna
3236

3337
pkg.deps:
3438
- "@apache-mynewt-core/kernel/os"

nimble/controller/src/ble_ll.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "controller/ble_ll_rfmgmt.h"
4545
#include "controller/ble_ll_trace.h"
4646
#include "controller/ble_ll_sync.h"
47+
#include "controller/ble_ll_plna.h"
4748
#include "ble_ll_conn_priv.h"
4849
#include "ble_ll_hci_priv.h"
4950
#include "ble_ll_priv.h"
@@ -1656,6 +1657,14 @@ ble_ll_reset(void)
16561657
ble_ll_resolv_list_reset();
16571658
#endif
16581659

1660+
1661+
#if MYNEWT_VAL(BLE_LL_PA)
1662+
ble_ll_plna_pa_init();
1663+
#endif
1664+
#if MYNEWT_VAL(BLE_LL_LNA)
1665+
ble_ll_plna_lna_init();
1666+
#endif
1667+
16591668
/* Re-initialize the PHY */
16601669
rc = ble_phy_init();
16611670

nimble/controller/syscfg.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,23 @@ syscfg.defs:
375375
line number where assertion occured.
376376
value: 0
377377

378+
BLE_LL_PA:
379+
description: Enable PA support
380+
value: 0
381+
BLE_LL_PA_GPIO:
382+
description: >
383+
GPIO pin number to control PA. Pin is set to high state when PA
384+
should be enabled.
385+
value: -1
386+
BLE_LL_LNA:
387+
description: Enable LNA support
388+
value: 0
389+
BLE_LL_LNA_GPIO:
390+
description: >
391+
GPIO pin number to control LNA. Pin is set to high state when LNA
392+
should be enabled.
393+
value: -1
394+
378395
BLE_LL_SYSINIT_STAGE:
379396
description: >
380397
Sysinit stage for the NimBLE controller.
@@ -499,3 +516,5 @@ syscfg.vals.!BLE_HOST:
499516
syscfg.restrictions:
500517
- OS_CPUTIME_FREQ == 32768
501518
- BLE_LL_PUBLIC_DEV_ADDR <= 0xffffffffffff
519+
- BLE_LL_PA == 0 || BLE_LL_PA_GPIO >= 0
520+
- BLE_LL_LNA == 0 || BLE_LL_LNA_GPIO >= 0

0 commit comments

Comments
 (0)