summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libloragw/inc/loragw_hal.h2
-rw-r--r--libloragw/src/loragw_hal.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h
index 15bf918..e1e4644 100644
--- a/libloragw/inc/loragw_hal.h
+++ b/libloragw/inc/loragw_hal.h
@@ -401,6 +401,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 a891fbf..d77c693 100644
--- a/libloragw/src/loragw_hal.c
+++ b/libloragw/src/loragw_hal.c
@@ -1702,6 +1702,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() {