Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2kAnalogIn: sync calibration state with device attributes #345

Closed

Conversation

Adrian-Stanea
Copy link
Contributor

  • Use device attributes in class instance for calibration at the SW level, samples should be sent uncalibrated.
  • Current firmware uses device attr to send calibrated samples by the HW. To simulate future firmware behaviour where samples are not calibrated we store the calibration result in the class instance, but don't write them to device attributes.

- Sync class parameters: m_adc_calib_offset, m_adc_calib_gain with device attributes.
These are used to calibrate the raw data to volts.
- In firmware version 0.32, the device attribute won't be used by the hardware,
samples will be recieved uncalibrated. The calibration will be done in software.
- in new firmware version the calibration is done in SW. Params will be
written in the device attr but not used at the HW level. Raw samples are
sent without calibration and the calibration is done in SW.
- this patch is for debug purpose only. It updates calibration params
only for the class instance but not in the device attr. This way we simulate
calibration where samples are sent without calibration at HW level.

Signed-off-by: Adrian Stanea <[email protected]>
…ibration attr

- Sync class parameters: m_adc_calib_offset, m_adc_calib_gain with device attributes.
These are used to calibrate the raw data to volts.
- In firmware version 0.32, the device attribute won't be used by the hardware,
samples will be recieved uncalibrated. The calibration will be done in software.
- I new libm2k, use the calibration attr is used to disable setting the computed calibration values in HW.
- Note:
    - set calibration = 'true' (string vale): stops the HW calibration
    - set calibration = 'false' (string value): enables the HW calibration

Signed-off-by: Adrian Stanea <[email protected]>
- current firmware still has name starting with 0.31
- Future release will have name starting with 0.32, and the new calibration
  attr will be used.

Signed-off-by: Adrian Stanea <[email protected]>
@Adrian-Stanea
Copy link
Contributor Author

Tested potential fix in old firmware. The solution is ambiguous since it leads to calibrate call that wont be reflected in the iio attributes, only in class instance.
The change also requires a new calibration for each new instance since the values are not cached in iio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant