/*! ***************************************************************************** @file: AD5940Main.c @author: Neo Xu @brief: Used to control specific application and process data. ----------------------------------------------------------------------------- Copyright (c) 2017-2019 Analog Devices, Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement. *****************************************************************************/ /** * @addtogroup AD5940_System_Examples * @{ * @defgroup BioElec_Example * @{ */ #include "ad5940.h" #include "AD5940.h" #include #include "string.h" #include "math.h" #include "Electrocardiograph.h" #define APPBUFF_SIZE 1024 uint32_t AppBuff[APPBUFF_SIZE]; float LFOSCFreq; /* Measured LFOSC frequency */ /* print ECG result to uart */ AD5940Err ECGShowResult(void *pData, uint32_t DataCount) { /*Process data*/ for(int i=0;iMaxSeqLen = 512; pCfg->FifoThresh = 250; pCfg->ECGODR = 250; /* Note: ADuCM3029 is too slow to print data to UART. Limited to 1000Hz. */ pCfg->LfoscClkFreq = LFOSCFreq; } void AD5940_Main(void) { uint32_t temp; AD5940PlatformCfg(); AD5940ECGStructInit(); /* Configure your parameters in this function */ AppECGInit(AppBuff, APPBUFF_SIZE); /* Initialize BIA application. Provide a buffer, which is used to store sequencer commands */ AppECGCtrl(APPCTRL_START, 0); /* Control BIA measurement to start. Second parameter has no meaning with this command. */ while(1) { /* Check if interrupt flag which will be set when interrupt occurred. */ if(AD5940_GetMCUIntFlag()) { AD5940_ClrMCUIntFlag(); /* Clear this flag */ temp = APPBUFF_SIZE; AppECGISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */ ECGShowResult(AppBuff, temp); /* Show the results to UART */ } } } /** * @} * @} * */