mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
MPM: Add ability to query enabled state of ADC/DAC blocks
This adds to new methods to the RFdc class as well as the Python interface to be able to query the enabled state of an ADC or DAC block.
This commit is contained in:
parent
36be4006d9
commit
ab1ed11b0e
@ -119,6 +119,28 @@ public:
|
||||
*/
|
||||
void init(uint16_t rfdc_device_id);
|
||||
|
||||
/**
|
||||
* Queries enabled state of a given DAC block.
|
||||
*
|
||||
* @param tile_id ID of the tile (0..3)
|
||||
* @param block_id ID of the block within the tile (0..3)
|
||||
* @return enabled state of block
|
||||
* true is an enabled block
|
||||
* false is an invalid or disabled block
|
||||
*/
|
||||
bool is_dac_enabled(uint32_t tile_id, uint32_t block_id) const;
|
||||
|
||||
/**
|
||||
* Queries enabled state of a given ADC block.
|
||||
*
|
||||
* @param tile_id ID of the tile (0..3)
|
||||
* @param block_id ID of the block within the tile (0..3)
|
||||
* @return enabled state of block
|
||||
* true is an enabled block
|
||||
* false is an invalid or disabled block
|
||||
*/
|
||||
bool is_adc_enabled(uint32_t tile_id, uint32_t block_id) const;
|
||||
|
||||
/**
|
||||
* Starts up the requested tile while retaining register values.
|
||||
*
|
||||
@ -651,6 +673,8 @@ void export_rfdc(py::module& top_module)
|
||||
py::class_<rfdc_ctrl, std::shared_ptr<rfdc_ctrl>>(m, "rfdc_ctrl")
|
||||
.def(py::init())
|
||||
.def("init", &rfdc_ctrl::init)
|
||||
.def("is_adc_enabled", &rfdc_ctrl::is_adc_enabled)
|
||||
.def("is_dac_enabled", &rfdc_ctrl::is_dac_enabled)
|
||||
.def("startup_tile", &rfdc_ctrl::startup_tile)
|
||||
.def("shutdown_tile", &rfdc_ctrl::shutdown_tile)
|
||||
.def("reset_tile", &rfdc_ctrl::reset_tile)
|
||||
|
||||
@ -94,6 +94,16 @@ void rfdc_ctrl::init(uint16_t rfdc_device_id)
|
||||
}
|
||||
}
|
||||
|
||||
bool rfdc_ctrl::is_dac_enabled(uint32_t tile_id, uint32_t block_id) const
|
||||
{
|
||||
return XRFdc_IsDACBlockEnabled(rfdc_inst_ptr, tile_id, block_id) == 1;
|
||||
}
|
||||
|
||||
bool rfdc_ctrl::is_adc_enabled(uint32_t tile_id, uint32_t block_id) const
|
||||
{
|
||||
return XRFdc_IsADCBlockEnabled(rfdc_inst_ptr, tile_id, block_id) == 1;
|
||||
}
|
||||
|
||||
bool rfdc_ctrl::startup_tile(int tile_id, bool is_dac)
|
||||
{
|
||||
return XRFdc_StartUp(rfdc_inst_ptr, is_dac, tile_id) == XRFDC_SUCCESS;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user