You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2023/05/19 13:51:01 UTC
[mynewt-nimble] 02/02: nimble/ll: Add function for getting current PHY channel
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 550d5a77cac8913d2b97b9238c87d85456a0623d
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Wed May 17 13:48:11 2023 +0200
nimble/ll: Add function for getting current PHY channel
This is useful for dynamic FEM drivers.
---
nimble/controller/include/controller/ble_phy.h | 1 +
nimble/drivers/dialog_cmac/src/ble_phy.c | 6 ++++++
nimble/drivers/native/src/ble_phy.c | 6 ++++++
nimble/drivers/nrf51/src/ble_phy.c | 6 ++++++
nimble/drivers/nrf5x/src/ble_phy.c | 6 ++++++
5 files changed, 25 insertions(+)
diff --git a/nimble/controller/include/controller/ble_phy.h b/nimble/controller/include/controller/ble_phy.h
index bba8bccb..ab96cb9c 100644
--- a/nimble/controller/include/controller/ble_phy.h
+++ b/nimble/controller/include/controller/ble_phy.h
@@ -86,6 +86,7 @@ int ble_phy_init(void);
/* Set the PHY channel */
int ble_phy_setchan(uint8_t chan, uint32_t access_addr, uint32_t crcinit);
+uint8_t ble_phy_chan_get(void);
#if MYNEWT_VAL(BLE_PHY_VARIABLE_TIFS)
/* Set T_ifs time for next transition */
diff --git a/nimble/drivers/dialog_cmac/src/ble_phy.c b/nimble/drivers/dialog_cmac/src/ble_phy.c
index 997ce2ab..938455bb 100644
--- a/nimble/drivers/dialog_cmac/src/ble_phy.c
+++ b/nimble/drivers/dialog_cmac/src/ble_phy.c
@@ -1697,6 +1697,12 @@ ble_phy_setchan(uint8_t chan, uint32_t access_addr, uint32_t crc_init)
return 0;
}
+uint8_t
+ble_phy_chan_get(void)
+{
+ return g_ble_phy_data.channel;
+}
+
void
ble_phy_restart_rx(void)
{
diff --git a/nimble/drivers/native/src/ble_phy.c b/nimble/drivers/native/src/ble_phy.c
index 7635621c..e27f36e9 100644
--- a/nimble/drivers/native/src/ble_phy.c
+++ b/nimble/drivers/native/src/ble_phy.c
@@ -551,6 +551,12 @@ ble_phy_setchan(uint8_t chan, uint32_t access_addr, uint32_t crcinit)
return 0;
}
+uint8_t
+ble_phy_chan_get(void)
+{
+ return g_ble_phy_data.phy_chan;
+}
+
/**
* Disable the PHY. This will do the following:
* -> Turn off all phy interrupts.
diff --git a/nimble/drivers/nrf51/src/ble_phy.c b/nimble/drivers/nrf51/src/ble_phy.c
index f35c7781..c3a523dc 100644
--- a/nimble/drivers/nrf51/src/ble_phy.c
+++ b/nimble/drivers/nrf51/src/ble_phy.c
@@ -1365,6 +1365,12 @@ ble_phy_setchan(uint8_t chan, uint32_t access_addr, uint32_t crcinit)
return 0;
}
+uint8_t
+ble_phy_chan_get(void)
+{
+ return g_ble_phy_data.phy_chan;
+}
+
/**
* Stop the timer used to count microseconds when using RTC for cputime
*/
diff --git a/nimble/drivers/nrf5x/src/ble_phy.c b/nimble/drivers/nrf5x/src/ble_phy.c
index bbf4f0a5..223afbff 100644
--- a/nimble/drivers/nrf5x/src/ble_phy.c
+++ b/nimble/drivers/nrf5x/src/ble_phy.c
@@ -2126,6 +2126,12 @@ ble_phy_setchan(uint8_t chan, uint32_t access_addr, uint32_t crcinit)
return 0;
}
+uint8_t
+ble_phy_chan_get(void)
+{
+ return g_ble_phy_data.phy_chan;
+}
+
/**
* Stop the timer used to count microseconds when using RTC for cputime
*/