Example program for EVAL-ADMX2001
Dependencies: ADMX2001
Diff: main.cpp
- Revision:
- 10:186e097fb1e3
- Parent:
- 9:29db35656fcb
--- a/main.cpp Tue Nov 02 10:14:25 2021 +0000 +++ b/main.cpp Tue Nov 09 10:27:32 2021 +0000 @@ -52,7 +52,7 @@ /*============= D A T A =============*/ -/** This is kept global and non-static as test code requires this*/ +/** This is kept global and non-static as the test code requires this*/ Admx200xDev admx200xDev; static int32_t SPIInit(spi_desc **pSpiDesc); @@ -61,12 +61,10 @@ static int32_t SetGain(uint32_t voltageGain, uint32_t currentGain); -/** - * - */ +/*============= C O D E =============*/ + /** * @brief Function to initialize SPI - * * @param pSpiDesc - Pointer to the spi descriptor * @return Returns 0 for success or error code. */ @@ -92,7 +90,8 @@ } /** - * Resets measurement + * @brief Resets measurement + * @return Returns 0 for success or error code. */ int32_t ResetModule() { @@ -114,7 +113,10 @@ } /** - * Set the voltage/current gain + * @brief Set the voltage and current gain + * @param voltageGain - Voltage gain value + * @param currentGain - Current gain value + * @return Returns 0 for success or error code. */ int32_t SetGain(uint32_t voltageGain, uint32_t currentGain) { @@ -194,6 +196,10 @@ // Running short calibration calType = CAL_TYPE_SHORT; status = Calibrate(calType, stdLoad, Xt); + if (status != ADMX_STATUS_SUCCESS) + { + ERROR_MSG("Calibration Failed"); + } INFO_MSG("------ Calibration completed ------"); } }