# Driver Porting Questions

**URL:** <https://discourse.myriadrf.org/t/driver-porting-questions/8472>\
**Category:** General Discussion\
**Created:** [10 September 2024 22:30 UTC](https://discourse.myriadrf.org/t/driver-porting-questions/8472 "2024-09-10T22:30:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![midnight](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@midnight](https://discourse.myriadrf.org/u/midnight)\
**Post date:** [10 September 2024 22:30 UTC](https://discourse.myriadrf.org/t/driver-porting-questions/8472/1 "2024-09-10T22:30:59Z")

</div>

I am porting the Lime SDR Mini V2 (LimeSuite) driver to an embedded system I am developing. I have a few questions:

1. I see there is a LMS\_Calibrate API. I see some examples, but it isn’t clear how it is used correctly, or how make time it takes, or if it should be done every time the driver is started.

Can someone explain the correct way to calibrate and when and how often it should be done?

1. I see in LMS\_SendStream and LMS\_RecvStream have a nsamples (number of samples) in the parameter list. A sample is an I value and Q value so am I right that a single sample takes up two int16\_t or 32 bits?

Thanks,  
M-

---

<div class="post-metadata">

**Author:** ![ricardas](https://yyz2.discourse-cdn.com/flex034/user_avatar/discourse.myriadrf.org/ricardas/32/86_2.png) [@ricardas](https://discourse.myriadrf.org/u/ricardas)\
**Post date:** [11 September 2024 07:39 UTC](https://discourse.myriadrf.org/t/driver-porting-questions/8472/2 "2024-09-11T07:39:07Z")

</div>

1. DC IQ calibration should be done after all your working state parameters have been configured. And later after/if LO frequency is changed, or gain settings are changed.
2. LMS\_SendStream and LMS\_RecvStream accept data as void\*, the actual format that is going to be used is decided during LMS\_SetupStream. The host format can be using either 16bit integers, or 32bit floating point numbers. A sample is a pair of I and Q value. That data is converted from host to link format which is used to transfer data to device, device itself accepts either 16bit or 12bit integers.  
So on the software side a sample can be (int16\_t I ; int16\_t Q) or (float I; float Q)  
On the hardware side a sample can be (int16\_t I; int16\_t Q) or (12bit I and 12bit Q compressed into 3 bytes).

---

<div class="post-metadata">

**Author:** ![midnight](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@midnight](https://discourse.myriadrf.org/u/midnight)\
**Post date:** [11 September 2024 23:24 UTC](https://discourse.myriadrf.org/t/driver-porting-questions/8472/3 "2024-09-11T23:24:32Z")

</div>

Thank you
