Loading...
Searching...
No Matches
M2k

Contains the representation of the M2K. More...

## Classes

class | libm2k::context::M2k
| Controls the ADALM2000. More...

## Functions

virtual void | libm2k::context::M2k::reset ()=0
| Reset the M2K device to default settings:
virtual bool | libm2k::context::M2k::calibrateADC ()=0
| Calibrate the ADC.
virtual bool | libm2k::context::M2k::calibrateDAC ()=0
| Calibrate the DAC.
virtual double | libm2k::context::M2k::calibrateFromContext ()=0
| Calibrate both ADC and DACs using predefined calibration values located in context.
virtual libm2k::digital::M2kDigital * | libm2k::context::M2k::getDigital ()=0
| Retrieve the Digital object.
virtual libm2k::analog::M2kPowerSupply * | libm2k::context::M2k::getPowerSupply ()=0
| Retrieve the PowerSupply object.
virtual libm2k::analog::M2kAnalogIn * | libm2k::context::M2k::getAnalogIn ()=0
| Retrieve the AnalogIn object.
virtual libm2k::analog::M2kAnalogIn * | libm2k::context::M2k::getAnalogIn (std::string dev_name)=0
| Retrieve the AnalogIn object of a device.
virtual libm2k::analog::M2kAnalogOut * | libm2k::context::M2k::getAnalogOut ()=0
| Retrieve the AnalogOut object.
virtual bool | libm2k::context::M2k::hasMixedSignal ()=0
| Check if the mixed signal acquisition is available on the current firmware version.
virtual void | libm2k::context::M2k::startMixedSignalAcquisition (unsigned int nb_samples)=0
| Initiate the mixed acquisition.
virtual void | libm2k::context::M2k::stopMixedSignalAcquisition ()=0
| Stop the mixed acquisition.
virtual int | libm2k::context::M2k::getDacCalibrationOffset (unsigned int chn)=0
| Get the calibration offset of the DAC.
virtual double | libm2k::context::M2k::getDacCalibrationGain (unsigned int chn)=0
| Get the calibration gain of the DAC.
virtual int | libm2k::context::M2k::getAdcCalibrationOffset (unsigned int chn)=0
| Get the calibration offset of the ADC.
virtual double | libm2k::context::M2k::getAdcCalibrationGain (unsigned int chn)=0
| Get the calibration gain of the ADC.
virtual void | libm2k::context::M2k::setDacCalibrationOffset (unsigned int chn, int offset)=0
| Set the calibration offset of the DAC.
virtual void | libm2k::context::M2k::setDacCalibrationGain (unsigned int chn, double gain)=0
| Set the calibration gain of the DAC.
virtual void | libm2k::context::M2k::setAdcCalibrationOffset (unsigned int chn, int offset)=0
| Set the calibration offset of the ADC.
virtual void | libm2k::context::M2k::setAdcCalibrationGain (unsigned int chn, double gain)=0
| Set the calibration gain of the ADC.
virtual bool | libm2k::context::M2k::hasContextCalibration ()=0
| Check if the calibration based on temperature can be performed.
virtual std::map< double, std::shared_ptr< struct CALIBRATION_PARAMETERS > > & | libm2k::context::M2k::getLUT ()=0
| Retrieve the predefined calibration parameter.
virtual bool | libm2k::context::M2k::isCalibrated ()=0
| Check if the board was calibrated.
virtual void | libm2k::context::M2k::setLed (bool on)=0
| Turn on or off the board's led.
virtual bool | libm2k::context::M2k::getLed ()=0
| Retrieve the state of the led.

## Detailed Description

Contains the representation of the M2K.

## Function Documentation

## calibrateADC()

virtual bool libm2k::context::M2k::calibrateADC | ( |  | ) |

pure virtual

Calibrate the ADC.

Returns
  On succces, true
  Otherwise, false

## calibrateDAC()

virtual bool libm2k::context::M2k::calibrateDAC | ( |  | ) |

pure virtual

Calibrate the DAC.

Returns
  On succces, true
  Otherwise, false

## calibrateFromContext()

virtual double libm2k::context::M2k::calibrateFromContext | ( |  | ) |

pure virtual

Calibrate both ADC and DACs using predefined calibration values located in context.

Returns
  The closest temperature found in the lookup table

Note
  Only available from firmware v0.26.

## getAdcCalibrationGain()

virtual double libm2k::context::M2k::getAdcCalibrationGain | ( | unsigned int | chn | ) |

pure virtual

Get the calibration gain of the ADC.

Parameters

  chn | The index corresponding to a channel

Returns
  The value of the calibration gain

## getAdcCalibrationOffset()

virtual int libm2k::context::M2k::getAdcCalibrationOffset | ( | unsigned int | chn | ) |

pure virtual

Get the calibration offset of the ADC.

Parameters

  chn | The index corresponding to a channel

Returns
  The value of the calibration offset

## getAnalogIn() [1/2]

virtual libm2k::analog::M2kAnalogIn * libm2k::context::M2k::getAnalogIn | ( |  | ) |

pure virtual

Retrieve the AnalogIn object.

Returns
  On success, a pointer to an AnalogIn object
  On error, null is returned

## getAnalogIn() [2/2]

virtual libm2k::analog::M2kAnalogIn * libm2k::context::M2k::getAnalogIn | ( | std::string | dev_name | ) |

pure virtual

Retrieve the AnalogIn object of a device.

Parameters

  dev_name | The name corresponding to a device

Returns
  On success, a pointer to an AnalogIn object
  If the name does not correspond to any device, null is returned

## getAnalogOut()

virtual libm2k::analog::M2kAnalogOut * libm2k::context::M2k::getAnalogOut | ( |  | ) |

pure virtual

Retrieve the AnalogOut object.

Returns
  On success, a pointer to an AnalogOut object
  On error, null is returned

## getDacCalibrationGain()

virtual double libm2k::context::M2k::getDacCalibrationGain | ( | unsigned int | chn | ) |

pure virtual

Get the calibration gain of the DAC.

Parameters

  chn | The index corresponding to a channel

Returns
  The value of the calibration gain

## getDacCalibrationOffset()

virtual int libm2k::context::M2k::getDacCalibrationOffset | ( | unsigned int | chn | ) |

pure virtual

Get the calibration offset of the DAC.

Parameters

  chn | The index corresponding to a channel

Returns
  The value of the calibration offset

## getDigital()

virtual libm2k::digital::M2kDigital * libm2k::context::M2k::getDigital | ( |  | ) |

pure virtual

Retrieve the Digital object.

Returns
  On success, a pointer to a Digital object

Exceptions

  EXC_INVALID_PARAMETER | No M2K digital device found

## getLed()

virtual bool libm2k::context::M2k::getLed | ( |  | ) |

pure virtual

Retrieve the state of the led.

Returns
  If the led is turned on, true
  Otherwise, false

## getLUT()

virtual std::map< double, std::shared_ptr< struct CALIBRATION_PARAMETERS > > & libm2k::context::M2k::getLUT | ( |  | ) |

pure virtual

Retrieve the predefined calibration parameter.

Returns
  Map <temperature, parameters>

## getPowerSupply()

virtual libm2k::analog::M2kPowerSupply * libm2k::context::M2k::getPowerSupply | ( |  | ) |

pure virtual

Retrieve the PowerSupply object.

Returns
  On success, a pointer to a PowerSupply object

Exceptions

  EXC_INVALID_PARAMETER | No M2K power supply

## hasContextCalibration()

virtual bool libm2k::context::M2k::hasContextCalibration | ( |  | ) |

pure virtual

Check if the calibration based on temperature can be performed.

Returns
  True if the calibration parameters are available, False otherwise

## hasMixedSignal()

virtual bool libm2k::context::M2k::hasMixedSignal | ( |  | ) |

pure virtual

Check if the mixed signal acquisition is available on the current firmware version.

Returns
  True if the mixed signal acquisition is available, false otherwise

## isCalibrated()

virtual bool libm2k::context::M2k::isCalibrated | ( |  | ) |

pure virtual

Check if the board was calibrated.

Returns
  True if the board was calibrated, False otherwise

## reset()

virtual void libm2k::context::M2k::reset | ( |  | ) |

pure virtual

Reset the M2K device to default settings:

- Reset calibration coefficients
- Maximum samplerates
- Set oversampling ratio to 1
- Set AnalogIn range to low range
- Set kernel buffers count to 4 (analog/digital and in/out devices)
- Disable all TX digital channels and enable all RX digital channels
  Note
    A calibration is needed afterwards

Implements libm2k::context::Context.

## setAdcCalibrationGain()

virtual void libm2k::context::M2k::setAdcCalibrationGain | ( | unsigned int | chn,
|  | double | gain )

pure virtual

Set the calibration gain of the ADC.

Parameters

  chn | The index corresponding to a channel
  gain | The calibration gain value

Note
  Overrides the calibration coefficients.
  Can be reset by running a calibration.
  The gain value is currently limited at the (-2,2) range by the hardware.

## setAdcCalibrationOffset()

virtual void libm2k::context::M2k::setAdcCalibrationOffset | ( | unsigned int | chn,
|  | int | offset )

pure virtual

Set the calibration offset of the ADC.

Parameters

  chn | The index corresponding to a channel
  offset | The calibration offset value

Note
  Overrides the calibration coefficients.
  Can be reset by running a calibration.

## setDacCalibrationGain()

virtual void libm2k::context::M2k::setDacCalibrationGain | ( | unsigned int | chn,
|  | double | gain )

pure virtual

Set the calibration gain of the DAC.

Parameters

  chn | The index corresponding to a channel
  gain | The calibration gain value

Note
  Overrides the calibration coefficients.
  Can be reset by running a calibration.
  The gain value is currently limited at the (-2,2) range by the hardware.

## setDacCalibrationOffset()

virtual void libm2k::context::M2k::setDacCalibrationOffset | ( | unsigned int | chn,
|  | int | offset )

pure virtual

Set the calibration offset of the DAC.

Parameters

  chn | The index corresponding to a channel
  offset | The calibration offset value

Note
  Overrides the calibration coefficients.
  Can be reset by running a calibration.

## setLed()

virtual void libm2k::context::M2k::setLed | ( | bool | on | ) |

pure virtual

Turn on or off the board's led.

Parameters

  on | A boolean value corresponding to the state of the led

Note
  For turning on the led, set the parameter true.

## startMixedSignalAcquisition()

virtual void libm2k::context::M2k::startMixedSignalAcquisition | ( | unsigned int | nb_samples | ) |

pure virtual

Initiate the mixed acquisition.

Parameters

  nb_samples | The number of samples that will be retrieved

Note
  Only available from firmware v0.26.

## stopMixedSignalAcquisition()

virtual void libm2k::context::M2k::stopMixedSignalAcquisition | ( |  | ) |

pure virtual

Stop the mixed acquisition.

Note
  Only available from firmware v0.26.