Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: calibrate.cpp
- Revision:
- 10:186e097fb1e3
- Parent:
- 9:29db35656fcb
--- a/calibrate.cpp Tue Nov 02 10:14:25 2021 +0000 +++ b/calibrate.cpp Tue Nov 09 10:27:32 2021 +0000 @@ -38,8 +38,6 @@ /** * @file calibrate.cpp * @brief This file contains calibrate related APIs for sdpk1 host - * @addtogroup SDPK1 - * @{ */ /*============= I N C L U D E S =============*/ @@ -74,13 +72,14 @@ static int32_t ReadAndDisplayCalibratedValue(); + + /** * @brief Command to perform various calibration types. * @param [in] calType - Type of Calibrate * @param [in] stdR - stdR value * @param [in] stdX - stdX value * @return Returns 0 for success or negative error code. - * \ref Calibrate */ int32_t Calibrate(CAL_TYPE calType, float stdR, float stdX) { @@ -113,7 +112,8 @@ if (status == ADMX_STATUS_SUCCESS) { status = (int32_t)(statReg & ADMX200X_STATUS_CODE_BITM); - /** Send the Load Calibration */ + /** Send the Load Calibration command*/ + // This calibration will use the previously set Rt and Xt data addr = 3; status = Admx200xSendCmd(pAdmx200x, &cmdID, &addr, &data, &statReg); @@ -169,12 +169,12 @@ uint32_t statReg; int32_t numValues = sizeof(calibrateBuffer) / sizeof(calibrateBuffer[0]); - + // Read measurement values into the calibrate buffer if (status == 0) { status = Admx200xReadFifo(pAdmx200x, &calibrateBuffer[0], &numValues); } - // Read sweep points + // Populate the fifo with sweep points if (status == 0) { cmdId = CMD_READ_SWEEP_POINTS; @@ -182,7 +182,7 @@ status = Admx200xSendCmd(pAdmx200x, &cmdId, &addr, (uint32_t *)&numValues, &statReg); } - // Read sweep points + // Read sweep points into the sweep points buffer if (status == 0) { status = Admx200xReadFifo(pAdmx200x, &sweepPoints[0], &numValues); @@ -205,17 +205,14 @@ * @param [in] displayVal1 - display value 1 * @param [in] displayVal2 - display value 2 * @param [in] sweepVar - sweep variable - * @return Returns 0 for success or negative error code. */ void DisplayCalibratedValue(double displayVal1, double displayVal2, double sweepVar) { + // Format the measured value and sweep variable snprintf(&displayString[0], MAX_CAL_DISPLAY_LENGTH, "Count = %d, Value = (%0.6e) + (%0.6e) j\n\r", (int32_t)sweepVar, displayVal1, displayVal2); + // Print the formated string printf("%s", &displayString[0]); } - -/** - * @} - */