diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2015-08-14 08:03:00 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-08-14 12:30:53 -0700 |
commit | 8d6b63e1e86ae0f1ee8b084ea2db6d5b5b705179 (patch) | |
tree | 9487ff8ed4cc5a814c825ee6885a7886e581800c /host/lib | |
parent | 9b51e4cfbe0aefa4e7ff3a64b15b22ec30a0a5e3 (diff) | |
download | uhd-8d6b63e1e86ae0f1ee8b084ea2db6d5b5b705179.tar.gz uhd-8d6b63e1e86ae0f1ee8b084ea2db6d5b5b705179.tar.bz2 uhd-8d6b63e1e86ae0f1ee8b084ea2db6d5b5b705179.zip |
C API: added soft register API
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/usrp_c.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp index 724b907a1..69f2bd5e5 100644 --- a/host/lib/usrp/usrp_c.cpp +++ b/host/lib/usrp/usrp_c.cpp @@ -1363,3 +1363,51 @@ uhd_error uhd_usrp_get_gpio_attr( *attr_out = USRP(h)->get_gpio_attr(std::string(bank), std::string(attr), mboard); ) } + +uhd_error uhd_usrp_enumerate_registers( + uhd_usrp_handle h, + size_t mboard, + uhd_string_vector_handle *registers_out +){ + UHD_SAFE_C_SAVE_ERROR(h, + (*registers_out)->string_vector_cpp = USRP(h)->enumerate_registers(mboard); + ) +} + +uhd_error uhd_usrp_get_register_info( + uhd_usrp_handle h, + const char* path, + size_t mboard, + uhd_usrp_register_info_t *register_info_out +){ + UHD_SAFE_C_SAVE_ERROR(h, + uhd::usrp::multi_usrp::register_info_t register_info_cpp = USRP(h)->get_register_info(path, mboard); + register_info_out->bitwidth = register_info_cpp.bitwidth; + register_info_out->readable = register_info_cpp.readable; + register_info_out->writable = register_info_cpp.writable; + ) +} + +uhd_error uhd_usrp_write_register( + uhd_usrp_handle h, + const char* path, + uint32_t field, + uint64_t value, + size_t mboard +){ + UHD_SAFE_C_SAVE_ERROR(h, + USRP(h)->write_register(path, field, value, mboard); + ) +} + +uhd_error uhd_usrp_write_register( + uhd_usrp_handle h, + const char* path, + uint32_t field, + size_t mboard, + uint64_t *value_out +){ + UHD_SAFE_C_SAVE_ERROR(h, + *value_out = USRP(h)->read_register(path, field, mboard); + ) +} |