SDDC_Driver
Loading...
Searching...
No Matches
RadioHandler Class Reference
Collaboration diagram for RadioHandler:

Public Member Functions

 RadioHandler ()
 Create a new Radio Handler.
 
sddc_err_t Init (SDDC::DeviceItem dev_index)
 Initialize the RadioHandler instance.
 
sddc_err_t AttachReal (void(*callback)(void *context, const int16_t *, uint32_t), void *context=nullptr)
 Define the function to call when a real sample is available.
 
sddc_err_t AttachIQ (void(*callback)(void *context, const sddc_complex_t *, uint32_t), void *context=nullptr)
 Define the function to call when an IQ sample is available.
 
sddc_err_t Start (bool convert_r2iq)
 Start the SDR data stream and processing functions.
 
sddc_err_t Stop ()
 Stop the SDR data stream and processing functions.
 
sddc_err_t Pause ()
 Pause the data transmission from the SDR.
 
sddc_err_t Resume ()
 Resume data transmission from the SDR.
 
sddc_err_t SetDecimation (uint8_t decimate)
 Set the decimation factor of the FFT.
 
sddc_rf_mode_t GetBestRFMode (uint64_t freq)
 Return the best RF mode to use for the frequency given.
 
sddc_rf_mode_t GetRFMode ()
 Return the current RF mode.
 
sddc_err_t SetRFMode (sddc_rf_mode_t mode)
 
array< float, 2 > GetADCSampleRateLimits ()
 Get the limits of the ADC of your SDR.
 
uint32_t GetADCSampleRate ()
 
sddc_err_t SetADCSampleRate (uint32_t samplefreq)
 
uint32_t GetCenterFrequency ()
 Get the frequency currently tuned in the SDR.
 
sddc_err_t SetCenterFrequency (uint32_t freq)
 Set the frequency tuned in the SDR.
 
vector< float > GetRFGainSteps (sddc_rf_mode_t mode=NOMODE)
 
array< float, 2 > GetRFGainRange (sddc_rf_mode_t mode=NOMODE)
 
float GetRFGain ()
 
sddc_err_t SetRFGain (float new_att)
 
vector< float > GetIFGainSteps (sddc_rf_mode_t mode=NOMODE)
 
array< float, 2 > GetIFGainRange (sddc_rf_mode_t mode=NOMODE)
 
float GetIFGain ()
 
sddc_err_t SetIFGain (float new_gain)
 
bool GetBiasT_HF ()
 
sddc_err_t SetBiasT_HF (bool new_state)
 
bool GetBiasT_VHF ()
 
sddc_err_t SetBiasT_VHF (bool new_state)
 
bool GetDither ()
 
sddc_err_t SetDither (bool new_state)
 
bool GetPGA ()
 
sddc_err_t SetPGA (bool new_state)
 
bool GetRand ()
 
sddc_err_t SetRand (bool new_state)
 
sddc_err_t SetLED (sddc_leds_t led, bool on)
 
float getRealSamplesPerSecond () const
 
float getIQSamplesPerSecond () const
 
RadioModel getHardwareModel ()
 — Hardware infos — //
 
const char * getHardwareName ()
 
uint16_t GetHardwareFirmware ()
 
void EnableDebug (void(*dbgprintFX3)(const char *fmt,...), bool(*getconsolein)(char *buf, int maxlen))
 
bool ReadDebugTrace (uint8_t *pdata, uint8_t len)
 

Static Public Member Functions

static size_t GetDeviceListLength ()
 
static vector< SDDC::DeviceItemGetDeviceList ()
 

Protected Attributes

fx3classfx3
 

Member Function Documentation

◆ AttachIQ()

sddc_err_t RadioHandler::AttachIQ ( void(* callback )(void *context, const sddc_complex_t *, uint32_t),
void * context = nullptr )

Define the function to call when an IQ sample is available.

Note
The callback will only be called if convert_r2iq is set to true when calling RadioHandler::Start
Parameters
[in]callbackFunction called when a real sample is available
[in]contextUser defined context passed to the callback function
Return values
ERR_SUCCESS

◆ AttachReal()

sddc_err_t RadioHandler::AttachReal ( void(* callback )(void *context, const int16_t *, uint32_t),
void * context = nullptr )

Define the function to call when a real sample is available.

Note
The callback will only be called if convert_r2iq is set to false when calling RadioHandler::Start
Parameters
[in]callbackFunction called when a real sample is available
[in]contextUser defined context passed to the callback function
Return values
ERR_SUCCESS

◆ GetADCSampleRateLimits()

array< float, 2 > RadioHandler::GetADCSampleRateLimits ( )

Get the limits of the ADC of your SDR.

Return values
array<float,2>An array containing, in order, the lower and the higher limit of the ADC in Hertz

◆ GetBestRFMode()

sddc_rf_mode_t RadioHandler::GetBestRFMode ( uint64_t freq)

Return the best RF mode to use for the frequency given.

Parameters
[in]freqThe frequency to test in hertz
Return values
sddc_rf_mode_t

◆ GetCenterFrequency()

uint32_t RadioHandler::GetCenterFrequency ( )

Get the frequency currently tuned in the SDR.

Return values
Thefrequency tuned in hertz

◆ GetRFMode()

sddc_rf_mode_t RadioHandler::GetRFMode ( )

Return the current RF mode.

Return values
sddc_rf_mode_t

◆ Init()

sddc_err_t RadioHandler::Init ( SDDC::DeviceItem dev_index)

Initialize the RadioHandler instance.

Parameters
[in]dev_indexThe index of the SDR to use. You can get the list of available devices by using the static function of RadioHandler

◆ Pause()

sddc_err_t RadioHandler::Pause ( )

Pause the data transmission from the SDR.

Return values
sddc_err_t

◆ Resume()

sddc_err_t RadioHandler::Resume ( )

Resume data transmission from the SDR.

Return values
sddc_err_t

◆ SetCenterFrequency()

sddc_err_t RadioHandler::SetCenterFrequency ( uint32_t wishedFreq)

Set the frequency tuned in the SDR.

Parameters
[in]wishedFreqThe frequency to use in hertz
Return values
sddc_err_t

◆ SetDecimation()

sddc_err_t RadioHandler::SetDecimation ( uint8_t decimate)

Set the decimation factor of the FFT.

Note
This function has no effect if convert_r2iq is set to false when calling RadioHandler::Start
Parameters
[in]decimateA power of 2 of the decimation to apply to the input signal
radio_handler.SetDecimation(0) // No decimation
radio_handler.SetDecimation(1) // Decimate by 2
radio_handler.SetDecimation(4) // Decimate by 16
Return values
ERR_SUCCESS
ERR_DECIMATION_OUT_OF_RANGE

◆ Start()

sddc_err_t RadioHandler::Start ( bool convert_r2iq)

Start the SDR data stream and processing functions.

Parameters
[in]convert_r2iqSet to true to output IQ data instead of real samples
Return values
sddc_err_t

◆ Stop()

sddc_err_t RadioHandler::Stop ( )

Stop the SDR data stream and processing functions.

Return values
sddc_err_t

The documentation for this class was generated from the following files: