diff options
-rw-r--r-- | libloragw/inc/loragw_hal.h | 2 | ||||
-rw-r--r-- | libloragw/src/loragw_hal.c | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h index f5a6183..f6dc8dc 100644 --- a/libloragw/inc/loragw_hal.h +++ b/libloragw/inc/loragw_hal.h @@ -402,6 +402,8 @@ int lgw_abort_tx(void); */ int lgw_get_trigcnt(uint32_t* trig_cnt_us); +int lgw_get_cur_page(uint8_t* page); + /** @brief Allow user to check the version/options of the library once compiled @return pointer on a human-readable null terminated string diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c index 9355cb8..c723be9 100644 --- a/libloragw/src/loragw_hal.c +++ b/libloragw/src/loragw_hal.c @@ -1707,6 +1707,19 @@ int lgw_get_trigcnt(uint32_t* trig_cnt_us) { } } +int lgw_get_cur_page(uint8_t* page) { + int i; + int32_t val; + + i = lgw_reg_r(LGW_PAGE_REG, &val); + if (i == LGW_REG_SUCCESS) { + *page = (uint32_t)val; + return LGW_HAL_SUCCESS; + } else { + return LGW_HAL_ERROR; + } +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ const char* lgw_version_info() { |