Vybhav Kadaba
/
EV-PRO-MW1001_Development_updateFW
Bumped Mbed FW version to 01.20.0080
Diff: src/admw_1001.c
- Revision:
- 72:35ea0b4e725b
- Parent:
- 70:420fac5132f5
--- a/src/admw_1001.c Thu Apr 23 08:34:45 2020 +0000 +++ b/src/admw_1001.c Fri Apr 24 06:37:01 2020 +0000 @@ -1063,6 +1063,36 @@ return ADMW_SUCCESS; } +static ADMW_RESULT admw_SetExtVrefBufferMode( + ADMW_DEVICE_HANDLE hDevice, + ADMW1001_VREF_BUFFER_MODE extVrefBufferMode) +{ + ADMW_CORE_EXT_VBUFF_t VrefBuffReg = { 0 }; + + if (extVrefBufferMode == ADMW1001_VREF_BUFF_MODE_DISABLE_BOTH) + { + VrefBuffReg.EXT_VBUFF = CORE_EXT_VBUFF_BOTH_INACTIVE_MODE; + } + else if (extVrefBufferMode == ADMW1001_VREF_BUFF_MODE_ONLY_POS) + { + VrefBuffReg.EXT_VBUFF = CORE_EXT_VBUFF_ONLY_VPOS_MODE; + } + else if (extVrefBufferMode == ADMW1001_VREF_BUFF_MODE_ENABLE_BOTH) + { + VrefBuffReg.EXT_VBUFF = CORE_EXT_VBUFF_BOTH_ACTIVE_MODE; + } + else + { + ADMW_LOG_ERROR("Unsupported Ext Vref Buffer mode %d specified", extVrefBufferMode); + return ADMW_INVALID_PARAM; + } + + WRITE_REG_U8(hDevice, VrefBuffReg.VALUE8, CORE_EXT_VBUFF); + + return ADMW_SUCCESS; + +} + ADMW_RESULT admw1001_SetMeasurementConfig( ADMW_DEVICE_HANDLE hDevice, ADMW1001_MEASUREMENT_CONFIG *pMeasConfig) @@ -1127,6 +1157,12 @@ ADMW_LOG_ERROR("Failed to set External reference Voltage"); return eRet; } + eRet = admw_SetExtVrefBufferMode(hDevice, (ADMW1001_VREF_BUFFER_MODE)pMeasConfig->extVrefBuffMode); + if (eRet != ADMW_SUCCESS) + { + ADMW_LOG_ERROR("Failed to set External Vref Buffer Mode"); + return eRet; + } return ADMW_SUCCESS; }