init2
This commit is contained in:
parent
1f6fe6a05b
commit
4d1cf3de48
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1,103 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940_ADCMeanFIFO.c
|
||||
@author: $Author: nxu2 $
|
||||
@brief: Use FIFO to read statistic block mean result.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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_Standard_Examples
|
||||
* @{
|
||||
@defgroup ADC_MEAN_FIFO_Example
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "ad5940.h"
|
||||
#include <stdio.h>
|
||||
|
||||
uint32_t ADCBuff[256];
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
ADCBaseCfg_Type adc_base;
|
||||
ADCFilterCfg_Type adc_filter;
|
||||
StatCfg_Type stat_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Firstly call this function after reset to initialize AFE registers. */
|
||||
AD5940_Initialize();
|
||||
/* Configure AFE power mode and bandwidth */
|
||||
AD5940_AFEPwrBW(AFEPWR_LP, AFEBW_250KHZ);
|
||||
/* Initialize ADC basic function */
|
||||
adc_base.ADCMuxP = ADCMUXP_AVDD_2;
|
||||
adc_base.ADCMuxN = ADCMUXN_VSET1P1;
|
||||
adc_base.ADCPga = ADCPGA_1;
|
||||
AD5940_ADCBaseCfgS(&adc_base);
|
||||
|
||||
/* Initialize ADC filters ADCRawData-->SINC3-->SINC2+NOTCH-->StatisticBlock */
|
||||
adc_filter.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
adc_filter.ADCSinc2Osr = ADCSINC2OSR_1333;
|
||||
adc_filter.ADCAvgNum = ADCAVGNUM_2; /* Don't care about it. Average function is only used for DFT */
|
||||
adc_filter.ADCRate = ADCRATE_800KHZ; /* If ADC clock is 32MHz, then set it to ADCRATE_1P6MHZ. Default is 16MHz, use ADCRATE_800KHZ. */
|
||||
adc_filter.BpNotch = bTRUE; /* SINC2+Notch is one block, when bypass notch filter, we can get fresh data from SINC2 filter. */
|
||||
adc_filter.BpSinc3 = bFALSE; /* We use SINC3 filter. */
|
||||
adc_filter.Sinc2NotchEnable = bTRUE; /* Enable the SINC2+Notch block. You can also use function AD5940_AFECtrlS */
|
||||
AD5940_ADCFilterCfgS(&adc_filter);
|
||||
|
||||
/**
|
||||
* Statistic block receive data from SINC2+Notch block. Note the diagram in datasheet page 51 PrM.
|
||||
* The SINC3 can be bypassed optionally. SINC2 cannot be bypassed.
|
||||
* */
|
||||
stat_cfg.StatDev = STATDEV_1; /* Not used. */
|
||||
stat_cfg.StatEnable = bTRUE;
|
||||
stat_cfg.StatSample = STATSAMPLE_128; /* Sample 128 points and calculate mean. */
|
||||
AD5940_StatisticCfgS(&stat_cfg);
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB;
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_MEAN;
|
||||
fifo_cfg.FIFOThresh = 2;
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
/* Enable all interrupt at Interrupt Controller 1. So we can check the interrupt flag */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE);
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Enable FIFO threshold interrupt. */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
AD5940_ClrMCUIntFlag(); /* Clear the MCU interrupt flag which will be set in ISR. */
|
||||
|
||||
AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV, bTRUE);
|
||||
while(1)
|
||||
{
|
||||
uint32_t FifoCnt;
|
||||
if(AD5940_GetMCUIntFlag())
|
||||
{
|
||||
AD5940_ClrMCUIntFlag(); /* Clear this flag */
|
||||
if(AD5940_INTCTestFlag(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
FifoCnt = AD5940_FIFOGetCnt();
|
||||
AD5940_FIFORd((uint32_t *)ADCBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
printf("Get %d data, ADC Code[0]:%d\n",FifoCnt, ADCBuff[0]&0xffff);
|
||||
/*!!!!!NOTE!!!!!*/
|
||||
/* The mean result already removed 32768. So to calculate the voltage, assume mean result is n, use below equation.
|
||||
Voltage = n/32768*Vref
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940_ADCNotchTest.c
|
||||
@author: Neo Xu
|
||||
@brief: Notch filter test.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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_Standard_Examples
|
||||
* @{
|
||||
@defgroup ADC_Notch_Test_Example
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "ad5940.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef ADI_DEBUG
|
||||
#undef ADI_DEBUG
|
||||
#endif
|
||||
|
||||
void ad5940_sequencer_init(uint8_t adc_rate, uint8_t sinc3osr, uint8_t sinc2osr){
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
SEQCfg_Type seq_cfg;
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_SINC2NOTCH;
|
||||
fifo_cfg.FIFOThresh = 1;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB;
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
uint32_t WaitClks;
|
||||
uint8_t dl_60, dl_50, dl=0;
|
||||
ADCFilterCfg_Type filter;
|
||||
filter.ADCSinc3Osr = sinc3osr;
|
||||
filter.ADCSinc2Osr = sinc2osr;
|
||||
filter.ADCRate = adc_rate;
|
||||
const uint32_t sinc2osr_table[] = {22,44,89,178,267,533,640,667,800,889,1067,1333,0};
|
||||
const uint32_t sinc3osr_table[] = {5,4,2,0};
|
||||
printf("SINC3:OSR%d, SINC2:OSR%d, ", sinc3osr_table[sinc3osr], sinc2osr_table[sinc2osr]);
|
||||
if(AD5940_Notch50HzAvailable(&filter, &dl_50)){
|
||||
printf("NOTCH50: DL:%d, %dHz ", dl_50, (uint32_t)((adc_rate==ADCRATE_1P6MHZ?1.6e6:800000.0)/sinc3osr_table[sinc3osr]/sinc2osr_table[sinc2osr]/dl_50 + .5));
|
||||
dl += dl_50-1;
|
||||
}
|
||||
if(AD5940_Notch60HzAvailable(&filter, &dl_60)){
|
||||
printf("NOTCH60: DL:%d, %dHz ", dl_60, (uint32_t)((adc_rate==ADCRATE_1P6MHZ?1.6e6:800000.0)/sinc3osr_table[sinc3osr]/sinc2osr_table[sinc2osr]/dl_60 + .5));
|
||||
dl += dl_60-1;
|
||||
}
|
||||
ClksCalInfo_Type clks_cal;
|
||||
clks_cal.DataType = DATATYPE_NOTCH;
|
||||
clks_cal.ADCRate = adc_rate;
|
||||
clks_cal.DataCount = 1; /* Sample one data when wakeup */
|
||||
clks_cal.ADCSinc2Osr = sinc2osr;
|
||||
clks_cal.ADCSinc3Osr = sinc3osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = adc_rate==ADCRATE_1P6MHZ?.5:1;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
static uint32_t buff[128];
|
||||
AD5940_SEQGenInit(buff, 128);
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
AD5940_SEQGpioCtrlS(AGPIO_Pin1);
|
||||
AD5940_AFECtrlS(AFECTRL_ADCPWR, bTRUE);
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*250));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_SINC2NOTCH, bTRUE); /* Start ADC convert */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks));
|
||||
//wait for first data ready
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bFALSE); /* Stop ADC convert and DFT */
|
||||
AD5940_SEQGpioCtrlS(0);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
|
||||
SEQInfo_Type seqinfo;
|
||||
AD5940_SEQGenFetchSeq(&seqinfo.pSeqCmd, &seqinfo.SeqLen);
|
||||
seqinfo.SeqId = SEQID_0;
|
||||
seqinfo.SeqRamAddr = 0;
|
||||
seqinfo.WriteSRAM = bTRUE;
|
||||
AD5940_SEQInfoCfg(&seqinfo);
|
||||
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP2_TRIG|GP1_SYNC|GP0_INT;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin5|AGPIO_Pin6;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = AGPIO_Pin2;
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
}
|
||||
|
||||
uint32_t ad5940_notch_test(uint8_t adc_rate, uint8_t sinc3osr, uint8_t sinc2osr){
|
||||
ADCBaseCfg_Type adc_base;
|
||||
ADCFilterCfg_Type adc_filter;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
|
||||
/* Firstly call this function after reset to initialize AFE registers. */
|
||||
AD5940_Initialize();
|
||||
|
||||
CLKCfg_Type clk_cfg;
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = adc_rate==ADCRATE_1P6MHZ?SYSCLKDIV_2:SYSCLKDIV_1;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
|
||||
clk_cfg.HfOSC32MHzMode = adc_rate==ADCRATE_1P6MHZ?bTRUE:bFALSE;
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bFALSE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
|
||||
/* Configure AFE power mode and bandwidth */
|
||||
AD5940_AFEPwrBW(AFEPWR_LP, AFEBW_250KHZ);
|
||||
|
||||
/* Initialize ADC basic function */
|
||||
adc_base.ADCMuxP = ADCMUXP_VREF1P8DAC;
|
||||
adc_base.ADCMuxN = ADCMUXN_VSET1P1;
|
||||
adc_base.ADCPga = ADCPGA_1P5;
|
||||
AD5940_ADCBaseCfgS(&adc_base);
|
||||
AD5940_AFECtrlS(AFECTRL_DACREFPWR|AFECTRL_HSDACPWR, bTRUE);
|
||||
/* Initialize ADC filters ADCRawData-->SINC3-->SINC2+NOTCH */
|
||||
adc_filter.ADCSinc3Osr = sinc3osr;
|
||||
adc_filter.ADCSinc2Osr = sinc2osr;
|
||||
adc_filter.ADCAvgNum = ADCAVGNUM_2; /* Don't care about it. Average function is only used for DFT */
|
||||
adc_filter.ADCRate = adc_rate; /* If ADC clock is 32MHz, then set it to ADCRATE_1P6MHZ. Default is 16MHz, use ADCRATE_800KHZ. */
|
||||
adc_filter.BpNotch = bFALSE; /* SINC2+Notch is one block, when bypass notch filter, we can get fresh data from SINC2 filter. */
|
||||
adc_filter.BpSinc3 = bFALSE; /* We use SINC3 filter. */
|
||||
adc_filter.Sinc2NotchEnable = bTRUE; /* Enable the SINC2+Notch block. You can also use function AD5940_AFECtrlS */
|
||||
AD5940_ADCFilterCfgS(&adc_filter);
|
||||
|
||||
/* Enable all interrupt at Interrupt Controller 1. So we can check the interrupt flag */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE);
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE);
|
||||
|
||||
ad5940_sequencer_init(adc_rate, sinc3osr, sinc2osr);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
AD5940_SEQCtrlS(bTRUE);
|
||||
AD5940_ClrMCUIntFlag();
|
||||
AD5940_SEQMmrTrig(SEQID_0);
|
||||
while(1)
|
||||
{
|
||||
{int32_t i = 1000000;while(i--);}
|
||||
if(AD5940_GetMCUIntFlag())
|
||||
{
|
||||
AD5940_ClrMCUIntFlag();
|
||||
uint32_t fifo_count = AD5940_FIFOGetCnt();
|
||||
if(fifo_count == 1){
|
||||
int32_t rd;
|
||||
AD5940_FIFORd((uint32_t*)&rd, 1);
|
||||
rd &= 0xffff;
|
||||
float volt = AD5940_ADCCode2Volt(rd, ADCPGA_1P5, 1.82)+1.11;
|
||||
volt -= 1.82;
|
||||
if(volt < 0) volt = -volt;
|
||||
if(volt > 0.0005){
|
||||
printf("FAILED:CODE:rd:%d\n", rd);
|
||||
return 1;
|
||||
}
|
||||
printf("PASS\n");
|
||||
return 0;
|
||||
}
|
||||
else{
|
||||
printf("FAILED:%d\n", fifo_count);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
uint32_t failed = 0;
|
||||
uint8_t sinc3=0, sinc2=0;
|
||||
uint8_t adc_rate=0;
|
||||
for(;adc_rate<=1;adc_rate++){
|
||||
sinc3=0;
|
||||
for(;sinc3<=ADCSINC3OSR_2;sinc3++){
|
||||
sinc2=0;
|
||||
for(;sinc2<=ADCSINC2OSR_1333;sinc2++){
|
||||
failed |= ad5940_notch_test(adc_rate, sinc3, sinc2);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("Test Done with status: %s\n",failed?"FAILED":"SUCCEED");
|
||||
while(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940_ADCPolling.c
|
||||
@author: $Author: nxu2 $
|
||||
@brief: ADC Polling mode example
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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_Standard_Examples
|
||||
* @{
|
||||
@defgroup ADC_Polling_Example
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "ad5940.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define ADCPGA_GAIN_SEL ADCPGA_1P5
|
||||
static void AD5940_PGA_Calibration(void){
|
||||
AD5940Err err;
|
||||
ADCPGACal_Type pgacal;
|
||||
pgacal.AdcClkFreq = 16e6;
|
||||
pgacal.ADCSinc2Osr = ADCSINC2OSR_178;
|
||||
pgacal.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
pgacal.SysClkFreq = 16e6;
|
||||
pgacal.TimeOut10us = 1000;
|
||||
pgacal.VRef1p11 = 1.11f;
|
||||
pgacal.VRef1p82 = 1.82f;
|
||||
pgacal.PGACalType = PGACALTYPE_OFFSETGAIN;
|
||||
pgacal.ADCPga = ADCPGA_GAIN_SEL;
|
||||
err = AD5940_ADCPGACal(&pgacal);
|
||||
if(err != AD5940ERR_OK){
|
||||
printf("AD5940 PGA calibration failed.");
|
||||
}
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
ADCBaseCfg_Type adc_base;
|
||||
ADCFilterCfg_Type adc_filter;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
|
||||
/* Firstly call this function after reset to initialize AFE registers. */
|
||||
AD5940_Initialize();
|
||||
|
||||
AD5940_PGA_Calibration();
|
||||
/* Configure AFE power mode and bandwidth */
|
||||
AD5940_AFEPwrBW(AFEPWR_LP, AFEBW_250KHZ);
|
||||
|
||||
/* Initialize ADC basic function */
|
||||
AD5940_AFECtrlS(AFECTRL_DACREFPWR|AFECTRL_HSDACPWR, bTRUE); //We are going to measure DAC 1.82V reference.
|
||||
adc_base.ADCMuxP = ADCMUXP_VREF1P8DAC;
|
||||
adc_base.ADCMuxN = ADCMUXN_VSET1P1;
|
||||
adc_base.ADCPga = ADCPGA_GAIN_SEL;
|
||||
AD5940_ADCBaseCfgS(&adc_base);
|
||||
|
||||
/* Initialize ADC filters ADCRawData-->SINC3-->SINC2+NOTCH */
|
||||
adc_filter.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
adc_filter.ADCSinc2Osr = ADCSINC2OSR_1333;
|
||||
adc_filter.ADCAvgNum = ADCAVGNUM_2; /* Don't care about it. Average function is only used for DFT */
|
||||
adc_filter.ADCRate = ADCRATE_800KHZ; /* If ADC clock is 32MHz, then set it to ADCRATE_1P6MHZ. Default is 16MHz, use ADCRATE_800KHZ. */
|
||||
adc_filter.BpNotch = bTRUE; /* SINC2+Notch is one block, when bypass notch filter, we can get fresh data from SINC2 filter. */
|
||||
adc_filter.BpSinc3 = bFALSE; /* We use SINC3 filter. */
|
||||
adc_filter.Sinc2NotchEnable = bTRUE; /* Enable the SINC2+Notch block. You can also use function AD5940_AFECtrlS */
|
||||
AD5940_ADCFilterCfgS(&adc_filter);
|
||||
|
||||
//AD5940_ADCMuxCfgS(ADCMUXP_AIN2, ADCMUXN_VSET1P1); /* Optionally, you can change ADC MUX with this function */
|
||||
|
||||
/* Enable all interrupt at Interrupt Controller 1. So we can check the interrupt flag */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE);
|
||||
|
||||
//AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bTRUE);
|
||||
//AD5940_AFECtrlS(AFECTRL_ADCCNV, bTRUE);
|
||||
AD5940_ADCPowerCtrlS(bTRUE);
|
||||
AD5940_ADCConvtCtrlS(bTRUE);
|
||||
|
||||
while(1)
|
||||
{
|
||||
uint32_t rd;
|
||||
if(AD5940_INTCTestFlag(AFEINTC_1,AFEINTSRC_SINC2RDY))
|
||||
{
|
||||
static uint32_t count;
|
||||
AD5940_INTCClrFlag(AFEINTSRC_SINC2RDY);
|
||||
rd = AD5940_ReadAfeResult(AFERESULT_SINC2);
|
||||
count ++;
|
||||
/* ADC Sample rate is 800kSPS. SINC3 OSR is 4, SINC2 OSR is 1333. So the final output data rate is 800kSPS/4/1333 = 150.0375Hz */
|
||||
if(count == 150) /* Print data @1Hz */
|
||||
{
|
||||
count = 0;
|
||||
float diff_volt = AD5940_ADCCode2Volt(rd, ADCPGA_GAIN_SEL, 1.82);
|
||||
printf("ADC Code:%d, diff-volt: %.4f, volt:%.4f\n",rd, diff_volt, diff_volt+1.11);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
</device>
|
||||
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
|
||||
<components>
|
||||
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
</components>
|
||||
|
||||
<apis/>
|
||||
|
||||
<packages useAllLatestPacks="1"/>
|
||||
|
||||
</configuration>
|
||||
|
||||
|
|
@ -0,0 +1,282 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940_ADCPolling.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940_ADCPolling.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,498 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.0</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940_ADCPolling.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940_ADCPolling.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,321 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940_ADCPolling.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940_ADCPolling.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,584 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940_ADCPolling.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940_ADCPolling.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.2" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.7.6">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940Main.c
|
||||
@author: $Author: nxu2 $
|
||||
@brief: Used to control specific application and further process data.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
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.
|
||||
*****************************************************************************/
|
||||
#include "ad5940.h"
|
||||
#include "AD5940.h"
|
||||
#include <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "Amperometric.h"
|
||||
|
||||
#define APPBUFF_SIZE 1000
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
float LFOSCFreq;
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
int32_t AMPShowResult(float *pData, uint32_t DataCount)
|
||||
{
|
||||
/* Print data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("index:%d, Current:%fuA\n", i, pData[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
SEQCfg_Type seq_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
LFOSCMeasure_Type LfoscMeasure;
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bFALSE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
clk_cfg.HfOSC32MHzMode = bFALSE;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 4;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB;
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP4_SYNC|GP2_SYNC|GP1_SLEEP|GP0_INT;
|
||||
gpio_cfg.InputEnSet = 0;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6|AGPIO_Pin2;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter sleep mode. */
|
||||
/* Measure LFOSC frequency */
|
||||
LfoscMeasure.CalDuration = 1000.0; /* 1000ms used for calibration. */
|
||||
LfoscMeasure.CalSeqAddr = 0;
|
||||
LfoscMeasure.SystemClkFreq = 16000000.0f; /* 16MHz in this firmware. */
|
||||
AD5940_LFOSCMeasure(&LfoscMeasure, &LFOSCFreq);
|
||||
printf("Freq:%f\n", LFOSCFreq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940AMPStructInit(void)
|
||||
{
|
||||
AppAMPCfg_Type *pAMPCfg;
|
||||
|
||||
AppAMPGetCfg(&pAMPCfg);
|
||||
pAMPCfg->WuptClkFreq = LFOSCFreq;
|
||||
/* Configure general parameters */
|
||||
pAMPCfg->SeqStartAddr = 0;
|
||||
pAMPCfg->MaxSeqLen = 512; /* @todo add checker in function */
|
||||
pAMPCfg->RcalVal = 10000.0;
|
||||
pAMPCfg->NumOfData = -1; /* Never stop until you stop it manually by AppAMPCtrl() function */
|
||||
|
||||
|
||||
/* Configure measurement parameters */
|
||||
pAMPCfg->AmpODR = 1; /* Time between samples in seconds */
|
||||
pAMPCfg->FifoThresh = 4; /* Number of measurements before alerting host microcontroller */
|
||||
|
||||
pAMPCfg->SensorBias = 0; /* Sensor bias voltage between reference and sense electrodes*/
|
||||
pAMPCfg->LptiaRtiaSel = LPTIARTIA_1K;
|
||||
pAMPCfg->LpTiaRl = LPTIARLOAD_10R;
|
||||
pAMPCfg->Vzero = 1100; /* Vzero voltage. Voltage on Sense electrode. Unit is mV*/
|
||||
|
||||
pAMPCfg->ADCRefVolt = 1.82; /* Measure voltage on Vref_1V8 pin */
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
uint32_t temp;
|
||||
|
||||
AD5940PlatformCfg();
|
||||
AD5940AMPStructInit(); /* Configure your parameters in this function */
|
||||
AppAMPInit(AppBuff, APPBUFF_SIZE); /* Initialize AMP application. Provide a buffer, which is used to store sequencer commands */
|
||||
AppAMPCtrl(AMPCTRL_START, 0); /* Control AMP 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;
|
||||
AppAMPISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
AMPShowResult((float*)AppBuff, temp); /* Show the results to UART */
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<packages/>
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
</device>
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
</component>
|
||||
</components>
|
||||
<apis/>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Amperometric.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Amperometric.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.0</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Amperometric.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Amperometric.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,489 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: Amperometric.c
|
||||
@author: $Author: mlambe $
|
||||
@brief: Amperometric measurement.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2018-03-21 14:09:35 +0100 (Wed, 21 Mar 2018) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
#include "Amperometric.h"
|
||||
|
||||
/*
|
||||
Application configuration structure. Specified by user from template.
|
||||
The variables are usable in this whole application.
|
||||
It includes basic configuration for sequencer generator and application related parameters
|
||||
*/
|
||||
AppAMPCfg_Type AppAMPCfg =
|
||||
{
|
||||
.bParaChanged = bFALSE,
|
||||
.SeqStartAddr = 0,
|
||||
.MaxSeqLen = 0,
|
||||
|
||||
.SeqStartAddrCal = 0,
|
||||
.MaxSeqLenCal = 0,
|
||||
.FifoThresh = 5, /* Number of points for FIFO */
|
||||
|
||||
.SysClkFreq = 16000000.0,
|
||||
.WuptClkFreq = 32000.0,
|
||||
.AdcClkFreq = 16000000.0,
|
||||
.AmpODR = 1.0, /* Sample time in seconds. I.e. every 5 seconds make a measurement */
|
||||
.NumOfData = -1,
|
||||
.RcalVal = 10000.0, /* RCAL = 10kOhm */
|
||||
.PwrMod = AFEPWR_LP,
|
||||
.AMPInited = bFALSE,
|
||||
.StopRequired = bFALSE,
|
||||
|
||||
/* LPTIA Configure */
|
||||
.ExtRtia = bFALSE, /* Set to true if using external RTIA */
|
||||
.LptiaRtiaSel = LPTIARTIA_4K, /* COnfigure RTIA */
|
||||
.LpTiaRf = LPTIARF_1M, /* Configure LPF resistor */
|
||||
.LpTiaRl = LPTIARLOAD_100R,
|
||||
.ReDoRtiaCal = bTRUE,
|
||||
.RtiaCalValue = 0,
|
||||
.ExtRtiaVal = 0,
|
||||
|
||||
/*LPDAC Configure */
|
||||
.Vzero = 1100, /* Sets voltage on SE0 and LPTIA */
|
||||
.SensorBias = 500, /* Sets voltage between RE0 and SE0 */
|
||||
|
||||
/* ADC Configure*/
|
||||
.ADCPgaGain = ADCPGA_1P5,
|
||||
.ADCSinc3Osr = ADCSINC3OSR_4,
|
||||
.ADCSinc2Osr = ADCSINC2OSR_22,
|
||||
.DataFifoSrc = FIFOSRC_SINC2NOTCH,
|
||||
.ADCRefVolt = 1.8162, /* Measure voltage on ADCRefVolt pin and enter here*/
|
||||
};
|
||||
|
||||
/**
|
||||
This function is provided for upper controllers that want to change
|
||||
application parameters specially for user defined parameters.
|
||||
*/
|
||||
AD5940Err AppAMPGetCfg(void *pCfg)
|
||||
{
|
||||
if(pCfg){
|
||||
*(AppAMPCfg_Type**)pCfg = &AppAMPCfg;
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
return AD5940ERR_PARA;
|
||||
}
|
||||
|
||||
AD5940Err AppAMPCtrl(int32_t AmpCtrl, void *pPara)
|
||||
{
|
||||
switch (AmpCtrl)
|
||||
{
|
||||
case AMPCTRL_START:
|
||||
{
|
||||
WUPTCfg_Type wupt_cfg;
|
||||
|
||||
AD5940_ReadReg(REG_AFE_ADCDAT); /* Any SPI Operation can wakeup AFE */
|
||||
if(AppAMPCfg.AMPInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
/* Start it */
|
||||
wupt_cfg.WuptEn = bTRUE;
|
||||
wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
|
||||
wupt_cfg.WuptOrder[0] = SEQID_0;
|
||||
wupt_cfg.SeqxSleepTime[SEQID_0] = 4-1;
|
||||
wupt_cfg.SeqxWakeupTime[SEQID_0] = (uint32_t)(AppAMPCfg.WuptClkFreq*AppAMPCfg.AmpODR)-4-1;
|
||||
AD5940_WUPTCfg(&wupt_cfg);
|
||||
|
||||
AppAMPCfg.FifoDataCount = 0; /* restart */
|
||||
break;
|
||||
}
|
||||
case AMPCTRL_STOPNOW:
|
||||
{
|
||||
AD5940_ReadReg(REG_AFE_ADCDAT); /* Any SPI Operation can wakeup AFE */
|
||||
/* Start Wupt right now */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
/* There is chance this operation will fail because sequencer could put AFE back
|
||||
to hibernate mode just after waking up. Use STOPSYNC is better. */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
break;
|
||||
}
|
||||
case AMPCTRL_STOPSYNC:
|
||||
{
|
||||
AppAMPCfg.StopRequired = bTRUE;
|
||||
break;
|
||||
}
|
||||
case AMPCTRL_SHUTDOWN:
|
||||
{
|
||||
AppAMPCtrl(AMPCTRL_STOPNOW, 0); /* Stop the measurement if it's running. */
|
||||
/* Turn off LPloop related blocks which are not controlled automatically by sleep operation */
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
memset(&aferef_cfg, 0, sizeof(aferef_cfg));
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
memset(&lp_loop, 0, sizeof(lp_loop));
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
AD5940_EnterSleepS(); /* Enter Hibernate */
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Generate init sequence */
|
||||
static AD5940Err AppAMPSeqCfgGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
DSPCfg_Type dsp_cfg;
|
||||
SWMatrixCfg_Type sw_cfg;
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
//AD5940_AFECtrlS(AFECTRL_ALL, bFALSE); /* Init all to disable state */
|
||||
|
||||
aferef_cfg.HpBandgapEn = bTRUE;
|
||||
aferef_cfg.Hp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Hp1V8BuffEn = bTRUE;
|
||||
aferef_cfg.Disc1V1Cap = bFALSE;
|
||||
aferef_cfg.Disc1V8Cap = bFALSE;
|
||||
aferef_cfg.Hp1V8ThemBuff = bFALSE;
|
||||
aferef_cfg.Hp1V8Ilimit = bFALSE;
|
||||
aferef_cfg.Lp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Lp1V8BuffEn = bTRUE;
|
||||
/* LP reference control - turn off them to save power*/
|
||||
aferef_cfg.LpBandgapEn = bTRUE;
|
||||
aferef_cfg.LpRefBufEn = bTRUE;
|
||||
aferef_cfg.LpRefBoostEn = bFALSE;
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
|
||||
lp_loop.LpDacCfg.LpdacSel = LPDAC0;
|
||||
lp_loop.LpDacCfg.LpDacSrc = LPDACSRC_MMR;
|
||||
lp_loop.LpDacCfg.LpDacSW = LPDACSW_VBIAS2LPPA|LPDACSW_VBIAS2PIN|LPDACSW_VZERO2LPTIA|LPDACSW_VZERO2PIN;
|
||||
lp_loop.LpDacCfg.LpDacVzeroMux = LPDACVZERO_6BIT;
|
||||
lp_loop.LpDacCfg.LpDacVbiasMux = LPDACVBIAS_12BIT;
|
||||
lp_loop.LpDacCfg.LpDacRef = LPDACREF_2P5;
|
||||
lp_loop.LpDacCfg.DataRst = bFALSE;
|
||||
lp_loop.LpDacCfg.PowerEn = bTRUE;
|
||||
lp_loop.LpDacCfg.DacData6Bit = (uint32_t)((AppAMPCfg.Vzero-200)/DAC6BITVOLT_1LSB);
|
||||
lp_loop.LpDacCfg.DacData12Bit =(int32_t)((AppAMPCfg.SensorBias)/DAC12BITVOLT_1LSB) + lp_loop.LpDacCfg.DacData6Bit*64;
|
||||
if(lp_loop.LpDacCfg.DacData12Bit>lp_loop.LpDacCfg.DacData6Bit*64)
|
||||
lp_loop.LpDacCfg.DacData12Bit--;
|
||||
lp_loop.LpAmpCfg.LpAmpSel = LPAMP0;
|
||||
lp_loop.LpAmpCfg.LpAmpPwrMod = LPAMPPWR_NORM;
|
||||
lp_loop.LpAmpCfg.LpPaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaRf = AppAMPCfg.LpTiaRf;
|
||||
lp_loop.LpAmpCfg.LpTiaRload = AppAMPCfg.LpTiaRl;
|
||||
if(AppAMPCfg.ExtRtia == bTRUE)
|
||||
{
|
||||
lp_loop.LpAmpCfg.LpTiaRtia = LPTIARTIA_OPEN;
|
||||
lp_loop.LpAmpCfg.LpTiaSW = LPTIASW(9)|LPTIASW(2)|LPTIASW(4)|LPTIASW(5)|LPTIASW(12)|LPTIASW(13);
|
||||
}else
|
||||
{
|
||||
lp_loop.LpAmpCfg.LpTiaRtia = AppAMPCfg.LptiaRtiaSel;
|
||||
lp_loop.LpAmpCfg.LpTiaSW = LPTIASW(5)|LPTIASW(2)|LPTIASW(4)|LPTIASW(12)|LPTIASW(13);
|
||||
}
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
|
||||
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_VZERO0;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_AIN4;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = AppAMPCfg.ADCPgaGain;
|
||||
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
memset(&dsp_cfg.DftCfg, 0, sizeof(dsp_cfg.DftCfg));
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care because it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ; /* Tell filter block clock rate of ADC*/
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppAMPCfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppAMPCfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
|
||||
sw_cfg.Dswitch = 0;
|
||||
sw_cfg.Pswitch = 0;
|
||||
sw_cfg.Nswitch = 0;
|
||||
sw_cfg.Tswitch = 0;
|
||||
AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
|
||||
/* Enable all of them. They are automatically turned off during hibernate mode to save power */
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_AFECtrlS(AFECTRL_SINC2NOTCH, bFALSE);
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
/* Sequence end. */
|
||||
AD5940_SEQGenInsert(SEQ_STOP()); /* Add one extra command to disable sequencer for initialization sequence because we only want it to run one time. */
|
||||
|
||||
/* Stop here */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppAMPCfg.InitSeqInfo.SeqId = SEQID_1;
|
||||
AppAMPCfg.InitSeqInfo.SeqRamAddr = AppAMPCfg.SeqStartAddr;
|
||||
AppAMPCfg.InitSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppAMPCfg.InitSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppAMPCfg.InitSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppAMPSeqMeasureGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
uint32_t WaitClks;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
|
||||
clks_cal.DataType = DATATYPE_SINC2;
|
||||
clks_cal.DataCount = 1;
|
||||
clks_cal.ADCSinc2Osr = AppAMPCfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppAMPCfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppAMPCfg.SysClkFreq/AppAMPCfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
WaitClks += 15;
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
AD5940_SEQGpioCtrlS(AGPIO_Pin2);
|
||||
AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*250)); /* wait 250us */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV, bTRUE); /* Start ADC convert*/
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCPWR|AFECTRL_ADCCNV|AFECTRL_SINC2NOTCH, bFALSE); /* Stop ADC */
|
||||
AD5940_SEQGpioCtrlS(0);
|
||||
AD5940_EnterSleepS();/* Goto hibernate */
|
||||
/* Sequence end. */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppAMPCfg.MeasureSeqInfo.SeqId = SEQID_0;
|
||||
AppAMPCfg.MeasureSeqInfo.SeqRamAddr = AppAMPCfg.InitSeqInfo.SeqRamAddr + AppAMPCfg.InitSeqInfo.SeqLen ;
|
||||
AppAMPCfg.MeasureSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppAMPCfg.MeasureSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppAMPCfg.MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
static AD5940Err AppAMPRtiaCal(void)
|
||||
{
|
||||
fImpPol_Type RtiaCalValue; /* Calibration result */
|
||||
LPRTIACal_Type lprtia_cal;
|
||||
AD5940_StructInit(&lprtia_cal, sizeof(lprtia_cal));
|
||||
|
||||
lprtia_cal.bPolarResult = bTRUE; /* Magnitude + Phase */
|
||||
lprtia_cal.AdcClkFreq = AppAMPCfg.AdcClkFreq;
|
||||
lprtia_cal.SysClkFreq = AppAMPCfg.SysClkFreq;
|
||||
lprtia_cal.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
lprtia_cal.ADCSinc2Osr = ADCSINC2OSR_22; /* Use SINC2 data as DFT data source */
|
||||
lprtia_cal.DftCfg.DftNum = DFTNUM_2048; /* Maximum DFT number */
|
||||
lprtia_cal.DftCfg.DftSrc = DFTSRC_SINC2NOTCH; /* For frequency under 12Hz, need to optimize DFT source. Use SINC3 data as DFT source */
|
||||
lprtia_cal.DftCfg.HanWinEn = bTRUE;
|
||||
lprtia_cal.fFreq = AppAMPCfg.AdcClkFreq/4/22/2048*3; /* Sample 3 period of signal, 13.317Hz here. Do not use DC method, because it needs ADC/PGA calibrated firstly(but it's faster) */
|
||||
lprtia_cal.fRcal = AppAMPCfg.RcalVal;
|
||||
lprtia_cal.LpTiaRtia = AppAMPCfg.LptiaRtiaSel;
|
||||
lprtia_cal.LpAmpPwrMod = LPAMPPWR_NORM;
|
||||
lprtia_cal.bWithCtia = bFALSE;
|
||||
AD5940_LPRtiaCal(&lprtia_cal, &RtiaCalValue);
|
||||
AppAMPCfg.RtiaCalValue = RtiaCalValue;
|
||||
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
/* This function provide application initialize. */
|
||||
AD5940Err AppAMPInit(uint32_t *pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
SEQCfg_Type seq_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB; /* 2kB SRAM is used for sequencer, others for data FIFO */
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Do RTIA calibration */
|
||||
if(((AppAMPCfg.ReDoRtiaCal == bTRUE) || \
|
||||
AppAMPCfg.AMPInited == bFALSE) && AppAMPCfg.ExtRtia == bFALSE) /* Do calibration on the first initializaion */
|
||||
{
|
||||
AppAMPRtiaCal();
|
||||
AppAMPCfg.ReDoRtiaCal = bFALSE;
|
||||
}else
|
||||
AppAMPCfg.RtiaCalValue.Magnitude = AppAMPCfg.ExtRtiaVal;
|
||||
|
||||
/* Reconfigure FIFO */
|
||||
AD5940_FIFOCtrlS(DFTSRC_SINC3, bFALSE); /* Disable FIFO firstly */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = AppAMPCfg.DataFifoSrc;
|
||||
fifo_cfg.FIFOThresh = AppAMPCfg.FifoThresh;
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Start sequence generator */
|
||||
/* Initialize sequencer generator */
|
||||
if((AppAMPCfg.AMPInited == bFALSE)||\
|
||||
(AppAMPCfg.bParaChanged == bTRUE))
|
||||
{
|
||||
if(pBuffer == 0) return AD5940ERR_PARA;
|
||||
if(BufferSize == 0) return AD5940ERR_PARA;
|
||||
AD5940_SEQGenInit(pBuffer, BufferSize);
|
||||
|
||||
/* Generate initialize sequence */
|
||||
error = AppAMPSeqCfgGen(); /* Application initialization sequence using either MCU or sequencer */
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
/* Generate measurement sequence */
|
||||
error = AppAMPSeqMeasureGen();
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
AppAMPCfg.bParaChanged = bFALSE; /* Clear this flag as we already implemented the new configuration */
|
||||
}
|
||||
/* Initialization sequencer */
|
||||
AppAMPCfg.InitSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppAMPCfg.InitSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer */
|
||||
AD5940_SEQMmrTrig(AppAMPCfg.InitSeqInfo.SeqId);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ENDSEQ) == bFALSE);
|
||||
|
||||
/* Measurement sequence */
|
||||
AppAMPCfg.MeasureSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppAMPCfg.MeasureSeqInfo);
|
||||
|
||||
// seq_cfg.SeqEnable = bTRUE;
|
||||
// AD5940_SEQCfg(&seq_cfg); /* Enable sequencer, and wait for trigger */
|
||||
AD5940_SEQCtrlS(bTRUE); /* Enable sequencer, and wait for trigger. It's disabled in initialization sequence */
|
||||
AD5940_ClrMCUIntFlag(); /* Clear interrupt flag generated before */
|
||||
|
||||
AD5940_AFEPwrBW(AppAMPCfg.PwrMod, AFEBW_250KHZ);
|
||||
AppAMPCfg.AMPInited = bTRUE; /* AMP application has been initialized. */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Modify registers when AFE wakeup */
|
||||
static AD5940Err AppAMPRegModify(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
if(AppAMPCfg.NumOfData > 0)
|
||||
{
|
||||
AppAMPCfg.FifoDataCount += *pDataCount/4;
|
||||
if(AppAMPCfg.FifoDataCount >= AppAMPCfg.NumOfData)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
}
|
||||
if(AppAMPCfg.StopRequired == bTRUE)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on the data type, do appropriate data pre-process before return back to controller */
|
||||
static AD5940Err AppAMPDataProcess(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
uint32_t i, datacount;
|
||||
datacount = *pDataCount;
|
||||
float *pOut = (float *)pData;
|
||||
for(i=0;i<datacount;i++)
|
||||
{
|
||||
pData[i] &= 0xffff;
|
||||
pOut[i] = AppAMPCalcCurrent(pData[i]);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
AD5940Err AppAMPISR(void *pBuff, uint32_t *pCount)
|
||||
{
|
||||
uint32_t FifoCnt;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_LOCK);
|
||||
|
||||
*pCount = 0;
|
||||
if(AD5940_INTCTestFlag(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
FifoCnt = AD5940_FIFOGetCnt();
|
||||
AD5940_FIFORd((uint32_t *)pBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
AppAMPRegModify(pBuff, &FifoCnt); /* If there is need to do AFE re-configure, do it here when AFE is in active state */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK);
|
||||
//AD5940_EnterSleepS(); /* Manually put AFE back to hibernate mode. This operation only takes effect when register value is ACTIVE previously */
|
||||
|
||||
/* Process data */
|
||||
AppAMPDataProcess((int32_t*)pBuff,&FifoCnt);
|
||||
*pCount = FifoCnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Calculate voltage */
|
||||
float AppAMPCalcVoltage(uint32_t ADCcode)
|
||||
{
|
||||
float kFactor = 1.835/1.82;
|
||||
float fVolt = 0.0;
|
||||
int32_t tmp = 0;
|
||||
tmp = ADCcode - 32768;
|
||||
switch(AppAMPCfg.ADCPgaGain)
|
||||
{
|
||||
case ADCPGA_1:
|
||||
fVolt = ((float)(tmp)/32768)*(AppAMPCfg.ADCRefVolt/1)*kFactor;
|
||||
break;
|
||||
case ADCPGA_1P5:
|
||||
fVolt = ((float)(tmp)/32768)*(AppAMPCfg.ADCRefVolt/1.5f)*kFactor;
|
||||
break;
|
||||
case ADCPGA_2:
|
||||
fVolt = ((float)(tmp)/32768)*(AppAMPCfg.ADCRefVolt/2)*kFactor;
|
||||
break;
|
||||
case ADCPGA_4:
|
||||
fVolt = ((float)(tmp)/32768)*(AppAMPCfg.ADCRefVolt/4)*kFactor;
|
||||
break;
|
||||
case ADCPGA_9:
|
||||
fVolt = ((float)(tmp)/32768)*(AppAMPCfg.ADCRefVolt/9)*kFactor;
|
||||
break;
|
||||
}
|
||||
return fVolt;
|
||||
}
|
||||
/* Calculate current in uA */
|
||||
float AppAMPCalcCurrent(uint32_t ADCcode)
|
||||
{
|
||||
float fCurrent, fVoltage = 0.0;
|
||||
fVoltage = AppAMPCalcVoltage(ADCcode);
|
||||
fCurrent = fVoltage/AppAMPCfg.RtiaCalValue.Magnitude;
|
||||
|
||||
return -fCurrent*1000000;
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: Amperometric.h
|
||||
@author: $Author: mlambe $
|
||||
@brief: Amperometric measurement header file.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2018-03-21 14:09:35 +0100 (Wed, 21 Mar 2018) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
#ifndef _AMPEROMETRIC_H_
|
||||
#define _AMPEROMETRIC_H_
|
||||
#include "AD5940.H"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
#define DAC12BITVOLT_1LSB (2200.0f/4095) //mV
|
||||
#define DAC6BITVOLT_1LSB (DAC12BITVOLT_1LSB*64) //mV
|
||||
/*
|
||||
Note: this example will use SEQID_0 as measurement sequence, and use SEQID_1 as init sequence.
|
||||
SEQID_3 is used for calibration.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Common configurations for all kinds of Application. */
|
||||
BoolFlag bParaChanged; /* Indicate to generate sequence again. It's auto cleared by AppAMPInit */
|
||||
uint32_t SeqStartAddr; /* Initialaztion sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLen; /* Limit the maximum sequence. */
|
||||
uint32_t SeqStartAddrCal; /* Measurement sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLenCal;
|
||||
|
||||
/* Application related parameters */
|
||||
BoolFlag ReDoRtiaCal; /* Set this flag to bTRUE when there is need to do calibration. */
|
||||
float SysClkFreq; /* The real frequency of system clock */
|
||||
float WuptClkFreq; /* The clock frequency of Wakeup Timer in Hz. Typically it's 32kHz. Leave it here in case we calibrate clock in software method */
|
||||
float AdcClkFreq; /* The real frequency of ADC clock */
|
||||
uint32_t FifoThresh; /* FIFO threshold. Should be N*4 */
|
||||
float AmpODR; /* in Hz. ODR decides the period of WakeupTimer who will trigger sequencer periodically.*/
|
||||
int32_t NumOfData; /* By default it's '-1'. If you want the engine stops after get NumofData, then set the value here. Otherwise, set it to '-1' which means never stop. */
|
||||
float RcalVal; /* Rcal value in Ohm */
|
||||
float ADCRefVolt; /* Measured 1.82 V reference*/
|
||||
uint32_t PwrMod; /* Control Chip power mode(LP/HP) */
|
||||
uint32_t ADCPgaGain; /* PGA Gain select from GNPGA_1, GNPGA_1_5, GNPGA_2, GNPGA_4, GNPGA_9 !!! We must ensure signal is in range of +-1.5V which is limited by ADC input stage */
|
||||
uint8_t ADCSinc3Osr; /* SINC3 OSR selection. ADCSINC3OSR_2, ADCSINC3OSR_4 */
|
||||
uint8_t ADCSinc2Osr; /* SINC2 OSR selection. ADCSINC2OSR_22...ADCSINC2OSR_1333 */
|
||||
uint32_t DataFifoSrc; /* DataFIFO source. FIFOSRC_SINC3, FIFOSRC_DFT, FIFOSRC_SINC2NOTCH, FIFOSRC_VAR, FIFOSRC_MEAN*/
|
||||
uint32_t LptiaRtiaSel; /* Use internal RTIA, select from RTIA_INT_200, RTIA_INT_1K, RTIA_INT_5K, RTIA_INT_10K, RTIA_INT_20K, RTIA_INT_40K, RTIA_INT_80K, RTIA_INT_160K */
|
||||
uint32_t LpTiaRf; /* Rfilter select */
|
||||
uint32_t LpTiaRl; /* SE0 Rload select */
|
||||
fImpPol_Type RtiaCalValue; /* Calibrated Rtia value */
|
||||
float Vzero; /* Voltage on SE0 pin and Vzero, optimumly 1100mV*/
|
||||
float SensorBias; /* Sensor bias voltage = VRE0 - VSE0 */
|
||||
BoolFlag ExtRtia; /* Use internal or external Rtia */
|
||||
float ExtRtiaVal; /* External Rtia value if using one */
|
||||
BoolFlag AMPInited; /* If the program run firstly, generated sequence commands */
|
||||
SEQInfo_Type InitSeqInfo;
|
||||
SEQInfo_Type MeasureSeqInfo;
|
||||
BoolFlag StopRequired; /* After FIFO is ready, stop the measurement sequence */
|
||||
uint32_t FifoDataCount; /* Count how many times impedance have been measured */
|
||||
/* End */
|
||||
}AppAMPCfg_Type;
|
||||
|
||||
/**
|
||||
* int32_t type Impedance result in Cartesian coordinate
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
float Current;
|
||||
float Voltage;
|
||||
}fAmpRes_Type;
|
||||
|
||||
|
||||
|
||||
#define AMPCTRL_START 0
|
||||
#define AMPCTRL_STOPNOW 1
|
||||
#define AMPCTRL_STOPSYNC 2
|
||||
#define AMPCTRL_SHUTDOWN 4 /* Note: shutdown here means turn off everything and put AFE to hibernate mode. The word 'SHUT DOWN' is only used here. */
|
||||
|
||||
AD5940Err AppAMPGetCfg(void *pCfg);
|
||||
AD5940Err AppAMPInit(uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err AppAMPISR(void *pBuff, uint32_t *pCount);
|
||||
AD5940Err AppAMPCtrl(int32_t AmpCtrl, void *pPara);
|
||||
float AppAMPCalcVoltage(uint32_t ADCcode);
|
||||
float AppAMPCalcCurrent(uint32_t ADCcode);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Amperometric.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Amperometric.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Amperometric.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\Amperometric.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.7.6">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@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 Battery_Example
|
||||
* @{
|
||||
*/
|
||||
#include "ad5940.h"
|
||||
#include <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "BATImpedance.h"
|
||||
|
||||
#define APPBUFF_SIZE 512
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
int32_t BATShowResult(uint32_t *pData, uint32_t DataCount)
|
||||
{
|
||||
fImpCar_Type *pImp = (fImpCar_Type*)pData;
|
||||
float freq;
|
||||
AppBATCtrl(BATCTRL_GETFREQ, &freq);
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("Freq: %f (real, image) = ,%f , %f ,mOhm \n",freq, pImp[i].Real,pImp[i].Image);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_1;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC; //on battery board, there is a 32MHz crystal.
|
||||
clk_cfg.HfOSC32MHzMode = bFALSE;
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bFALSE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 4;//AppBATCfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP0_INT|GP2_SYNC;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin2;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter sleep mode. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AD5940BATStructInit(void)
|
||||
{
|
||||
AppBATCfg_Type *pBATCfg;
|
||||
AppBATGetCfg(&pBATCfg);
|
||||
pBATCfg->SeqStartAddr = 0;
|
||||
pBATCfg->MaxSeqLen = 512;
|
||||
pBATCfg->RcalVal = 50.0; /* Value of RCAL on EVAL-AD5941BATZ board is 50mOhm */
|
||||
pBATCfg->ACVoltPP = 300.0f; /* Pk-pk amplitude is 300mV */
|
||||
pBATCfg->DCVolt = 1200.0f; /* Offset voltage of 1.2V*/
|
||||
pBATCfg->DftNum = DFTNUM_8192;
|
||||
|
||||
pBATCfg->FifoThresh = 2; /* 2 results in FIFO, real and imaginary part. */
|
||||
|
||||
pBATCfg->SinFreq = 200; /* Sin wave frequency. THis value has no effect if sweep is enabled */
|
||||
|
||||
pBATCfg->SweepCfg.SweepEn = bTRUE; /* Set to bTRUE to enable sweep function */
|
||||
pBATCfg->SweepCfg.SweepStart = 1.0f; /* Start sweep at 1Hz */
|
||||
pBATCfg->SweepCfg.SweepStop = 50000.0f; /* Finish sweep at 1000Hz */
|
||||
pBATCfg->SweepCfg.SweepPoints = 50; /* 100 frequencies in the sweep */
|
||||
pBATCfg->SweepCfg.SweepLog = bTRUE; /* Set to bTRUE to use LOG scale. Set bFALSE to use linear scale */
|
||||
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
uint32_t temp;
|
||||
AD5940PlatformCfg();
|
||||
|
||||
AD5940BATStructInit(); /* Configure your parameters in this function */
|
||||
|
||||
AppBATInit(AppBuff, APPBUFF_SIZE); /* Initialize BAT application. Provide a buffer, which is used to store sequencer commands */
|
||||
AppBATCtrl(BATCTRL_MRCAL, 0); /* Measur RCAL each point in sweep */
|
||||
AppBATCtrl(BATCTRL_START, 0);
|
||||
while(1)
|
||||
{
|
||||
/* Check if interrupt flag which will be set when interrupt occurred. */
|
||||
if(AD5940_GetMCUIntFlag())
|
||||
{
|
||||
AD5940_ClrMCUIntFlag(); /* Clear this flag */
|
||||
temp = APPBUFF_SIZE;
|
||||
AppBATISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
AD5940_Delay10us(100000);
|
||||
BATShowResult(AppBuff, temp); /* Print measurement results over UART */
|
||||
AD5940_SEQMmrTrig(SEQID_0); /* Trigger next measurement ussing MMR write*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<packages/>
|
||||
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
</device>
|
||||
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
|
||||
<components>
|
||||
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
</components>
|
||||
|
||||
<apis/>
|
||||
|
||||
</configuration>
|
||||
|
||||
|
|
@ -0,0 +1,312 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppBATCfg</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>FifoCnt</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<SystemViewers>
|
||||
<Entry>
|
||||
<Name>System Viewer\GPIO0</Name>
|
||||
<WinId>35905</WinId>
|
||||
</Entry>
|
||||
</SystemViewers>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BATImpedance.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BATImpedance.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.0</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BATImpedance.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BATImpedance.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function is used to set Dn on Arduino shield(and set it to output) */
|
||||
void Arduino_WriteDn(uint32_t Dn, BoolFlag bHigh)
|
||||
{
|
||||
if(Dn&(1<<3)) //set D3, P0.13
|
||||
{
|
||||
pADI_GPIO0->OEN |= 1<<13;
|
||||
if(bHigh)
|
||||
pADI_GPIO0->SET = 1<<13;
|
||||
else
|
||||
pADI_GPIO0->CLR = 1<<13;
|
||||
}
|
||||
if(Dn&(1<<4))//Set D4, P0.9
|
||||
{
|
||||
pADI_GPIO0->OEN |= 1<<9;
|
||||
if(bHigh)
|
||||
pADI_GPIO0->SET = 1<<9;
|
||||
else
|
||||
pADI_GPIO0->CLR = 1<<9;
|
||||
}
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,662 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: BATImpedance.c
|
||||
@author: Neo Xu
|
||||
@brief: Battery impedance measurement sequences.
|
||||
-----------------------------------------------------------------------------
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
#include "BATImpedance.h"
|
||||
|
||||
/*
|
||||
Application configuration structure. Specified by user from template.
|
||||
The variables are usable in this whole application.
|
||||
It includes basic configuration for sequencer generator and application related parameters
|
||||
*/
|
||||
AppBATCfg_Type AppBATCfg =
|
||||
{
|
||||
.state = STATE_IDLE,
|
||||
.bParaChanged = bFALSE,
|
||||
.SeqStartAddr = 0,
|
||||
.MaxSeqLen = 0,
|
||||
|
||||
.SeqStartAddrCal = 0,
|
||||
.MaxSeqLenCal = 0,
|
||||
|
||||
.SysClkFreq = 16000000.0,
|
||||
.WuptClkFreq = 32000.0,
|
||||
.AdcClkFreq = 16000000.0,
|
||||
.BatODR = 20.0, /* 20.0 Hz*/
|
||||
.NumOfData = -1,
|
||||
|
||||
.PwrMod = AFEPWR_LP,
|
||||
.ACVoltPP = 800.0,
|
||||
.DCVolt = 1100.0f,
|
||||
.SinFreq = 50000.0, /* 50kHz */
|
||||
.RcalVal = 50.0, /* 50mOhm */
|
||||
|
||||
.ADCSinc3Osr = ADCSINC3OSR_4,
|
||||
.ADCSinc2Osr = ADCSINC2OSR_22,
|
||||
|
||||
.DftNum = DFTNUM_16384,
|
||||
.DftSrc = DFTSRC_SINC3,
|
||||
.HanWinEn = bTRUE,
|
||||
|
||||
.FifoThresh = 4,
|
||||
.BATInited = bFALSE,
|
||||
.StopRequired = bFALSE,
|
||||
.MeasSeqCycleCount = 0,
|
||||
|
||||
.SweepCfg.SweepEn = bTRUE,
|
||||
.SweepCfg.SweepStart = 1000,
|
||||
.SweepCfg.SweepStop = 100000.0,
|
||||
.SweepCfg.SweepPoints = 101,
|
||||
.SweepCfg.SweepLog = bFALSE,
|
||||
.SweepCfg.SweepIndex = 0,
|
||||
};
|
||||
|
||||
/**
|
||||
This function is provided for upper controllers that want to change
|
||||
application parameters specially for user defined parameters.
|
||||
*/
|
||||
AD5940Err AppBATGetCfg(void *pCfg)
|
||||
{
|
||||
if(pCfg){
|
||||
*(AppBATCfg_Type**)pCfg = &AppBATCfg;
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
return AD5940ERR_PARA;
|
||||
}
|
||||
|
||||
|
||||
static void PreCharge(unsigned char channel)
|
||||
{
|
||||
void Arduino_WriteDn(uint32_t Dn, BoolFlag bHigh);
|
||||
switch(channel)
|
||||
{
|
||||
case PRECHARGE_CH1: //00
|
||||
Arduino_WriteDn(1<<3, bFALSE); //d3
|
||||
Arduino_WriteDn(1<<4, bFALSE); //d4
|
||||
break;
|
||||
case PRECHARGE_CH2: //01
|
||||
Arduino_WriteDn(1<<3, bTRUE);
|
||||
Arduino_WriteDn(1<<4, bFALSE);
|
||||
break;
|
||||
case PRECHARGE_CH3://10
|
||||
Arduino_WriteDn(1<<3, bFALSE);
|
||||
Arduino_WriteDn(1<<4, bTRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
AD5940_Delay10us(PRECHARGE_WAIT_MS*100);
|
||||
Arduino_WriteDn(1<<3, bTRUE); //d3
|
||||
Arduino_WriteDn(1<<4, bTRUE); //d4
|
||||
}
|
||||
|
||||
AD5940Err AppBATCtrl(int32_t BatCtrl, void *pPara)
|
||||
{
|
||||
switch (BatCtrl)
|
||||
{
|
||||
case BATCTRL_START:
|
||||
{
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
if(AppBATCfg.BATInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
AD5940_WriteReg(REG_AFE_SWMUX, 1<<0); /* control ADG636 to measure battery */
|
||||
AD5940_WriteReg(REG_AFE_SYNCEXTDEVICE, 0x0);
|
||||
PreCharge(PRECHARGE_BAT);
|
||||
PreCharge(PRECHARGE_AMP);
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE);
|
||||
AD5940_FIFOThrshSet(AppBATCfg.FifoThresh); /* DFT result contains both real and image. */
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bTRUE);
|
||||
AppBATCfg.state = STATE_BATTERY;
|
||||
/* Trigger sequence using MMR write */
|
||||
AD5940_SEQMmrTrig(SEQID_0);
|
||||
AppBATCfg.FifoDataCount = 0; /* restart */
|
||||
|
||||
break;
|
||||
}
|
||||
case BATCTRL_STOPNOW:
|
||||
{
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
/* Start Wupt right now */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
/* There is chance this operation will fail because sequencer could put AFE back
|
||||
to hibernate mode just after waking up. Use STOPSYNC is better. */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
break;
|
||||
}
|
||||
case BATCTRL_STOPSYNC:
|
||||
{
|
||||
AppBATCfg.StopRequired = bTRUE;
|
||||
break;
|
||||
}
|
||||
case BATCTRL_GETFREQ:
|
||||
if(pPara)
|
||||
{
|
||||
if(AppBATCfg.SweepCfg.SweepEn == bTRUE)
|
||||
*(float*)pPara = AppBATCfg.FreqofData;
|
||||
else
|
||||
*(float*)pPara = AppBATCfg.SinFreq;
|
||||
}
|
||||
break;
|
||||
case BATCTRL_SHUTDOWN:
|
||||
{
|
||||
AppBATCtrl(BATCTRL_STOPNOW, 0); /* Stop the measurement if it's running. */
|
||||
/* Turn off LPloop related blocks which are not controlled automatically by sleep operation */
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
memset(&aferef_cfg, 0, sizeof(aferef_cfg));
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
memset(&lp_loop, 0, sizeof(lp_loop));
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
AD5940_EnterSleepS(); /* Enter Hibernate */
|
||||
}
|
||||
break;
|
||||
case BATCTRL_MRCAL:
|
||||
if(AD5940_WakeUp(10) > 10)
|
||||
return AD5940ERR_WAKEUP;
|
||||
//Settle input RC filter.
|
||||
AD5940_WriteReg(REG_AFE_SWMUX, 0); //control ADG636 to measure rcal
|
||||
AD5940_WriteReg(REG_AFE_SYNCEXTDEVICE, 0x4);
|
||||
PreCharge(PRECHARGE_RCAL);
|
||||
PreCharge(PRECHARGE_AMP);
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE);
|
||||
AD5940_FIFOThrshSet(2);
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bTRUE); //enable FIFO
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
|
||||
AFECTRL_WG|AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
|
||||
AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_Delay10us(10000);
|
||||
AppBATMeasureRCAL();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Generate init sequence */
|
||||
static AD5940Err AppBATSeqCfgGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
HSLoopCfg_Type hs_loop;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
DSPCfg_Type dsp_cfg;
|
||||
float sin_freq;
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
AD5940_AFECtrlS(AFECTRL_ALL, bFALSE); /* Disable all firstly. */
|
||||
aferef_cfg.HpBandgapEn = bTRUE;
|
||||
aferef_cfg.Hp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Hp1V8BuffEn = bTRUE;
|
||||
aferef_cfg.Disc1V1Cap = bFALSE;
|
||||
aferef_cfg.Disc1V8Cap = bFALSE;
|
||||
aferef_cfg.Hp1V8ThemBuff = bFALSE;
|
||||
aferef_cfg.Hp1V8Ilimit = bFALSE;
|
||||
aferef_cfg.Lp1V1BuffEn = bFALSE;
|
||||
aferef_cfg.Lp1V8BuffEn = bFALSE;
|
||||
/* LP reference control, Use LP loop to provide DC Bias voltage. */
|
||||
aferef_cfg.LpBandgapEn = bTRUE;
|
||||
aferef_cfg.LpRefBufEn = bTRUE;
|
||||
aferef_cfg.LpRefBoostEn = bFALSE;
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
/* Determine buffer gain according to ACVoltPP */
|
||||
hs_loop.HsDacCfg.ExcitBufGain = EXCITBUFGAIN_2;
|
||||
hs_loop.HsDacCfg.HsDacGain = HSDACGAIN_1;
|
||||
hs_loop.HsDacCfg.HsDacUpdateRate = 0x1B; //the maximum update rate is 16MHz/7
|
||||
|
||||
hs_loop.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hs_loop.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hs_loop.HsTiaCfg.HstiaCtia = 31; //HSTIA is not used.
|
||||
hs_loop.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaRtiaSel = HSTIARTIA_10K;
|
||||
|
||||
hs_loop.SWMatCfg.Dswitch = SWD_CE0;
|
||||
hs_loop.SWMatCfg.Pswitch = SWP_AIN1;
|
||||
hs_loop.SWMatCfg.Nswitch = SWN_AIN0; //AIN0 is connected to AIN4 externally by JP3.
|
||||
hs_loop.SWMatCfg.Tswitch = 0; //T switch is not used.
|
||||
|
||||
hs_loop.WgCfg.WgType = WGTYPE_SIN;
|
||||
hs_loop.WgCfg.GainCalEn = bFALSE;
|
||||
hs_loop.WgCfg.OffsetCalEn = bFALSE;
|
||||
if(AppBATCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBATCfg.FreqofData = AppBATCfg.SweepCfg.SweepStart;
|
||||
AppBATCfg.SweepCurrFreq = AppBATCfg.SweepCfg.SweepStart;
|
||||
AD5940_SweepNext(&AppBATCfg.SweepCfg, &AppBATCfg.SweepNextFreq);
|
||||
sin_freq = AppBATCfg.SweepCurrFreq;
|
||||
}
|
||||
else
|
||||
{
|
||||
sin_freq = AppBATCfg.SinFreq;
|
||||
AppBATCfg.FreqofData = sin_freq;
|
||||
}
|
||||
hs_loop.WgCfg.SinCfg.SinFreqWord = AD5940_WGFreqWordCal(sin_freq, AppBATCfg.SysClkFreq);
|
||||
hs_loop.WgCfg.SinCfg.SinAmplitudeWord = (uint32_t)(AppBATCfg.ACVoltPP/800.0f*2047 + 0.5f);
|
||||
hs_loop.WgCfg.SinCfg.SinOffsetWord = 0;
|
||||
hs_loop.WgCfg.SinCfg.SinPhaseWord = 0;
|
||||
AD5940_HSLoopCfgS(&hs_loop);
|
||||
//Use LP loop to output bias voltage on AIN4 pin, which provides voltage on AIN0(N switch).
|
||||
lp_loop.LpDacCfg.LpdacSel = LPDAC0;
|
||||
lp_loop.LpDacCfg.LpDacSrc = LPDACSRC_MMR;
|
||||
lp_loop.LpDacCfg.LpDacSW = LPDACSW_VZERO2LPTIA|LPDACSW_VZERO2PIN;
|
||||
lp_loop.LpDacCfg.LpDacVzeroMux = LPDACVZERO_12BIT;
|
||||
lp_loop.LpDacCfg.LpDacVbiasMux = LPDACVBIAS_6BIT;
|
||||
lp_loop.LpDacCfg.LpDacRef = LPDACREF_2P5;
|
||||
lp_loop.LpDacCfg.DataRst = bFALSE;
|
||||
lp_loop.LpDacCfg.PowerEn = bTRUE;
|
||||
lp_loop.LpDacCfg.DacData12Bit = (uint32_t)((AppBATCfg.DCVolt-200)/2200.0f*4095);
|
||||
lp_loop.LpDacCfg.DacData6Bit = 31; //not used. Set it to middle value.
|
||||
|
||||
lp_loop.LpAmpCfg.LpAmpSel = LPAMP0;
|
||||
lp_loop.LpAmpCfg.LpAmpPwrMod = LPAMPPWR_NORM;
|
||||
lp_loop.LpAmpCfg.LpPaPwrEn = bFALSE;
|
||||
lp_loop.LpAmpCfg.LpTiaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaRf = LPTIARF_20K; //External cap is 1uF.
|
||||
lp_loop.LpAmpCfg.LpTiaRload = LPTIARLOAD_SHORT;
|
||||
lp_loop.LpAmpCfg.LpTiaRtia = LPTIARTIA_OPEN;
|
||||
lp_loop.LpAmpCfg.LpTiaSW = LPTIASW(7)|LPTIASW(5)|LPTIASW(9);
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_AIN2;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_AIN3;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = ADCPGA_1P5;
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care because it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppBATCfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppBATCfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
dsp_cfg.DftCfg.DftNum = AppBATCfg.DftNum;
|
||||
dsp_cfg.DftCfg.DftSrc = AppBATCfg.DftSrc;
|
||||
dsp_cfg.DftCfg.HanWinEn = AppBATCfg.HanWinEn;
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
/* Enable all of them. They are automatically turned off during hibernate mode to save power */
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
|
||||
AFECTRL_WG|AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
|
||||
AFECTRL_SINC2NOTCH, bTRUE);
|
||||
/* Sequence end. */
|
||||
AD5940_SEQGenInsert(SEQ_STOP()); /* Add one external command to disable sequencer for initialization sequence because we only want it to run one time. */
|
||||
|
||||
/* Stop here */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBATCfg.InitSeqInfo.SeqId = SEQID_1;
|
||||
AppBATCfg.InitSeqInfo.SeqRamAddr = AppBATCfg.SeqStartAddr;
|
||||
AppBATCfg.InitSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBATCfg.InitSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBATCfg.InitSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
//the sequence used to measure battery response voltage.
|
||||
static AD5940Err AppBATSeqMeasureGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
uint32_t WaitClks;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = AppBATCfg.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(AppBATCfg.DftNum+2); /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = AppBATCfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppBATCfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBATCfg.SysClkFreq/AppBATCfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*250)); /* wait 250us for reference power up from hibernate mode. */
|
||||
AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*50000)); /* Wait for ADC ready. */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT/*|AFECTRL_WG*/|AFECTRL_ADCPWR|AFECTRL_SINC2NOTCH, bFALSE); /* Stop ADC convert and DFT */
|
||||
//AD5940_EnterSleepS();/* Goto hibernate */
|
||||
/* Sequence end. */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
|
||||
AppBATCfg.MeasSeqCycleCount = AD5940_SEQCycleTime();
|
||||
AppBATCfg.MaxODR = 1/(((AppBATCfg.MeasSeqCycleCount + 10) / 16.0)* 1E-6) ;
|
||||
if(AppBATCfg.BatODR > AppBATCfg.MaxODR)
|
||||
{
|
||||
/* We have requested a sampling rate that cannot be achieved with the time it
|
||||
takes to acquire a sample.
|
||||
*/
|
||||
AppBATCfg.BatODR = AppBATCfg.MaxODR;
|
||||
}
|
||||
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBATCfg.MeasureSeqInfo.SeqId = SEQID_0;
|
||||
AppBATCfg.MeasureSeqInfo.SeqRamAddr = AppBATCfg.InitSeqInfo.SeqRamAddr + AppBATCfg.InitSeqInfo.SeqLen ;
|
||||
AppBATCfg.MeasureSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBATCfg.MeasureSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBATCfg.MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* This function provide application initialize. */
|
||||
AD5940Err AppBATInit(uint32_t *pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
SEQCfg_Type seq_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB; /* 2kB SRAM is used for sequencer, others for data FIFO */
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Reconfigure FIFO */
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE); /* Disable FIFO firstly */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = AppBATCfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Start sequence generator */
|
||||
/* Initialize sequencer generator */
|
||||
if((AppBATCfg.BATInited == bFALSE)||\
|
||||
(AppBATCfg.bParaChanged == bTRUE))
|
||||
{
|
||||
if(pBuffer == 0) return AD5940ERR_PARA;
|
||||
if(BufferSize == 0) return AD5940ERR_PARA;
|
||||
AD5940_SEQGenInit(pBuffer, BufferSize);
|
||||
/* Generate initialize sequence */
|
||||
error = AppBATSeqCfgGen(); /* Application initialization sequence using either MCU or sequencer */
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
/* Generate measurement sequence */
|
||||
error = AppBATSeqMeasureGen();
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
AppBATCfg.bParaChanged = bFALSE; /* Clear this flag as we already implemented the new configuration */
|
||||
}
|
||||
/* Initialization sequencer */
|
||||
AppBATCfg.InitSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBATCfg.InitSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer */
|
||||
AD5940_SEQMmrTrig(AppBATCfg.InitSeqInfo.SeqId);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ENDSEQ) == bFALSE);
|
||||
|
||||
if(AppBATCfg.SweepCfg.SweepEn == bTRUE)
|
||||
AppBATCheckFreq(AppBATCfg.SweepCfg.SweepStart);
|
||||
else
|
||||
AppBATCheckFreq(AppBATCfg.SinFreq);
|
||||
/* Measurement sequence */
|
||||
AppBATCfg.MeasureSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBATCfg.MeasureSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer, and wait for trigger */
|
||||
AD5940_ClrMCUIntFlag(); /* Clear interrupt flag generated before */
|
||||
AD5940_AFEPwrBW(AppBATCfg.PwrMod, AFEBW_250KHZ);
|
||||
AD5940_WriteReg(REG_AFE_SWMUX, 1<<1);
|
||||
AppBATCfg.BATInited = bTRUE; /* BAT application has been initialized. */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on frequency of Sin wave set optimum filter settings */
|
||||
AD5940Err AppBATCheckFreq(float freq)
|
||||
{
|
||||
DSPCfg_Type dsp_cfg;
|
||||
uint32_t WaitClks;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
uint32_t SeqCmdBuff[2];
|
||||
uint32_t SRAMAddr = 0;;
|
||||
/* Step 1: Check Frequency */
|
||||
if(freq < 0.51)
|
||||
{
|
||||
AppBATCfg.ADCSinc2Osr = ADCSINC2OSR_1067;
|
||||
AppBATCfg.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
AppBATCfg.DftSrc = DFTSRC_SINC2NOTCH;
|
||||
}else if(freq < 5 )
|
||||
{
|
||||
AppBATCfg.ADCSinc2Osr = ADCSINC2OSR_640;
|
||||
AppBATCfg.ADCSinc3Osr= ADCSINC3OSR_4;
|
||||
AppBATCfg.DftSrc = DFTSRC_SINC2NOTCH;
|
||||
}else if(freq <450)
|
||||
{
|
||||
AppBATCfg.ADCSinc2Osr = ADCSINC2OSR_178;
|
||||
AppBATCfg.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
AppBATCfg.DftSrc = DFTSRC_SINC2NOTCH;
|
||||
}else if(freq < 80000)
|
||||
{
|
||||
AppBATCfg.ADCSinc3Osr = ADCSINC3OSR_4;
|
||||
AppBATCfg.ADCSinc2Osr = ADCSINC2OSR_178;
|
||||
AppBATCfg.DftSrc = DFTSRC_SINC3;
|
||||
}
|
||||
/* Step 2: Adjust ADCFILTERCON */
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_AIN2;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_AIN3;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = ADCPGA_1P5;
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care because it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppBATCfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppBATCfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
dsp_cfg.DftCfg.DftNum = AppBATCfg.DftNum;
|
||||
dsp_cfg.DftCfg.DftSrc = AppBATCfg.DftSrc;
|
||||
dsp_cfg.DftCfg.HanWinEn = AppBATCfg.HanWinEn;
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
|
||||
/* Step 3: Calculate clocks needed to get result to FIFO and update sequencer wait command */
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = AppBATCfg.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(AppBATCfg.DftNum+2); /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = AppBATCfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppBATCfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBATCfg.SysClkFreq/AppBATCfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
/* Find start address of sequence in SRAM
|
||||
Update WaitClks */
|
||||
SRAMAddr = AppBATCfg.MeasureSeqInfo.SeqRamAddr;
|
||||
SeqCmdBuff[0] = SEQ_WAIT(WaitClks);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+4, SeqCmdBuff, 1);
|
||||
|
||||
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Modify registers when AFE wakeup */
|
||||
static AD5940Err AppBATRegModify(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
if(AppBATCfg.NumOfData > 0)
|
||||
{
|
||||
AppBATCfg.FifoDataCount += *pDataCount/4;
|
||||
if(AppBATCfg.FifoDataCount >= AppBATCfg.NumOfData)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
}
|
||||
if(AppBATCfg.StopRequired == bTRUE)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
if(AppBATCfg.SweepCfg.SweepEn) /* Need to set new frequency and set power mode */
|
||||
{
|
||||
AD5940_WGFreqCtrlS(AppBATCfg.SweepNextFreq, AppBATCfg.SysClkFreq);
|
||||
AppBATCheckFreq(AppBATCfg.SweepNextFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on the data type, do appropriate data pre-process before return back to controller */
|
||||
static AD5940Err AppBATDataProcess(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
uint32_t DataCount = *pDataCount;
|
||||
uint32_t DftResCount = DataCount/2;
|
||||
|
||||
fImpCar_Type * const pOut = (fImpCar_Type*)pData;
|
||||
iImpCar_Type * pSrcData = (iImpCar_Type*)pData;
|
||||
|
||||
*pDataCount = 0;
|
||||
DataCount = (DataCount/2)*2; /* We expect both Real and imaginary result. */
|
||||
|
||||
/* Convert DFT result to int32_t type */
|
||||
for(uint32_t i=0; i<DataCount; i++)
|
||||
{
|
||||
pData[i] &= 0x3ffff;
|
||||
if(pData[i]&(1<<17)) /* Bit17 is sign bit */
|
||||
{
|
||||
pData[i] |= 0xfffc0000; /* Data is 18bit in two's complement, bit17 is the sign bit */
|
||||
}
|
||||
}
|
||||
if(AppBATCfg.state == STATE_RCAL)
|
||||
{
|
||||
/* Calculate the average voltage. */
|
||||
AppBATCfg.RcalVolt.Image = 0;
|
||||
AppBATCfg.RcalVolt.Real = 0;
|
||||
for(uint32_t i=0;i<DftResCount;i++)
|
||||
{
|
||||
AppBATCfg.RcalVolt.Real += pSrcData[i].Real;
|
||||
AppBATCfg.RcalVolt.Image += pSrcData[i].Image;
|
||||
}
|
||||
AppBATCfg.RcalVolt.Real /= DftResCount;
|
||||
AppBATCfg.RcalVolt.Image /= DftResCount;
|
||||
*pDataCount = 0; /* Report no result to upper application */
|
||||
}
|
||||
else if(AppBATCfg.state == STATE_BATTERY)
|
||||
{
|
||||
for(uint32_t i=0; i<DftResCount; i++)
|
||||
{
|
||||
fImpCar_Type BatImp, BatVolt;
|
||||
BatVolt.Real = pSrcData->Real;
|
||||
BatVolt.Image = pSrcData->Image;
|
||||
pSrcData ++;
|
||||
BatImp = AD5940_ComplexDivFloat(&BatVolt, &AppBATCfg.RcalVolt); //ratio measurement, Zbat = Vbat/Vrcal * Rcal;
|
||||
BatImp.Image *= AppBATCfg.RcalVal;
|
||||
BatImp.Real *= AppBATCfg.RcalVal;
|
||||
pOut[i] = BatImp;
|
||||
// printf("i: %d , %.2f , %.2f , %.2f , %.2f , %.2f , %.2f , %.2f\n",AppBATCfg.SweepCfg.SweepIndex, AppBATCfg.SweepCurrFreq, BatImp.Real, BatImp.Image, AppBATCfg.RcalVolt.Real, AppBATCfg.RcalVolt.Image, AppBATCfg.RcalVoltTable[AppBATCfg.SweepCfg.SweepIndex][0], AppBATCfg.RcalVoltTable[AppBATCfg.SweepCfg.SweepIndex][1]);
|
||||
}
|
||||
*pDataCount = DftResCount;
|
||||
}
|
||||
/* Calculate next frequency point */
|
||||
if(AppBATCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBATCfg.FreqofData = AppBATCfg.SweepCurrFreq;
|
||||
AppBATCfg.SweepCurrFreq = AppBATCfg.SweepNextFreq;
|
||||
if(AppBATCfg.state == STATE_BATTERY)
|
||||
{
|
||||
AppBATCfg.RcalVolt.Real = AppBATCfg.RcalVoltTable[AppBATCfg.SweepCfg.SweepIndex][0];
|
||||
AppBATCfg.RcalVolt.Image = AppBATCfg.RcalVoltTable[AppBATCfg.SweepCfg.SweepIndex][1];
|
||||
}
|
||||
AD5940_SweepNext(&AppBATCfg.SweepCfg, &AppBATCfg.SweepNextFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
AD5940Err AppBATISR(void *pBuff, uint32_t *pCount)
|
||||
{
|
||||
uint32_t FifoCnt;
|
||||
if(AppBATCfg.BATInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_LOCK); /* Don't enter hibernate */
|
||||
*pCount = 0;
|
||||
|
||||
if(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
/* Now there should be 2 data in FIFO */
|
||||
FifoCnt = (AD5940_FIFOGetCnt()/2)*2;
|
||||
AD5940_FIFORd((uint32_t *)pBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
AppBATRegModify(pBuff, &FifoCnt); /* If there is need to do AFE re-configure, do it here when AFE is in active state */
|
||||
//AD5940_EnterSleepS(); /* Manually put AFE back to hibernate mode. */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter hibernate mode */
|
||||
/* Process data */
|
||||
AppBATDataProcess((int32_t*)pBuff,&FifoCnt);
|
||||
*pCount = FifoCnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AD5940Err AppBATMeasureRCAL(void)
|
||||
{
|
||||
uint32_t buff[100];
|
||||
uint32_t temp;
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bFALSE); /* Disable INT0 interrupt for RCAL measurement. */
|
||||
AppBATCfg.state = STATE_RCAL;
|
||||
if(AppBATCfg.SweepCfg.SweepEn)
|
||||
{
|
||||
uint32_t i;
|
||||
for(i=0;i<AppBATCfg.SweepCfg.SweepPoints;i++)
|
||||
{
|
||||
AD5940_SEQMmrTrig(SEQID_0);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_DATAFIFOTHRESH) == bFALSE);
|
||||
printf("i: %d Freq: %.2f ",AppBATCfg.SweepCfg.SweepIndex, AppBATCfg.SweepCurrFreq);
|
||||
AppBATISR(buff, &temp);
|
||||
AppBATCfg.RcalVoltTable[i][0] = AppBATCfg.RcalVolt.Real;
|
||||
AppBATCfg.RcalVoltTable[i][1] = AppBATCfg.RcalVolt.Image;
|
||||
printf(" RcalVolt:(%f,%f)\n", AppBATCfg.RcalVoltTable[i][0], AppBATCfg.RcalVoltTable[i][1]);
|
||||
AD5940_Delay10us(10000);
|
||||
}
|
||||
AppBATCfg.RcalVolt.Real = AppBATCfg.RcalVoltTable[0][0];
|
||||
AppBATCfg.RcalVolt.Image = AppBATCfg.RcalVoltTable[0][1];
|
||||
}else
|
||||
{
|
||||
AD5940_SEQMmrTrig(SEQID_0);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_DATAFIFOTHRESH) == bFALSE);
|
||||
AppBATISR(buff, &temp);
|
||||
}
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
/*!
|
||||
@file: BATImpedance.h
|
||||
@author: $Author: nxu2 $
|
||||
@brief: Battery impedance measurement header file.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _BAT_IMPEDANCE_H_
|
||||
#define _BAT_IMPEDANCE_H_
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
#define PRECHARGE_WAIT_MS 4000 //precharge time in ms.
|
||||
|
||||
#define PRECHARGE_CH1 1
|
||||
#define PRECHARGE_CH2 2
|
||||
#define PRECHARGE_CH3 3
|
||||
|
||||
#define PRECHARGE_RCAL PRECHARGE_CH1
|
||||
#define PRECHARGE_BAT PRECHARGE_CH2
|
||||
#define PRECHARGE_AMP PRECHARGE_CH3
|
||||
/*
|
||||
Note: this example will use SEQID_0 as measurement sequence, and use SEQID_1 as init sequence.
|
||||
SEQID_3 is used for calibration.
|
||||
*/
|
||||
|
||||
#define STATE_IDLE 0 /**< Initial state. */
|
||||
#define STATE_RCAL 1 /**< Measure Rcal response voltage. */
|
||||
#define STATE_BATTERY 2 /**< Measure battery response voltage. */
|
||||
typedef struct
|
||||
{
|
||||
/* Common configurations for all kinds of Application. */
|
||||
uint32_t state; /* 0: Init, 1: measure Rcal, 2: Measure Battery. */
|
||||
BoolFlag bParaChanged; /* Indicate to generate sequence again. It's auto cleared by AppBATInit */
|
||||
BoolFlag bDoCal; /* Need to do calibration. */
|
||||
uint32_t SeqStartAddr; /* Initialaztion sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLen; /* Limit the maximum sequence. */
|
||||
uint32_t SeqStartAddrCal; /* Measurement sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLenCal;
|
||||
/* Application related parameters */
|
||||
float SysClkFreq; /* The real frequency of system clock */
|
||||
float WuptClkFreq; /* The clock frequency of Wakeup Timer in Hz. Typically it's 32kHz. Leave it here in case we calibrate clock in software method */
|
||||
float AdcClkFreq; /* The real frequency of ADC clock */
|
||||
uint32_t FifoThresh; /* FIFO threshold. Should be N*4 */
|
||||
float BatODR; /* in Hz. ODR decides the period of WakeupTimer who will trigger sequencer periodically. DFT number and sample frequency decides the maxim ODR. */
|
||||
int32_t NumOfData; /* By default it's '-1'. If you want the engine stops after get NumofData, then set the value here. Otherwise, set it to '-1' which means never stop. */
|
||||
uint32_t PwrMod; /* Control Chip power mode(LP/HP) */
|
||||
float ACVoltPP; /* Final AC excitation voltage on pin AIN1 in mV peak to peak unit. */
|
||||
float DCVolt; /* The DC bias voltage on AIN1 pin. Unit is mV. */
|
||||
float RcalVal; /* Rcal value in mOhm */
|
||||
float SinFreq; /* Frequency of excitation signal */
|
||||
uint8_t ADCSinc3Osr; /* SINC3 OSR selection. ADCSINC3OSR_2, ADCSINC3OSR_4 */
|
||||
uint8_t ADCSinc2Osr; /* SINC2 OSR selection. ADCSINC2OSR_22...ADCSINC2OSR_1333 */
|
||||
uint32_t DftNum; /* DFT number */
|
||||
uint32_t DftSrc; /* DFT Source */
|
||||
BoolFlag HanWinEn; /* Enable Hanning window */
|
||||
/* Sweep Function Control */
|
||||
SoftSweepCfg_Type SweepCfg;
|
||||
/* Private variables for internal usage */
|
||||
float SweepCurrFreq;
|
||||
float SweepNextFreq;
|
||||
float FreqofData;
|
||||
BoolFlag BATInited; /* If the program run firstly, generated sequence commands */
|
||||
SEQInfo_Type InitSeqInfo;
|
||||
SEQInfo_Type MeasureSeqInfo;
|
||||
BoolFlag StopRequired; /* After FIFO is ready, stop the measurement sequence */
|
||||
uint32_t FifoDataCount; /* Count how many times impedance have been measured */
|
||||
uint32_t MeasSeqCycleCount; /* How long the measurement sequence will take */
|
||||
float MaxODR; /* Max ODR for sampling in this config */
|
||||
fImpCar_Type RcalVolt; /* The measured Rcal resistor(R1) response voltage. */
|
||||
float RcalVoltTable[100][2];
|
||||
/* End */
|
||||
}AppBATCfg_Type;
|
||||
|
||||
#define BATCTRL_START 0
|
||||
#define BATCTRL_STOPNOW 1
|
||||
#define BATCTRL_STOPSYNC 2
|
||||
#define BATCTRL_SHUTDOWN 4 /* Note: shutdown here means turn off everything and put AFE to hibernate mode. The word 'SHUT DOWN' is only used here. */
|
||||
#define BATCTRL_MRCAL 5 /* Measure RCAL response voltage */
|
||||
#define BATCTRL_GETFREQ 6
|
||||
|
||||
AD5940Err AppBATGetCfg(void *pCfg);
|
||||
AD5940Err AppBATInit(uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err AppBATISR(void *pBuff, uint32_t *pCount);
|
||||
AD5940Err AppBATCtrl(int32_t BatCtrl, void *pPara);
|
||||
AD5940Err AppBATCheckFreq(float freq);
|
||||
AD5940Err AppBATMeasureRCAL(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BATImpedance.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BATImpedance.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BATImpedance.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BATImpedance.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.2" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.7.6">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define ARDUINO_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define ARDUINO_D4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
#define ARDUINO_D3_PIN GPIO_PIN_3
|
||||
#define ARDUINO_D3_PORT GPIOB
|
||||
#define ARDUINO_D4_PIN GPIO_PIN_5
|
||||
#define ARDUINO_D4_PORT GPIOB
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function is used to set Dn on Arduino shield(and set it to output) */
|
||||
void Arduino_WriteDn(uint32_t Dn, BoolFlag bHigh)
|
||||
{
|
||||
if(Dn&(1<<3)) //set D3, P0.13
|
||||
{
|
||||
if(bHigh)
|
||||
HAL_GPIO_WritePin(ARDUINO_D3_PORT, ARDUINO_D3_PIN, GPIO_PIN_SET);
|
||||
else
|
||||
HAL_GPIO_WritePin(ARDUINO_D3_PORT, ARDUINO_D3_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
if(Dn&(1<<4))//Set D4, P0.9
|
||||
{
|
||||
if(bHigh)
|
||||
HAL_GPIO_WritePin(ARDUINO_D4_PORT, ARDUINO_D4_PIN, GPIO_PIN_SET);
|
||||
else
|
||||
HAL_GPIO_WritePin(ARDUINO_D4_PORT, ARDUINO_D4_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
|
||||
//D3 D4 GPIO
|
||||
ARDUINO_D3_GPIO_CLK_ENABLE();
|
||||
ARDUINO_D4_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = ARDUINO_D3_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(ARDUINO_D3_PORT, &GPIO_InitStruct);
|
||||
GPIO_InitStruct.Pin = ARDUINO_D4_PIN;
|
||||
HAL_GPIO_Init(ARDUINO_D4_PORT, &GPIO_InitStruct);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,158 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@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 <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "BodyImpedance.h"
|
||||
|
||||
#define APPBUFF_SIZE 512
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
int32_t BIAShowResult(uint32_t *pData, uint32_t DataCount)
|
||||
{
|
||||
float freq;
|
||||
|
||||
fImpPol_Type *pImp = (fImpPol_Type*)pData;
|
||||
AppBIACtrl(BIACTRL_GETFREQ, &freq);
|
||||
|
||||
printf("Freq:%.2f ", freq);
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("RzMag: %f Ohm , RzPhase: %f \n",pImp[i].Magnitude,pImp[i].Phase*180/MATH_PI);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_1;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
|
||||
clk_cfg.HfOSC32MHzMode = bFALSE;
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bFALSE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 4;//AppBIACfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP4_SYNC|GP2_TRIG|GP1_SYNC|GP0_INT;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter sleep mode. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940BIAStructInit(void)
|
||||
{
|
||||
AppBIACfg_Type *pBIACfg;
|
||||
|
||||
AppBIAGetCfg(&pBIACfg);
|
||||
|
||||
pBIACfg->SeqStartAddr = 0;
|
||||
pBIACfg->MaxSeqLen = 512; /** @todo add checker in function */
|
||||
|
||||
pBIACfg->RcalVal = 10000.0;
|
||||
pBIACfg->DftNum = DFTNUM_8192;
|
||||
pBIACfg->NumOfData = -1; /* Never stop until you stop it manually by AppBIACtrl() function */
|
||||
pBIACfg->BiaODR = 20; /* ODR(Sample Rate) 20Hz */
|
||||
pBIACfg->FifoThresh = 4; /* 4 */
|
||||
pBIACfg->ADCSinc3Osr = ADCSINC3OSR_2;
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
static uint32_t IntCount;
|
||||
static uint32_t count;
|
||||
uint32_t temp;
|
||||
|
||||
AD5940PlatformCfg();
|
||||
|
||||
AD5940BIAStructInit(); /* Configure your parameters in this function */
|
||||
|
||||
AppBIAInit(AppBuff, APPBUFF_SIZE); /* Initialize BIA application. Provide a buffer, which is used to store sequencer commands */
|
||||
AppBIACtrl(BIACTRL_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())
|
||||
{
|
||||
IntCount++;
|
||||
AD5940_ClrMCUIntFlag(); /* Clear this flag */
|
||||
temp = APPBUFF_SIZE;
|
||||
AppBIAISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
BIAShowResult(AppBuff, temp); /* Show the results to UART */
|
||||
|
||||
if(IntCount == 240)
|
||||
{
|
||||
IntCount = 0;
|
||||
//AppBIACtrl(BIACTRL_SHUTDOWN, 0);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
if(count > 1000000)
|
||||
{
|
||||
count = 0;
|
||||
//AppBIAInit(0, 0); /* Re-initialize BIA application. Because sequences are ready, no need to provide a buffer, which is used to store sequencer commands */
|
||||
//AppBIACtrl(BIACTRL_START, 0); /* Control BIA measurement to start. Second parameter has no meaning with this command. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BodyImpedance.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BodyImpedance.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,505 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::..\..\Program Files (x86)\ARM_Compiler_5.06u7</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.1</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BodyImpedance.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BodyImpedance.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,609 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: BodyComposition.c
|
||||
@author: Neo Xu
|
||||
@brief: BIA measurement sequences.
|
||||
-----------------------------------------------------------------------------
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
#include "BodyImpedance.h"
|
||||
|
||||
/*
|
||||
Application configuration structure. Specified by user from template.
|
||||
The variables are usable in this whole application.
|
||||
It includes basic configuration for sequencer generator and application related parameters
|
||||
*/
|
||||
AppBIACfg_Type AppBIACfg =
|
||||
{
|
||||
.bParaChanged = bFALSE,
|
||||
.SeqStartAddr = 0,
|
||||
.MaxSeqLen = 0,
|
||||
|
||||
.SeqStartAddrCal = 0,
|
||||
.MaxSeqLenCal = 0,
|
||||
|
||||
.ReDoRtiaCal = bFALSE,
|
||||
.SysClkFreq = 16000000.0,
|
||||
.WuptClkFreq = 32000.0,
|
||||
.AdcClkFreq = 16000000.0,
|
||||
.BiaODR = 20.0, /* 20.0 Hz*/
|
||||
.NumOfData = -1,
|
||||
.RcalVal = 10000.0, /* 10kOhm */
|
||||
|
||||
.PwrMod = AFEPWR_LP,
|
||||
.HstiaRtiaSel = HSTIARTIA_1K,
|
||||
.CtiaSel = 16,
|
||||
.ExcitBufGain = EXCITBUFGAIN_2,
|
||||
.HsDacGain = HSDACGAIN_1,
|
||||
.HsDacUpdateRate = 7,
|
||||
.DacVoltPP = 800.0,
|
||||
|
||||
.SinFreq = 50000.0, /* 50kHz */
|
||||
|
||||
.ADCPgaGain = ADCPGA_1,
|
||||
.ADCSinc3Osr = ADCSINC3OSR_2,
|
||||
.ADCSinc2Osr = ADCSINC2OSR_22,
|
||||
|
||||
.DftNum = DFTNUM_8192,
|
||||
.DftSrc = DFTSRC_SINC3,
|
||||
.HanWinEn = bTRUE,
|
||||
|
||||
.SweepCfg.SweepEn = bFALSE,
|
||||
.SweepCfg.SweepStart = 10000,
|
||||
.SweepCfg.SweepStop = 150000.0,
|
||||
.SweepCfg.SweepPoints = 100,
|
||||
.SweepCfg.SweepLog = bTRUE,
|
||||
.SweepCfg.SweepIndex = 0,
|
||||
|
||||
.FifoThresh = 4,
|
||||
.BIAInited = bFALSE,
|
||||
.StopRequired = bFALSE,
|
||||
.MeasSeqCycleCount = 0,
|
||||
};
|
||||
|
||||
/**
|
||||
This function is provided for upper controllers that want to change
|
||||
application parameters specially for user defined parameters.
|
||||
*/
|
||||
AD5940Err AppBIAGetCfg(void *pCfg)
|
||||
{
|
||||
if(pCfg){
|
||||
*(AppBIACfg_Type**)pCfg = &AppBIACfg;
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
return AD5940ERR_PARA;
|
||||
}
|
||||
|
||||
AD5940Err AppBIACtrl(int32_t BcmCtrl, void *pPara)
|
||||
{
|
||||
switch (BcmCtrl)
|
||||
{
|
||||
case BIACTRL_START:
|
||||
{
|
||||
WUPTCfg_Type wupt_cfg;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
if(AppBIACfg.BIAInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
/* Start it */
|
||||
wupt_cfg.WuptEn = bTRUE;
|
||||
wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
|
||||
wupt_cfg.WuptOrder[0] = SEQID_0;
|
||||
wupt_cfg.SeqxSleepTime[SEQID_0] = (uint32_t)(AppBIACfg.WuptClkFreq/AppBIACfg.BiaODR)-2-1;
|
||||
wupt_cfg.SeqxWakeupTime[SEQID_0] = 1; /* The minimum value is 1. Do not set it to zero. Set it to 1 will spend 2 32kHz clock. */
|
||||
AD5940_WUPTCfg(&wupt_cfg);
|
||||
|
||||
AppBIACfg.FifoDataCount = 0; /* restart */
|
||||
break;
|
||||
}
|
||||
case BIACTRL_STOPNOW:
|
||||
{
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
/* Start Wupt right now */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
/* There is chance this operation will fail because sequencer could put AFE back
|
||||
to hibernate mode just after waking up. Use STOPSYNC is better. */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
break;
|
||||
}
|
||||
case BIACTRL_STOPSYNC:
|
||||
{
|
||||
AppBIACfg.StopRequired = bTRUE;
|
||||
break;
|
||||
}
|
||||
case BIACTRL_GETFREQ:
|
||||
if(pPara)
|
||||
{
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
*(float*)pPara = AppBIACfg.FreqofData;
|
||||
else
|
||||
*(float*)pPara = AppBIACfg.SinFreq;
|
||||
}
|
||||
break;
|
||||
case BIACTRL_SHUTDOWN:
|
||||
{
|
||||
AppBIACtrl(BIACTRL_STOPNOW, 0); /* Stop the measurement if it's running. */
|
||||
/* Turn off LPloop related blocks which are not controlled automatically by sleep operation */
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
memset(&aferef_cfg, 0, sizeof(aferef_cfg));
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
memset(&lp_loop, 0, sizeof(lp_loop));
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
AD5940_EnterSleepS(); /* Enter Hibernate */
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Generate init sequence */
|
||||
static AD5940Err AppBIASeqCfgGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
HSLoopCfg_Type hs_loop;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
DSPCfg_Type dsp_cfg;
|
||||
float sin_freq;
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
//AD5940_AFECtrlS(AFECTRL_ALL, bFALSE); /* Init all to disable state */
|
||||
|
||||
aferef_cfg.HpBandgapEn = bTRUE;
|
||||
aferef_cfg.Hp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Hp1V8BuffEn = bTRUE;
|
||||
aferef_cfg.Disc1V1Cap = bFALSE;
|
||||
aferef_cfg.Disc1V8Cap = bFALSE;
|
||||
aferef_cfg.Hp1V8ThemBuff = bFALSE;
|
||||
aferef_cfg.Hp1V8Ilimit = bFALSE;
|
||||
aferef_cfg.Lp1V1BuffEn = bFALSE;
|
||||
aferef_cfg.Lp1V8BuffEn = bFALSE;
|
||||
/* LP reference control - turn off them to save power*/
|
||||
aferef_cfg.LpBandgapEn = bTRUE;
|
||||
aferef_cfg.LpRefBufEn = bTRUE;
|
||||
aferef_cfg.LpRefBoostEn = bFALSE;
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
hs_loop.HsDacCfg.ExcitBufGain = AppBIACfg.ExcitBufGain;
|
||||
hs_loop.HsDacCfg.HsDacGain = AppBIACfg.HsDacGain;
|
||||
hs_loop.HsDacCfg.HsDacUpdateRate = AppBIACfg.HsDacUpdateRate;
|
||||
|
||||
hs_loop.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hs_loop.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hs_loop.HsTiaCfg.HstiaCtia = AppBIACfg.CtiaSel; /* 31pF + 2pF */
|
||||
hs_loop.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaRtiaSel = AppBIACfg.HstiaRtiaSel;
|
||||
|
||||
hs_loop.SWMatCfg.Dswitch = SWD_OPEN;
|
||||
hs_loop.SWMatCfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
hs_loop.SWMatCfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
hs_loop.SWMatCfg.Tswitch = SWT_TRTIA;
|
||||
|
||||
hs_loop.WgCfg.WgType = WGTYPE_SIN;
|
||||
hs_loop.WgCfg.GainCalEn = bFALSE;
|
||||
hs_loop.WgCfg.OffsetCalEn = bFALSE;
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIACfg.SweepCfg.SweepIndex = 0;
|
||||
AppBIACfg.FreqofData = AppBIACfg.SweepCfg.SweepStart;
|
||||
AppBIACfg.SweepCurrFreq = AppBIACfg.SweepCfg.SweepStart;
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &AppBIACfg.SweepNextFreq);
|
||||
sin_freq = AppBIACfg.SweepCurrFreq;
|
||||
}
|
||||
else
|
||||
{
|
||||
sin_freq = AppBIACfg.SinFreq;
|
||||
AppBIACfg.FreqofData = sin_freq;
|
||||
}
|
||||
hs_loop.WgCfg.SinCfg.SinFreqWord = AD5940_WGFreqWordCal(sin_freq, AppBIACfg.SysClkFreq);
|
||||
hs_loop.WgCfg.SinCfg.SinAmplitudeWord = (uint32_t)(AppBIACfg.DacVoltPP/800.0f*2047 + 0.5f);
|
||||
hs_loop.WgCfg.SinCfg.SinOffsetWord = 0;
|
||||
hs_loop.WgCfg.SinCfg.SinPhaseWord = 0;
|
||||
AD5940_HSLoopCfgS(&hs_loop);
|
||||
|
||||
lp_loop.LpDacCfg.LpdacSel = LPDAC0;
|
||||
lp_loop.LpDacCfg.LpDacSrc = LPDACSRC_MMR;
|
||||
lp_loop.LpDacCfg.LpDacSW = LPDACSW_VBIAS2LPPA|LPDACSW_VBIAS2PIN|LPDACSW_VZERO2LPTIA|LPDACSW_VZERO2PIN;
|
||||
lp_loop.LpDacCfg.LpDacVzeroMux = LPDACVZERO_6BIT;
|
||||
lp_loop.LpDacCfg.LpDacVbiasMux = LPDACVBIAS_12BIT;
|
||||
lp_loop.LpDacCfg.LpDacRef = LPDACREF_2P5;
|
||||
lp_loop.LpDacCfg.DataRst = bFALSE;
|
||||
lp_loop.LpDacCfg.PowerEn = bTRUE;
|
||||
lp_loop.LpDacCfg.DacData12Bit = (uint32_t)((1100-200)/2200.0*4095);
|
||||
lp_loop.LpDacCfg.DacData6Bit = 31;
|
||||
|
||||
lp_loop.LpAmpCfg.LpAmpSel = LPAMP0;
|
||||
lp_loop.LpAmpCfg.LpAmpPwrMod = LPAMPPWR_NORM;
|
||||
lp_loop.LpAmpCfg.LpPaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaRf = LPTIARF_20K;
|
||||
lp_loop.LpAmpCfg.LpTiaRload = LPTIARLOAD_SHORT;
|
||||
lp_loop.LpAmpCfg.LpTiaRtia = LPTIARTIA_OPEN;
|
||||
lp_loop.LpAmpCfg.LpTiaSW = LPTIASW(5)|LPTIASW(6)|LPTIASW(7)|LPTIASW(8)|LPTIASW(9)|LPTIASW(12)|LPTIASW(13); /** @todo Optimization needed for new silicon */
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_HSTIA_N;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_HSTIA_P;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = AppBIACfg.ADCPgaGain;
|
||||
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care because it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ; /* Tell filter block clock rate of ADC*/
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
dsp_cfg.DftCfg.DftNum = AppBIACfg.DftNum;
|
||||
dsp_cfg.DftCfg.DftSrc = AppBIACfg.DftSrc;
|
||||
dsp_cfg.DftCfg.HanWinEn = AppBIACfg.HanWinEn;
|
||||
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
|
||||
/* Enable all of them. They are automatically turned off during hibernate mode to save power */
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_HSTIAPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
|
||||
AFECTRL_WG|AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
|
||||
AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
/* Sequence end. */
|
||||
AD5940_SEQGenInsert(SEQ_STOP()); /* Add one extra command to disable sequencer for initialization sequence because we only want it to run one time. */
|
||||
|
||||
/* Stop here */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIACfg.InitSeqInfo.SeqId = SEQID_1;
|
||||
AppBIACfg.InitSeqInfo.SeqRamAddr = AppBIACfg.SeqStartAddr;
|
||||
AppBIACfg.InitSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIACfg.InitSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIACfg.InitSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIASeqMeasureGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
uint32_t WaitClks;
|
||||
SWMatrixCfg_Type sw_cfg;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = AppBIACfg.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(AppBIACfg.DftNum+2); /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBIACfg.SysClkFreq/AppBIACfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
AD5940_SEQGpioCtrlS(AGPIO_Pin6/*|AGPIO_Pin5|AGPIO_Pin1*/);//GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*250)); /* @todo wait 250us?? */
|
||||
sw_cfg.Dswitch = SWD_CE0;
|
||||
sw_cfg.Pswitch = SWP_CE0;
|
||||
sw_cfg.Nswitch = SWN_AIN1;
|
||||
sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;
|
||||
AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
|
||||
AD5940_ADCMuxCfgS(ADCMUXP_HSTIA_P, ADCMUXN_HSTIA_N);
|
||||
AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
|
||||
AD5940_ADCMuxCfgS(ADCMUXP_AIN3, ADCMUXN_AIN2);
|
||||
AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*50)); //delay for signal settling DFT_WAIT
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
|
||||
sw_cfg.Dswitch = SWD_OPEN;
|
||||
sw_cfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
sw_cfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
sw_cfg.Tswitch = SWT_TRTIA;
|
||||
AD5940_SWMatrixCfgS(&sw_cfg); /* Float switches */
|
||||
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
AD5940_EnterSleepS();/* Goto hibernate */
|
||||
/* Sequence end. */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */
|
||||
|
||||
AppBIACfg.MeasSeqCycleCount = AD5940_SEQCycleTime();
|
||||
AppBIACfg.MaxODR = 1/(((AppBIACfg.MeasSeqCycleCount + 10) / 16.0)* 1E-6) ;
|
||||
if(AppBIACfg.BiaODR > AppBIACfg.MaxODR)
|
||||
{
|
||||
/* We have requested a sampling rate that cannot be achieved with the time it
|
||||
takes to acquire a sample.
|
||||
*/
|
||||
AppBIACfg.BiaODR = AppBIACfg.MaxODR;
|
||||
}
|
||||
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIACfg.MeasureSeqInfo.SeqId = SEQID_0;
|
||||
AppBIACfg.MeasureSeqInfo.SeqRamAddr = AppBIACfg.InitSeqInfo.SeqRamAddr + AppBIACfg.InitSeqInfo.SeqLen ;
|
||||
AppBIACfg.MeasureSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIACfg.MeasureSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIACfg.MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIARtiaCal(void)
|
||||
{
|
||||
HSRTIACal_Type hsrtia_cal;
|
||||
|
||||
hsrtia_cal.AdcClkFreq = AppBIACfg.AdcClkFreq;
|
||||
hsrtia_cal.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
hsrtia_cal.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
hsrtia_cal.bPolarResult = bTRUE; /* We need magnitude and phase here */
|
||||
hsrtia_cal.DftCfg.DftNum = AppBIACfg.DftNum;
|
||||
hsrtia_cal.DftCfg.DftSrc = AppBIACfg.DftSrc;
|
||||
hsrtia_cal.DftCfg.HanWinEn = AppBIACfg.HanWinEn;
|
||||
hsrtia_cal.fRcal= AppBIACfg.RcalVal;
|
||||
hsrtia_cal.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hsrtia_cal.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hsrtia_cal.HsTiaCfg.HstiaCtia = AppBIACfg.CtiaSel;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_TODE;
|
||||
hsrtia_cal.HsTiaCfg.HstiaRtiaSel = AppBIACfg.HstiaRtiaSel;
|
||||
hsrtia_cal.SysClkFreq = AppBIACfg.SysClkFreq;
|
||||
hsrtia_cal.fFreq = AppBIACfg.SweepCfg.SweepStart;
|
||||
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
uint32_t i;
|
||||
AppBIACfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
for(i=0;i<AppBIACfg.SweepCfg.SweepPoints;i++)
|
||||
{
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, AppBIACfg.RtiaCalTable[i]);
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("Freq:%.2f, RTIA: Mag:%f Ohm, Phase:%.3f\n", hsrtia_cal.fFreq, AppBIACfg.RtiaCalTable[i][0], AppBIACfg.RtiaCalTable[i][1]);
|
||||
#endif
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &hsrtia_cal.fFreq);
|
||||
}
|
||||
AppBIACfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
AppBIACfg.RtiaCurrValue[0] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][0];
|
||||
AppBIACfg.RtiaCurrValue[1] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][1];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
hsrtia_cal.fFreq = AppBIACfg.SinFreq;
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, AppBIACfg.RtiaCurrValue);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* This function provide application initialize. */
|
||||
AD5940Err AppBIAInit(uint32_t *pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
SEQCfg_Type seq_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB; /* 2kB SRAM is used for sequencer, others for data FIFO */
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Do RTIA calibration */
|
||||
|
||||
if((AppBIACfg.ReDoRtiaCal == bTRUE) || \
|
||||
AppBIACfg.BIAInited == bFALSE) /* Do calibration on the first initializaion */
|
||||
{
|
||||
AppBIARtiaCal();
|
||||
AppBIACfg.ReDoRtiaCal = bFALSE;
|
||||
}
|
||||
/* Reconfigure FIFO */
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE); /* Disable FIFO firstly */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = AppBIACfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Start sequence generator */
|
||||
/* Initialize sequencer generator */
|
||||
if((AppBIACfg.BIAInited == bFALSE)||\
|
||||
(AppBIACfg.bParaChanged == bTRUE))
|
||||
{
|
||||
if(pBuffer == 0) return AD5940ERR_PARA;
|
||||
if(BufferSize == 0) return AD5940ERR_PARA;
|
||||
AD5940_SEQGenInit(pBuffer, BufferSize);
|
||||
|
||||
/* Generate initialize sequence */
|
||||
error = AppBIASeqCfgGen(); /* Application initialization sequence using either MCU or sequencer */
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
/* Generate measurement sequence */
|
||||
error = AppBIASeqMeasureGen();
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
AppBIACfg.bParaChanged = bFALSE; /* Clear this flag as we already implemented the new configuration */
|
||||
}
|
||||
|
||||
/* Initialization sequencer */
|
||||
AppBIACfg.InitSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIACfg.InitSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer */
|
||||
AD5940_SEQMmrTrig(AppBIACfg.InitSeqInfo.SeqId);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ENDSEQ) == bFALSE);
|
||||
|
||||
/* Measurement sequence */
|
||||
AppBIACfg.MeasureSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIACfg.MeasureSeqInfo);
|
||||
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer, and wait for trigger */
|
||||
AD5940_ClrMCUIntFlag(); /* Clear interrupt flag generated before */
|
||||
|
||||
AD5940_AFEPwrBW(AppBIACfg.PwrMod, AFEBW_250KHZ);
|
||||
AD5940_WriteReg(REG_AFE_SWMUX, 1<<3);
|
||||
AppBIACfg.BIAInited = bTRUE; /* BIA application has been initialized. */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Modify registers when AFE wakeup */
|
||||
static AD5940Err AppBIARegModify(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
if(AppBIACfg.NumOfData > 0)
|
||||
{
|
||||
AppBIACfg.FifoDataCount += *pDataCount/4;
|
||||
if(AppBIACfg.FifoDataCount >= AppBIACfg.NumOfData)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
}
|
||||
if(AppBIACfg.StopRequired == bTRUE)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
if(AppBIACfg.SweepCfg.SweepEn) /* Need to set new frequency and set power mode */
|
||||
{
|
||||
AD5940_WGFreqCtrlS(AppBIACfg.SweepNextFreq, AppBIACfg.SysClkFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on the data type, do appropriate data pre-process before return back to controller */
|
||||
static AD5940Err AppBIADataProcess(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
uint32_t DataCount = *pDataCount;
|
||||
uint32_t ImpResCount = DataCount/4;
|
||||
|
||||
fImpPol_Type * const pOut = (fImpPol_Type*)pData;
|
||||
iImpCar_Type * pSrcData = (iImpCar_Type*)pData;
|
||||
|
||||
*pDataCount = 0;
|
||||
|
||||
DataCount = (DataCount/4)*4;/* We expect RCAL data together with Rz data. One DFT result has two data in FIFO, real part and imaginary part. */
|
||||
|
||||
/* Convert DFT result to int32_t type */
|
||||
for(uint32_t i=0; i<DataCount; i++)
|
||||
{
|
||||
pData[i] &= 0x3ffff; /* @todo option to check ECC */
|
||||
if(pData[i]&(1<<17)) /* Bit17 is sign bit */
|
||||
{
|
||||
pData[i] |= 0xfffc0000; /* Data is 18bit in two's complement, bit17 is the sign bit */
|
||||
}
|
||||
}
|
||||
for(uint32_t i=0; i<ImpResCount; i++)
|
||||
{
|
||||
iImpCar_Type *pDftVolt, *pDftCurr;
|
||||
|
||||
pDftCurr = pSrcData++;
|
||||
pDftVolt = pSrcData++;
|
||||
float VoltMag,VoltPhase;
|
||||
float CurrMag, CurrPhase;
|
||||
|
||||
VoltMag = sqrt((float)pDftVolt->Real*pDftVolt->Real+(float)pDftVolt->Image*pDftVolt->Image);
|
||||
VoltPhase = atan2(-pDftVolt->Image,pDftVolt->Real);
|
||||
CurrMag = sqrt((float)pDftCurr->Real*pDftCurr->Real+(float)pDftCurr->Image*pDftCurr->Image);
|
||||
CurrPhase = atan2(-pDftCurr->Image,pDftCurr->Real);
|
||||
|
||||
VoltMag = VoltMag/CurrMag*AppBIACfg.RtiaCurrValue[0];
|
||||
VoltPhase = VoltPhase - CurrPhase + AppBIACfg.RtiaCurrValue[1];
|
||||
|
||||
pOut[i].Magnitude = VoltMag;
|
||||
pOut[i].Phase = VoltPhase;
|
||||
}
|
||||
*pDataCount = ImpResCount;
|
||||
/* Calculate next frequency point */
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIACfg.FreqofData = AppBIACfg.SweepCurrFreq;
|
||||
AppBIACfg.SweepCurrFreq = AppBIACfg.SweepNextFreq;
|
||||
AppBIACfg.RtiaCurrValue[0] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][0];
|
||||
AppBIACfg.RtiaCurrValue[1] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][1];
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &AppBIACfg.SweepNextFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
AD5940Err AppBIAISR(void *pBuff, uint32_t *pCount)
|
||||
{
|
||||
uint32_t BuffCount;
|
||||
uint32_t FifoCnt;
|
||||
BuffCount = *pCount;
|
||||
if(AppBIACfg.BIAInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_LOCK); /* Don't enter hibernate */
|
||||
*pCount = 0;
|
||||
|
||||
if(AD5940_INTCTestFlag(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
/* Now there should be 4 data in FIFO */
|
||||
FifoCnt = (AD5940_FIFOGetCnt()/4)*4;
|
||||
|
||||
if(FifoCnt > BuffCount)
|
||||
{
|
||||
///@todo buffer is limited.
|
||||
}
|
||||
AD5940_FIFORd((uint32_t *)pBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
AppBIARegModify(pBuff, &FifoCnt); /* If there is need to do AFE re-configure, do it here when AFE is in active state */
|
||||
//AD5940_EnterSleepS(); /* Manually put AFE back to hibernate mode. */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter hibernate mode */
|
||||
/* Process data */
|
||||
AppBIADataProcess((int32_t*)pBuff,&FifoCnt);
|
||||
*pCount = FifoCnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/*!
|
||||
@file: ImpSeqs.h
|
||||
@author: $Author: nxu2 $
|
||||
@brief: 4-wire BIA measurement header file.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _BODYCOMPOSITION_H_
|
||||
#define _BODYCOMPOSITION_H_
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
#define MAXSWEEP_POINTS 100 /* Need to know how much buffer is needed to save RTIA calibration result */
|
||||
|
||||
/*
|
||||
Note: this example will use SEQID_0 as measurement sequence, and use SEQID_1 as init sequence.
|
||||
SEQID_3 is used for calibration.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Common configurations for all kinds of Application. */
|
||||
BoolFlag bParaChanged; /* Indicate to generate sequence again. It's auto cleared by AppBIAInit */
|
||||
uint32_t SeqStartAddr; /* Initialaztion sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLen; /* Limit the maximum sequence. */
|
||||
uint32_t SeqStartAddrCal; /* Measurement sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLenCal;
|
||||
/* Application related parameters */
|
||||
//BoolFlag bBioElecBoard; /* The code is same for BioElec board and AD5941Sens1 board. No changes are needed */
|
||||
BoolFlag ReDoRtiaCal; /* Set this flag to bTRUE when there is need to do calibration. */
|
||||
float SysClkFreq; /* The real frequency of system clock */
|
||||
float WuptClkFreq; /* The clock frequency of Wakeup Timer in Hz. Typically it's 32kHz. Leave it here in case we calibrate clock in software method */
|
||||
float AdcClkFreq; /* The real frequency of ADC clock */
|
||||
uint32_t FifoThresh; /* FIFO threshold. Should be N*4 */
|
||||
float BiaODR; /* in Hz. ODR decides the period of WakeupTimer who will trigger sequencer periodically. DFT number and sample frequency decides the maxim ODR. */
|
||||
int32_t NumOfData; /* By default it's '-1'. If you want the engine stops after get NumofData, then set the value here. Otherwise, set it to '-1' which means never stop. */
|
||||
float SinFreq; /* Frequency of excitation signal */
|
||||
float RcalVal; /* Rcal value in Ohm */
|
||||
uint32_t PwrMod; /* Control Chip power mode(LP/HP) */
|
||||
float DacVoltPP; /* Final excitation voltage is DAC_VOLTpp*DAC_PGA*EXCIT_GAIN, DAC_PGA= 1 or 0.2, EXCIT_GAIN=2 or 0.25. DAC output voltage in mV peak to peak. Maximum value is 800mVpp. Peak to peak voltage */
|
||||
uint32_t ExcitBufGain; /* Select from EXCITBUFGAIN_2, EXCITBUFGAIN_0P25 */
|
||||
uint32_t HsDacGain; /* Select from HSDACGAIN_1, HSDACGAIN_0P2 */
|
||||
uint32_t HsDacUpdateRate; /* DAC update rate is SystemCLoock/Divider. The available value is 7 to 255. Set to 7 for better performance */
|
||||
uint32_t ADCPgaGain; /* PGA Gain select from GNPGA_1, GNPGA_1_5, GNPGA_2, GNPGA_4, GNPGA_9 !!! We must ensure signal is in range of +-1.5V which is limited by ADC input stage */
|
||||
uint8_t ADCSinc3Osr; /* SINC3 OSR selection. ADCSINC3OSR_2, ADCSINC3OSR_4 */
|
||||
uint8_t ADCSinc2Osr; /* SINC2 OSR selection. ADCSINC2OSR_22...ADCSINC2OSR_1333 */
|
||||
uint32_t HstiaRtiaSel; /* Use internal RTIA, select from RTIA_INT_200, RTIA_INT_1K, RTIA_INT_5K, RTIA_INT_10K, RTIA_INT_20K, RTIA_INT_40K, RTIA_INT_80K, RTIA_INT_160K */
|
||||
uint32_t CtiaSel; /* Select CTIA in pF unit from 0 to 31pF */
|
||||
|
||||
uint32_t DftNum; /* DFT number */
|
||||
uint32_t DftSrc; /* DFT Source */
|
||||
BoolFlag HanWinEn; /* Enable Hanning window */
|
||||
|
||||
/* Sweep Function Control */
|
||||
SoftSweepCfg_Type SweepCfg;
|
||||
/* Private variables for internal usage */
|
||||
float SweepCurrFreq;
|
||||
float SweepNextFreq;
|
||||
float RtiaCurrValue[2]; /* Calibrated Rtia value of current frequency */
|
||||
float RtiaCalTable[MAXSWEEP_POINTS][2]; /* Calibrated Rtia Value table */
|
||||
float FreqofData; /* The frequency of latest data sampled */
|
||||
BoolFlag BIAInited; /* If the program run firstly, generated sequence commands */
|
||||
SEQInfo_Type InitSeqInfo;
|
||||
SEQInfo_Type MeasureSeqInfo;
|
||||
BoolFlag StopRequired; /* After FIFO is ready, stop the measurement sequence */
|
||||
uint32_t FifoDataCount; /* Count how many times impedance have been measured */
|
||||
uint32_t MeasSeqCycleCount; /* How long the measurement sequence will take */
|
||||
float MaxODR; /* Max ODR for sampling in this config */
|
||||
/* End */
|
||||
}AppBIACfg_Type;
|
||||
|
||||
#define BIACTRL_START 0
|
||||
#define BIACTRL_STOPNOW 1
|
||||
#define BIACTRL_STOPSYNC 2
|
||||
#define BIACTRL_GETFREQ 3 /* Get Current frequency of returned data from ISR */
|
||||
#define BIACTRL_SHUTDOWN 4 /* Note: shutdown here means turn off everything and put AFE to hibernate mode. The word 'SHUT DOWN' is only used here. */
|
||||
|
||||
AD5940Err AppBIAGetCfg(void *pCfg);
|
||||
AD5940Err AppBIAInit(uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err AppBIAISR(void *pBuff, uint32_t *pCount);
|
||||
AD5940Err AppBIACtrl(int32_t BcmCtrl, void *pPara);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BodyImpedance.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BodyImpedance.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BodyImpedance.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BodyImpedance.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.2" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.7.6">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940Main.c
|
||||
@author: ADI
|
||||
@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 BIA_Pro_Example
|
||||
* @{
|
||||
*/
|
||||
#include "ad5940.h"
|
||||
#include "AD5940.h"
|
||||
#include <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "BodyImpedance-HiZ_Electrodes.h"
|
||||
|
||||
#define APPBUFF_SIZE 512
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
|
||||
#define REAL_IMAG 0
|
||||
#define MAG_PAHSE 1
|
||||
|
||||
#define REAL_IMAG_OR_MAG_PAHSE MAG_PAHSE /*SKR you can chose what you want to print*/
|
||||
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
int32_t BIAShowResult(uint32_t *pData, uint32_t DataCount)
|
||||
{
|
||||
float freq;
|
||||
|
||||
fImpCar_Type *pImp = (fImpCar_Type*)pData;
|
||||
AppBIACtrl(BIACTRL_GETFREQ, &freq);
|
||||
|
||||
printf("Freq:%.2f, ", freq);
|
||||
/*Process data*/
|
||||
|
||||
#if REAL_IMAG_OR_MAG_PAHSE == REAL_IMAG
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
for(int jj=0;jj<5;jj++)
|
||||
{
|
||||
printf("%.2f,%.2f, ",pImp[(i*5)+jj].Real,pImp[(i*5)+jj].Image);
|
||||
}
|
||||
printf("\r\n");
|
||||
|
||||
}
|
||||
|
||||
#elif REAL_IMAG_OR_MAG_PAHSE == MAG_PAHSE
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
for(int jj=0;jj<5;jj++)
|
||||
{
|
||||
printf("%f,%f, ",sqrt(pImp[(i*5)+jj].Real*pImp[(i*5)+jj].Real+pImp[(i*5)+jj].Image*pImp[(i*5)+jj].Image),atan2(pImp[(i*5)+jj].Image,pImp[(i*5)+jj].Real)*180/MATH_PI);
|
||||
}
|
||||
printf("\r\n");
|
||||
|
||||
}
|
||||
#else
|
||||
#error wrong value
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = SYSCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_2;
|
||||
clk_cfg.SysClkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.HfOSC32MHzMode = bTRUE;
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bTRUE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 12;//AppBIACfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP4_SYNC|GP2_TRIG|GP1_SYNC|GP0_INT;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940BIAStructInit(void)
|
||||
{
|
||||
AppBIACfg_Type *pBIACfg;
|
||||
|
||||
AppBIAGetCfg(&pBIACfg);
|
||||
|
||||
pBIACfg->AdcClkFreq = 32000000.0; /*DO NOT MODIFY*/ /*High Power Mode and external Xtal.*/
|
||||
|
||||
pBIACfg->SeqStartAddr = 0;
|
||||
pBIACfg->MaxSeqLen = 512; /** @todo add checker in function */
|
||||
|
||||
pBIACfg->RcalVal = 10000.0;
|
||||
pBIACfg->DftNum = DFTNUM_16384;
|
||||
pBIACfg->NumOfData = -1; /* Never stop until you stop it mannually by AppBIACtrl() function */
|
||||
pBIACfg->BiaODR = 2.5; /* ODR(Sample Rate) 20Hz */
|
||||
pBIACfg->FifoThresh = 12; /*SKR: this parameter needs to be changed... but it should not be visible*/ /* 4 */
|
||||
pBIACfg->ADCSinc3Osr = ADCSINC3OSR_2;
|
||||
|
||||
pBIACfg->SinFreq = 50000.0; /*50kHz */
|
||||
pBIACfg->SweepCfg.SweepEn = bFALSE;
|
||||
pBIACfg->SweepCfg.SweepStart = 10000;
|
||||
pBIACfg->SweepCfg.SweepStop = 150000.0;
|
||||
pBIACfg->SweepCfg.SweepPoints = 100;
|
||||
pBIACfg->SweepCfg.SweepLog = bTRUE;
|
||||
}
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
static uint32_t IntCount;
|
||||
static uint32_t count;
|
||||
uint32_t temp;
|
||||
|
||||
AD5940PlatformCfg();
|
||||
|
||||
AD5940BIAStructInit(); /* Configure your parameters in this function */
|
||||
|
||||
AppBIAInit(AppBuff, APPBUFF_SIZE); /* Initialize BIA application. Provide a buffer, which is used to store sequencer commands */ /*SKR this needs to be invisible by the final user*/
|
||||
AppBIACtrl(BIACTRL_START, 0); /* Control BIA measurment to start. Second parameter has no meaning with this command. */
|
||||
|
||||
while(1)
|
||||
{
|
||||
/* Check if interrupt flag which will be set when interrupt occured. */
|
||||
if(AD5940_GetMCUIntFlag())
|
||||
{
|
||||
IntCount++;
|
||||
AD5940_ClrMCUIntFlag(); /* Clear this flag */
|
||||
temp = APPBUFF_SIZE;
|
||||
AppBIAISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
BIAShowResult(AppBuff, temp); /* Show the results to UART */
|
||||
|
||||
if(IntCount == 240)
|
||||
{
|
||||
IntCount = 0;
|
||||
//AppBIACtrl(BIACTRL_SHUTDOWN, 0);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
if(count > 1000000)
|
||||
{
|
||||
count = 0;
|
||||
//AppBIAInit(0, 0); /* Re-initialize BIA application. Because sequences are ready, no need to provide a buffer, which is used to store sequencer commands */
|
||||
//AppBIACtrl(BIACTRL_START, 0); /* Control BIA measurment to start. Second parameter has no meaning with this command. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<packages/>
|
||||
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
</device>
|
||||
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
|
||||
<components>
|
||||
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
|
||||
</component>
|
||||
|
||||
</components>
|
||||
|
||||
<apis/>
|
||||
|
||||
</configuration>
|
||||
|
||||
|
|
@ -0,0 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BodyImpedance-HiZ_Electrodes.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BodyImpedance-HiZ_Electrodes.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,505 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::..\..\Program Files (x86)\ARM_Compiler_5.06u7</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.1</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BodyImpedance-HiZ_Electrodes.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BodyImpedance-HiZ_Electrodes.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package name="ADuCM302x_DFP" schemaVersion="1.2" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,680 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940Main.c
|
||||
@author: ADI
|
||||
@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.
|
||||
|
||||
*****************************************************************************/
|
||||
#include "BodyImpedance-HiZ_Electrodes.h"
|
||||
#include <complex.h>
|
||||
DSPCfg_Type dsp_cfg; /*SKR: this variable needs to be global since the DFTlength is modified several times*/
|
||||
|
||||
|
||||
/* This file contains auto generated source code that user defined */
|
||||
|
||||
/*
|
||||
Application configuration structure. Specified by user from template.
|
||||
The variables are usable in this whole application.
|
||||
It includes basic configuration for sequencer generator and application related parameters
|
||||
*/
|
||||
AppBIACfg_Type AppBIACfg =
|
||||
{
|
||||
.bParaChanged = bFALSE,
|
||||
.SeqStartAddr = 0,
|
||||
.MaxSeqLen = 0,
|
||||
|
||||
.SeqStartAddrCal = 0,
|
||||
.MaxSeqLenCal = 0,
|
||||
|
||||
.ReDoRtiaCal = bFALSE,
|
||||
.SysClkFreq = 16000000.0,
|
||||
.WuptClkFreq = 32000.0,
|
||||
.AdcClkFreq = 32000000.0,
|
||||
.BiaODR = 2.5, /* 20.0 Hz*/
|
||||
.NumOfData = -1,
|
||||
.RcalVal = 10000.0, /* 10kOhm */
|
||||
|
||||
.PwrMod = AFEPWR_HP,
|
||||
.HstiaRtiaSel = HSTIARTIA_1K,
|
||||
.CtiaSel = 16,
|
||||
.ExcitBufGain = EXCITBUFGAIN_2,
|
||||
.HsDacGain = HSDACGAIN_1,
|
||||
.HsDacUpdateRate = 7,
|
||||
.DacVoltPP = 800.0,
|
||||
|
||||
.SinFreq = 50000.0, /* 1000Hz */
|
||||
|
||||
.ADCPgaGain = ADCPGA_1P5,
|
||||
.ADCSinc3Osr = ADCSINC3OSR_2,
|
||||
.ADCSinc2Osr = ADCSINC2OSR_22,
|
||||
|
||||
.DftNum = DFTNUM_16384,
|
||||
.DftSrc = DFTSRC_SINC3,
|
||||
.HanWinEn = bTRUE,
|
||||
|
||||
.SweepCfg.SweepEn = bFALSE,
|
||||
.SweepCfg.SweepStart = 10000,
|
||||
.SweepCfg.SweepStop = 150000.0,
|
||||
.SweepCfg.SweepPoints = 100,
|
||||
.SweepCfg.SweepLog = bTRUE,
|
||||
.SweepCfg.SweepIndex = 0,
|
||||
|
||||
.FifoThresh = 12,
|
||||
.BIAInited = bFALSE,
|
||||
.StopRequired = bFALSE,
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
This function is provided for upper controllers that want to change
|
||||
application parameters specially for user defined parameters.
|
||||
*/
|
||||
AD5940Err AppBIAGetCfg(void *pCfg)
|
||||
{
|
||||
if(pCfg){
|
||||
*(AppBIACfg_Type**)pCfg = &AppBIACfg;
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
return AD5940ERR_PARA;
|
||||
}
|
||||
|
||||
AD5940Err AppBIACtrl(int32_t BcmCtrl, void *pPara)
|
||||
{
|
||||
switch (BcmCtrl)
|
||||
{
|
||||
case BIACTRL_START:
|
||||
{
|
||||
WUPTCfg_Type wupt_cfg;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
if(AppBIACfg.BIAInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
/* Start it */
|
||||
wupt_cfg.WuptEn = bTRUE;
|
||||
wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
|
||||
wupt_cfg.WuptOrder[0] = SEQID_0;
|
||||
wupt_cfg.SeqxSleepTime[SEQID_0] = (uint32_t)(AppBIACfg.WuptClkFreq/AppBIACfg.BiaODR)-2-1;
|
||||
wupt_cfg.SeqxWakeupTime[SEQID_0] = 1; /* The minimum value is 1. Do not set it to zero. Set it to 1 will spend 2 32kHz clock. */
|
||||
AD5940_WUPTCfg(&wupt_cfg);
|
||||
|
||||
AppBIACfg.FifoDataCount = 0; /* restart */
|
||||
printf("BIA Start...\n");
|
||||
break;
|
||||
}
|
||||
case BIACTRL_STOPNOW:
|
||||
{
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
/* Start Wupt right now */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
AD5940_WUPTCtrl(bFALSE); /* @todo is it sure this will stop Wupt? */
|
||||
printf("BIA Stop Now...\n");
|
||||
break;
|
||||
}
|
||||
case BIACTRL_STOPSYNC:
|
||||
{
|
||||
printf("BIA Stop SYNC...\n");
|
||||
AppBIACfg.StopRequired = bTRUE;
|
||||
break;
|
||||
}
|
||||
case BIACTRL_GETFREQ:
|
||||
if(pPara)
|
||||
{
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
*(float*)pPara = AppBIACfg.FreqofData;
|
||||
else
|
||||
*(float*)pPara = AppBIACfg.SinFreq;
|
||||
}
|
||||
break;
|
||||
case BIACTRL_SHUTDOWN:
|
||||
{
|
||||
AppBIACtrl(BIACTRL_STOPNOW, 0); /* Stop the measurment if it's running. */
|
||||
/* Turn off LPloop related blocks which are not controlled automatically by sleep operation */
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
memset(&aferef_cfg, 0, sizeof(aferef_cfg));
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
memset(&lp_loop, 0, sizeof(lp_loop));
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
AD5940_EnterSleepS(); /* Enter Hibernate */
|
||||
printf("BIA Shut down...\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Generate init sequence */
|
||||
static AD5940Err AppBIASeqCfgGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
HSLoopCfg_Type hs_loop;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
float sin_freq;
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/);//GP6->control external mux, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
aferef_cfg.HpBandgapEn = bTRUE;
|
||||
aferef_cfg.Hp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Hp1V8BuffEn = bTRUE;
|
||||
aferef_cfg.Disc1V1Cap = bFALSE;
|
||||
aferef_cfg.Disc1V8Cap = bFALSE;
|
||||
aferef_cfg.Hp1V8ThemBuff = bFALSE;
|
||||
aferef_cfg.Hp1V8Ilimit = bFALSE;
|
||||
aferef_cfg.Lp1V1BuffEn = bFALSE;
|
||||
aferef_cfg.Lp1V8BuffEn = bFALSE;
|
||||
/* LP reference control - turn off them to save powr*/
|
||||
aferef_cfg.LpBandgapEn = bTRUE;
|
||||
aferef_cfg.LpRefBufEn = bTRUE;
|
||||
aferef_cfg.LpRefBoostEn = bFALSE;
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
hs_loop.HsDacCfg.ExcitBufGain = AppBIACfg.ExcitBufGain;
|
||||
hs_loop.HsDacCfg.HsDacGain = AppBIACfg.HsDacGain;
|
||||
hs_loop.HsDacCfg.HsDacUpdateRate = AppBIACfg.HsDacUpdateRate;
|
||||
|
||||
hs_loop.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hs_loop.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hs_loop.HsTiaCfg.HstiaCtia = AppBIACfg.CtiaSel; /* 16pF */
|
||||
hs_loop.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaRtiaSel = AppBIACfg.HstiaRtiaSel;
|
||||
|
||||
hs_loop.SWMatCfg.Dswitch = SWD_OPEN;
|
||||
hs_loop.SWMatCfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
hs_loop.SWMatCfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
hs_loop.SWMatCfg.Tswitch = SWT_TRTIA;
|
||||
|
||||
hs_loop.WgCfg.WgType = WGTYPE_SIN;
|
||||
hs_loop.WgCfg.GainCalEn = bFALSE;
|
||||
hs_loop.WgCfg.OffsetCalEn = bFALSE;
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIACfg.FreqofData = AppBIACfg.SweepCfg.SweepStart;
|
||||
AppBIACfg.SweepCurrFreq = AppBIACfg.SweepCfg.SweepStart;
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &AppBIACfg.SweepNextFreq);
|
||||
sin_freq = AppBIACfg.SweepCurrFreq;
|
||||
}
|
||||
else
|
||||
{
|
||||
sin_freq = AppBIACfg.SinFreq;
|
||||
AppBIACfg.FreqofData = sin_freq;
|
||||
}
|
||||
hs_loop.WgCfg.SinCfg.SinFreqWord = AD5940_WGFreqWordCal(sin_freq, AppBIACfg.SysClkFreq);
|
||||
hs_loop.WgCfg.SinCfg.SinAmplitudeWord = (uint32_t)(AppBIACfg.DacVoltPP/800.0f*2047 + 0.5f);
|
||||
hs_loop.WgCfg.SinCfg.SinOffsetWord = 0;
|
||||
hs_loop.WgCfg.SinCfg.SinPhaseWord = 0;
|
||||
AD5940_HSLoopCfgS(&hs_loop);
|
||||
|
||||
lp_loop.LpDacCfg.LpdacSel = LPDAC0;
|
||||
lp_loop.LpDacCfg.LpDacSrc = LPDACSRC_MMR;
|
||||
lp_loop.LpDacCfg.LpDacSW = LPDACSW_VBIAS2LPPA|LPDACSW_VBIAS2PIN|LPDACSW_VZERO2LPTIA|LPDACSW_VZERO2PIN;
|
||||
lp_loop.LpDacCfg.LpDacVzeroMux = LPDACVZERO_6BIT;
|
||||
lp_loop.LpDacCfg.LpDacVbiasMux = LPDACVBIAS_12BIT;
|
||||
lp_loop.LpDacCfg.LpDacRef = LPDACREF_2P5;
|
||||
lp_loop.LpDacCfg.DataRst = bFALSE;
|
||||
lp_loop.LpDacCfg.PowerEn = bTRUE;
|
||||
lp_loop.LpDacCfg.DacData12Bit = (uint32_t)((1100-200)/2200.0*4095);
|
||||
lp_loop.LpDacCfg.DacData6Bit = 31;
|
||||
|
||||
lp_loop.LpAmpCfg.LpAmpSel = LPAMP0;
|
||||
lp_loop.LpAmpCfg.LpAmpPwrMod = LPAMPPWR_NORM;
|
||||
lp_loop.LpAmpCfg.LpPaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaPwrEn = bTRUE;
|
||||
lp_loop.LpAmpCfg.LpTiaRf = LPTIARF_20K;
|
||||
lp_loop.LpAmpCfg.LpTiaRload = LPTIARLOAD_SHORT;
|
||||
lp_loop.LpAmpCfg.LpTiaRtia = LPTIARTIA_OPEN;
|
||||
lp_loop.LpAmpCfg.LpTiaSW = LPTIASW(5)|LPTIASW(6)|LPTIASW(7)|LPTIASW(8)|LPTIASW(9)|LPTIASW(12)|LPTIASW(13); /* @todo Optimizanation needed for new silicon */
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
|
||||
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_HSTIA_N;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_HSTIA_P;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = AppBIACfg.ADCPgaGain;
|
||||
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_2; /* Don't care becase it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_1P6MHZ; /* @todo Add explanation in UG that SINC3 filter clock is same as ADC, when ADC runs at 32MHz, clear this bit to enable clock divider for SINC3 filter. Make sure SINC3 clock is below 16MHz. */
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
/*dsp_cfg.ADCFilterCfg.Sinc2NotchClkEnable = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc3ClkEnable = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.WGClkEnable = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.DFTClkEnable = bTRUE;*/
|
||||
dsp_cfg.DftCfg.DftNum = AppBIACfg.DftNum;
|
||||
dsp_cfg.DftCfg.DftSrc = AppBIACfg.DftSrc;
|
||||
dsp_cfg.DftCfg.HanWinEn = AppBIACfg.HanWinEn;
|
||||
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
|
||||
/* Enable all of them. They are automatically turned off during hibernate mode to save power */
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_HSTIAPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
|
||||
AFECTRL_WG|AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
|
||||
AFECTRL_SINC2NOTCH, bTRUE);
|
||||
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
/* Sequence end. */
|
||||
AD5940_SEQGenInsert(SEQ_STOP()); /* Add one extral command to disable sequencer for initialization sequence because we only want it to run one time. */
|
||||
|
||||
/* Stop here */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop seuqncer generator */
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIACfg.InitSeqInfo.SeqId = SEQID_1;
|
||||
AppBIACfg.InitSeqInfo.SeqRamAddr = AppBIACfg.SeqStartAddr;
|
||||
AppBIACfg.InitSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIACfg.InitSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIACfg.InitSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIASeqMeasureGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
uint32_t WaitClks;
|
||||
SWMatrixCfg_Type sw_cfg;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = AppBIACfg.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(dsp_cfg.DftCfg.DftNum+2); /*wait can be no constant*//*clks_cal.DataCount = 1L<<(AppBIACfg.DftNum+2);*/ /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBIACfg.SysClkFreq/AppBIACfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
/*0*/AD5940_SEQGpioCtrlS(AGPIO_Pin6/*|AGPIO_Pin5|AGPIO_Pin1*/);//GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
/*1*//*SKR: BUFSENCON is not done, it is done during the initialization (AD5940_REFCfgS)*/
|
||||
/*2*//*SKR: AFECON is set to all connected during the initialization (AD5940_AFECtrlS)*/
|
||||
/*3*/AD5940_SEQGenInsert(SEQ_WAIT(16*250)); /* @todo wait 250us?? */
|
||||
/*4*/dsp_cfg.DftCfg.DftNum = DFTNUM_16384;
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
clks_cal.DataCount = 1L<<(dsp_cfg.DftCfg.DftNum+2);
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
/*5*/sw_cfg.Dswitch = SWD_RCAL0;
|
||||
/*6*/sw_cfg.Pswitch = SWP_RCAL0;
|
||||
/*7*/sw_cfg.Nswitch = SWN_RCAL1;
|
||||
/*8*/sw_cfg.Tswitch = SWT_RCAL1|SWT_TRTIA;
|
||||
/*9*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*10*/
|
||||
/*11*/AD5940_ADCMuxCfgS(ADCMUXP_HSTIA_P, ADCMUXN_HSTIA_N);
|
||||
/*12*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*13*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*14*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*15*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*16*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*17*/dsp_cfg.DftCfg.DftNum = AppBIACfg.DftNum;
|
||||
clks_cal.DataCount = 1L<<(dsp_cfg.DftCfg.DftNum+2);
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
/*18*/ //I think it is not needed
|
||||
/*19*/ //I think it is not needed
|
||||
/*20*/sw_cfg.Dswitch = SWD_CE0;
|
||||
/*21*/sw_cfg.Pswitch = SWP_CE0;
|
||||
/*22*/sw_cfg.Nswitch = SWN_AIN1|SWN_AIN2|SWN_AIN3;
|
||||
/*23*/sw_cfg.Tswitch = SWT_AIN1|SWT_AIN2|SWT_AIN3|SWT_TRTIA;
|
||||
/*24*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*25*/ //I think it is not needed
|
||||
/*26*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*27*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*28*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*29*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*30*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*31*/ //I think it is not needed
|
||||
/*32*/sw_cfg.Dswitch = SWD_CE0|SWD_AIN1|SWD_AIN3;
|
||||
/*33*/sw_cfg.Pswitch = SWP_CE0|SWP_AIN1|SWP_AIN3;
|
||||
/*34*/sw_cfg.Nswitch = SWN_AIN2;
|
||||
/*35*/sw_cfg.Tswitch = SWT_AIN2|SWT_TRTIA;
|
||||
/*36*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*37*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*38*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*39*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*40*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*41*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*42*/sw_cfg.Dswitch = SWD_CE0|SWD_AIN1|SWD_AIN2;
|
||||
/*43*/sw_cfg.Pswitch = SWP_CE0|SWP_AIN1|SWP_AIN2;
|
||||
/*44*/sw_cfg.Nswitch = SWN_AIN3;
|
||||
/*45*/sw_cfg.Tswitch = SWT_AIN3|SWT_TRTIA;
|
||||
/*46*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*47*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*48*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*49*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*50*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*51*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*52*/sw_cfg.Dswitch = SWD_CE0|SWD_AIN2|SWD_AIN3;
|
||||
/*53*/sw_cfg.Pswitch = SWP_CE0|SWP_AIN2|SWP_AIN3;
|
||||
/*54*/sw_cfg.Nswitch = SWN_AIN1;
|
||||
/*55*/sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;
|
||||
/*56*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*57*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*58*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*59*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*60*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*61*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*62*/sw_cfg.Dswitch = SWD_CE0|SWD_AIN2;
|
||||
/*63*/sw_cfg.Pswitch = SWP_CE0|SWP_AIN2;
|
||||
/*64*/sw_cfg.Nswitch = SWN_AIN1|SWN_AIN3;
|
||||
/*65*/sw_cfg.Tswitch = SWT_AIN1|SWT_AIN3|SWT_TRTIA;
|
||||
/*66*/AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
/*67*/AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
/*68*/AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
/*69*/ AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
/*70*/AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
/*71*/AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
/*72*/
|
||||
/*73*/sw_cfg.Dswitch = SWD_OPEN;
|
||||
/*74*/sw_cfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
/*75*/sw_cfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
/*76*/sw_cfg.Tswitch = SWT_OPEN;
|
||||
/*77*/AD5940_SWMatrixCfgS(&sw_cfg); /* Float switches */
|
||||
/*78*/
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->control MUX, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
AD5940_EnterSleepS();/* Goto hibernate */
|
||||
/* Sequence end. */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop seuqncer generator */
|
||||
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIACfg.MeasureSeqInfo.SeqId = SEQID_0;
|
||||
AppBIACfg.MeasureSeqInfo.SeqRamAddr = AppBIACfg.InitSeqInfo.SeqRamAddr + AppBIACfg.InitSeqInfo.SeqLen ;
|
||||
AppBIACfg.MeasureSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIACfg.MeasureSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIACfg.MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIARtiaCal(void)
|
||||
{
|
||||
HSRTIACal_Type hsrtia_cal;
|
||||
|
||||
hsrtia_cal.AdcClkFreq = AppBIACfg.AdcClkFreq;
|
||||
hsrtia_cal.ADCSinc2Osr = AppBIACfg.ADCSinc2Osr;
|
||||
hsrtia_cal.ADCSinc3Osr = AppBIACfg.ADCSinc3Osr;
|
||||
hsrtia_cal.bPolarResult = bTRUE; /* We need magnitude and phase here */
|
||||
hsrtia_cal.DftCfg.DftNum = AppBIACfg.DftNum;
|
||||
hsrtia_cal.DftCfg.DftSrc = AppBIACfg.DftSrc;
|
||||
hsrtia_cal.DftCfg.HanWinEn = AppBIACfg.HanWinEn;
|
||||
hsrtia_cal.fRcal= AppBIACfg.RcalVal;
|
||||
hsrtia_cal.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hsrtia_cal.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hsrtia_cal.HsTiaCfg.HstiaCtia = AppBIACfg.CtiaSel;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_TODE;
|
||||
hsrtia_cal.HsTiaCfg.HstiaRtiaSel = AppBIACfg.HstiaRtiaSel;
|
||||
hsrtia_cal.SysClkFreq = AppBIACfg.SysClkFreq;
|
||||
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
uint32_t i;
|
||||
AppBIACfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
for(i=0;i<AppBIACfg.SweepCfg.SweepPoints;i++)
|
||||
{
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &hsrtia_cal.fFreq);
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, AppBIACfg.RtiaCalTable[i]);
|
||||
printf("Freq:%.2f,Mag:%.2f,Phase:%fDegree\n", hsrtia_cal.fFreq, AppBIACfg.RtiaCalTable[i][0], AppBIACfg.RtiaCalTable[i][1]*180/MATH_PI);
|
||||
}
|
||||
AppBIACfg.RtiaCurrValue[AppBIACfg.SweepCfg.SweepIndex] = AppBIACfg.RtiaCalTable[i][0];
|
||||
AppBIACfg.RtiaCurrValue[AppBIACfg.SweepCfg.SweepIndex] = AppBIACfg.RtiaCalTable[i][0];
|
||||
AppBIACfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
}
|
||||
else
|
||||
{
|
||||
hsrtia_cal.fFreq = AppBIACfg.SinFreq;
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, AppBIACfg.RtiaCurrValue);
|
||||
printf("RtiaMag:%.2f,Phase:%fDegree\n", AppBIACfg.RtiaCurrValue[0], AppBIACfg.RtiaCurrValue[1]*180/MATH_PI);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* This function provide application initialize. */
|
||||
AD5940Err AppBIAInit(uint32_t *pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
SEQCfg_Type seq_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB; /* 2kB SRAM is used for sequencer, others for data FIFO */
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Do RTIA calibration */
|
||||
|
||||
if((AppBIACfg.ReDoRtiaCal == bTRUE) || \
|
||||
AppBIACfg.BIAInited == bFALSE) /* Do calibration on the first initializaion */
|
||||
{
|
||||
AppBIARtiaCal();
|
||||
AppBIACfg.ReDoRtiaCal = bFALSE;
|
||||
}
|
||||
/* Reconfigure FIFO */
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE); /* Disable FIFO firstly */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = AppBIACfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Start sequence generator */
|
||||
/* Initialize sequencer generator */
|
||||
if((AppBIACfg.BIAInited == bFALSE)||\
|
||||
(AppBIACfg.bParaChanged == bTRUE))
|
||||
{
|
||||
if(pBuffer == 0) return AD5940ERR_PARA;
|
||||
if(BufferSize == 0) return AD5940ERR_PARA;
|
||||
AD5940_SEQGenInit(pBuffer, BufferSize);
|
||||
|
||||
/* Generate initialize sequence */
|
||||
error = AppBIASeqCfgGen(); /* Application initialization sequence using either MCU or sequencer */
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
/* Generate measurement sequence */
|
||||
error = AppBIASeqMeasureGen();
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
AppBIACfg.bParaChanged = bFALSE; /* Clear this flag as we already implemented the new configuration */
|
||||
}
|
||||
|
||||
/* Initialization sequencer */
|
||||
AppBIACfg.InitSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIACfg.InitSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer */
|
||||
AD5940_SEQMmrTrig(AppBIACfg.InitSeqInfo.SeqId);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ENDSEQ) == bFALSE);
|
||||
|
||||
/* Measurment sequence */
|
||||
AppBIACfg.MeasureSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIACfg.MeasureSeqInfo);
|
||||
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer, and wait for trigger */
|
||||
AD5940_ClrMCUIntFlag(); /* Clear interrupt flag generated before */
|
||||
|
||||
AD5940_AFEPwrBW(AppBIACfg.PwrMod, AFEBW_250KHZ);
|
||||
AD5940_WriteReg(REG_AFE_SWMUX, 1<<3);
|
||||
AppBIACfg.BIAInited = bTRUE; /* BIA application has been initialized. */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Modify registers when AFE wakeup */
|
||||
static AD5940Err AppBIARegModify(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
if(AppBIACfg.NumOfData > 0)
|
||||
{
|
||||
AppBIACfg.FifoDataCount += *pDataCount/4;
|
||||
if(AppBIACfg.FifoDataCount >= AppBIACfg.NumOfData)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
}
|
||||
if(AppBIACfg.StopRequired == bTRUE)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
if(AppBIACfg.SweepCfg.SweepEn) /* Need to set new frequency and set power mode */
|
||||
{
|
||||
AD5940_WGFreqCtrlS(AppBIACfg.SweepNextFreq, AppBIACfg.SysClkFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on the data type, do appropriate data pre-process before return back to controller */
|
||||
static AD5940Err AppBIADataProcess(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
uint32_t DataCount = *pDataCount;
|
||||
uint32_t ImpResCount = DataCount/12;
|
||||
|
||||
fImpCar_Type * const pOut = (fImpCar_Type*)pData;
|
||||
iImpCar_Type * pSrcData = (iImpCar_Type*)pData;
|
||||
|
||||
*pDataCount = 0;
|
||||
|
||||
DataCount = (DataCount/12)*12;/* We expect RCAL data together with Rz data. One DFT result has two data in FIFO, real part and imaginary part. */
|
||||
|
||||
/* Convert DFT result to int32_t type */
|
||||
for(uint32_t i=0; i<DataCount; i++)
|
||||
{
|
||||
pData[i] &= 0x3ffff; /* @todo option to check ECC */
|
||||
if(pData[i]&(1<<17)) /* Bit17 is sign bit */
|
||||
{
|
||||
pData[i] |= 0xfffc0000; /* Data is 18bit in two's complement, bit17 is the sign bit */
|
||||
}
|
||||
}
|
||||
for(uint32_t i=0; i<ImpResCount; i++)
|
||||
{
|
||||
iImpCar_Type *zCalCurr, *I1, *I2, *I3, *I4, *I5;
|
||||
|
||||
zCalCurr = pSrcData++;
|
||||
I1 = pSrcData++;
|
||||
I2 = pSrcData++;
|
||||
I3 = pSrcData++;
|
||||
I4 = pSrcData++;
|
||||
I5 = pSrcData++;
|
||||
|
||||
double complex vcal = -AppBIACfg.RcalVal * zCalCurr->Real + AppBIACfg.RcalVal * zCalCurr->Image*I; //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex a1 = vcal / (-I1->Real + I1->Image*I); //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex a2 = vcal / (-I2->Real + I2->Image*I); //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex a3 = vcal / (-I3->Real + I3->Image*I); //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex a4 = vcal / (-I4->Real + I4->Image*I); //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex a5 = vcal / (-I5->Real + I5->Image*I); //real part is multiplied by -1 because current is 180<38> shifted. the imaginary part does not need be multiplied by -1 because DFT provides the -imaginary value, no the imaginary value
|
||||
double complex E1 = -2*a1*a2*a5*(a1*a2 + a1*a5 - a2*a5)/(a1*a1*a2*a2 - 2*a1*a1*a2*a5 + a1*a1*a5*a5 - 2*a1*a2*a2*a5 - 2*a1*a2*a5*a5 + a2*a2*a5*a5);
|
||||
double complex E2 = -2*a1*a2*a5*(a1*a2 - a1*a5 + a2*a5)/(a1*a1*a2*a2 - 2*a1*a1*a2*a5 + a1*a1*a5*a5 - 2*a1*a2*a2*a5 - 2*a1*a2*a5*a5 + a2*a2*a5*a5);
|
||||
double complex E3 = -2*a3*a4*a5*(a3*a4 + a3*a5 - a4*a5)/(a3*a3*a4*a4 - 2*a3*a3*a4*a5 + a3*a3*a5*a5 - 2*a3*a4*a4*a5 - 2*a3*a4*a5*a5 + a4*a4*a5*a5);
|
||||
double complex E4 = -2*a3*a4*a5*(a3*a4 - a3*a5 + a4*a5)/(a3*a3*a4*a4 - 2*a3*a3*a4*a5 + a3*a3*a5*a5 - 2*a3*a4*a4*a5 - 2*a3*a4*a5*a5 + a4*a4*a5*a5);
|
||||
double complex ZB = (-E1*E2*E3 - E1*E2*E4 - E1*E3*E4 + E1*E3*a5 + E1*E4*a5 - E2*E3*E4 + E2*E3*a5 + E2*E4*a5)/(E1*E3 + E1*E4 + E2*E3 + E2*E4);
|
||||
|
||||
pOut[(i*5)+0].Real = creal(E1);
|
||||
pOut[(i*5)+0].Image = cimag(E1);
|
||||
pOut[(i*5)+1].Real = creal(E2);
|
||||
pOut[(i*5)+1].Image = cimag(E2);
|
||||
pOut[(i*5)+2].Real = creal(E3);
|
||||
pOut[(i*5)+2].Image = cimag(E3);
|
||||
pOut[(i*5)+3].Real = creal(E4);
|
||||
pOut[(i*5)+3].Image = cimag(E4);
|
||||
pOut[(i*5)+4].Real = creal(ZB);
|
||||
pOut[(i*5)+4].Image = cimag(ZB);
|
||||
|
||||
|
||||
}
|
||||
*pDataCount = ImpResCount;
|
||||
/* Calculate next frequency point */
|
||||
if(AppBIACfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIACfg.FreqofData = AppBIACfg.SweepCurrFreq;
|
||||
AppBIACfg.SweepCurrFreq = AppBIACfg.SweepNextFreq;
|
||||
AD5940_SweepNext(&AppBIACfg.SweepCfg, &AppBIACfg.SweepNextFreq);
|
||||
AppBIACfg.RtiaCurrValue[0] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][0];
|
||||
AppBIACfg.RtiaCurrValue[1] = AppBIACfg.RtiaCalTable[AppBIACfg.SweepCfg.SweepIndex][1];
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
AD5940Err AppBIAISR(void *pBuff, uint32_t *pCount)
|
||||
{
|
||||
uint32_t BuffCount;
|
||||
uint32_t FifoCnt;
|
||||
BuffCount = *pCount;
|
||||
if(AppBIACfg.BIAInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
if(AD5940_INTCTestFlag(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
/* Now there should be 4 data in FIFO */
|
||||
FifoCnt = (AD5940_FIFOGetCnt()/12)*12;
|
||||
|
||||
if(FifoCnt > BuffCount)
|
||||
{
|
||||
///@todo buffer is limited.
|
||||
}
|
||||
AD5940_FIFORd((uint32_t *)pBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
AppBIARegModify(pBuff, &FifoCnt); /* If there is need to do AFE re-configure, do it here when AFE is in active state */
|
||||
AD5940_EnterSleepS(); /* Manually put AFE back to hibernate mode. This operation only takes effect when register value is ACTIVE previously */
|
||||
|
||||
/* Process data */
|
||||
AppBIADataProcess((int32_t*)pBuff,&FifoCnt);
|
||||
*pCount = FifoCnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
/*!
|
||||
@file: ImpSeqs.h
|
||||
@author: $Author: nxu2 $
|
||||
@brief: 4-wire BIA measurement header file.
|
||||
@version: $Revision: 766 $
|
||||
@date: $Date: 2017-08-21 14:09:35 +0100 (Mon, 21 Aug 2017) $
|
||||
-----------------------------------------------------------------------------
|
||||
Copyright (c) 2012-2017 Analog Devices, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Modified versions of the software must be conspicuously marked as such.
|
||||
- This software is licensed solely and exclusively for use with processors
|
||||
manufacTRUEd by or for Analog Devices, Inc.
|
||||
- This software may not be combined or merged with other code in any manner
|
||||
that would cause the software to become subject to terms and conditions
|
||||
which differ from those listed here.
|
||||
- Neither the name of Analog Devices, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
- The use of this software may or may not infringe the patent rights of one
|
||||
or more patent holders. This license does not release you from the
|
||||
requirement that you obtain separate licenses from these patent holders
|
||||
to use this software.
|
||||
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
|
||||
INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
|
||||
CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _BODYCOMPOSITIONJOSEMETHOD_H_
|
||||
#define _BODYCOMPOSITIONJOSEMETHOD_H_
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
#define MAXSWEEP_POINTS 100 /* Need to know how much buffer is needed to save RTIA calibration result */
|
||||
|
||||
/*
|
||||
Note: this example will use SEQID_0 as measurment sequence, and use SEQID_1 as init sequence.
|
||||
SEQID_3 is used for calibration.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Common configurations for all kinds of Application. */
|
||||
BoolFlag bParaChanged; /* Indicate to generate sequence again. It's auto cleared by AppBIAInit */
|
||||
uint32_t SeqStartAddr; /* Initialaztion sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLen; /* Limit the maximum sequence. */
|
||||
uint32_t SeqStartAddrCal; /* Measurment sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLenCal;
|
||||
/* Application related parameters */
|
||||
//BoolFlag bBioElecBoard; /* The code is same for BioElec board and AD5941Sens1 board. No changes are needed */
|
||||
BoolFlag ReDoRtiaCal; /* Set this flag to bTRUE when there is need to do calibration. */
|
||||
float SysClkFreq; /* The real frequency of system clock */
|
||||
float WuptClkFreq; /* The clock frequency of Wakeup Timer in Hz. Typically it's 32kHz. Leave it here in case we calibrate clock in software method */
|
||||
float AdcClkFreq; /* The real frequency of ADC clock */
|
||||
uint32_t FifoThresh; /* FIFO threshold. Should be N*4 */
|
||||
float BiaODR; /* in Hz. ODR decides the period of WakeupTimer who will trigger sequencer periodically. DFT number and sample frequency decides the maxim ODR. */
|
||||
int32_t NumOfData; /* By default it's '-1'. If you want the engine stops after get NumofData, then set the value here. Otherwise, set it to '-1' which means never stop. */
|
||||
float SinFreq; /* Frequency of excitation signal */
|
||||
float RcalVal; /* Rcal value in Ohm */
|
||||
uint32_t PwrMod; /* Control Chip power mode(LP/HP) */
|
||||
float DacVoltPP; /* Final excitation voltage is DAC_VOLTpp*DAC_PGA*EXCIT_GAIN, DAC_PGA= 1 or 0.2, EXCIT_GAIN=2 or 0.25. DAC output voltage in mV peak to peak. Maximum value is 800mVpp. Peak to peak voltage */
|
||||
uint32_t ExcitBufGain; /* Select from EXCITBUFGAIN_2, EXCITBUFGAIN_0P25 */
|
||||
uint32_t HsDacGain; /* Select from HSDACGAIN_1, HSDACGAIN_0P2 */
|
||||
uint32_t HsDacUpdateRate; /* DAC update rate is SystemCLoock/Divider. The available value is 7 to 255. Set to 7 for better perfomance */
|
||||
uint32_t ADCPgaGain; /* PGA Gain select from GNPGA_1, GNPGA_1_5, GNPGA_2, GNPGA_4, GNPGA_9 !!! We must ensure signal is in range of +-1.5V which is limited by ADC input stage */
|
||||
uint8_t ADCSinc3Osr; /* SINC3 OSR selection. ADCSINC3OSR_2, ADCSINC3OSR_4 */
|
||||
uint8_t ADCSinc2Osr; /* SINC2 OSR selection. ADCSINC2OSR_22...ADCSINC2OSR_1333 */
|
||||
uint32_t HstiaRtiaSel; /* Use internal RTIA, select from RTIA_INT_200, RTIA_INT_1K, RTIA_INT_5K, RTIA_INT_10K, RTIA_INT_20K, RTIA_INT_40K, RTIA_INT_80K, RTIA_INT_160K */
|
||||
uint32_t CtiaSel; /* Select CTIA in pF unit from 0 to 31pF */
|
||||
|
||||
uint32_t DftNum; /* DFT number */
|
||||
uint32_t DftSrc; /* DFT Source */
|
||||
BoolFlag HanWinEn; /* Enable Hanning window */
|
||||
|
||||
/* Sweep Function Control */
|
||||
SoftSweepCfg_Type SweepCfg;
|
||||
/* Private variables for internal usage */
|
||||
float SweepCurrFreq;
|
||||
float SweepNextFreq;
|
||||
float RtiaCurrValue[2]; /* Calibrated Rtia value of current frequency */
|
||||
float RtiaCalTable[MAXSWEEP_POINTS][2]; /* Calibrated Rtia Value table */
|
||||
float FreqofData; /* The frequency of latest data sampled */
|
||||
BoolFlag BIAInited; /* If the program run firstly, generated sequence commands */
|
||||
SEQInfo_Type InitSeqInfo;
|
||||
SEQInfo_Type MeasureSeqInfo;
|
||||
BoolFlag StopRequired; /* After FIFO is ready, stop the measurment sequence */
|
||||
uint32_t FifoDataCount; /* Count how many times impedance have been measured */
|
||||
/* End */
|
||||
}AppBIACfg_Type;
|
||||
|
||||
#define BIACTRL_START 0
|
||||
#define BIACTRL_STOPNOW 1
|
||||
#define BIACTRL_STOPSYNC 2
|
||||
#define BIACTRL_GETFREQ 3 /* Get Current frequency of returned data from ISR */
|
||||
#define BIACTRL_SHUTDOWN 4 /* Note: shutdown here means turn off everything and put AFE to hibernate mode. The word 'SHUT DOWN' is only used here. */
|
||||
|
||||
AD5940Err AppBIAGetCfg(void *pCfg);
|
||||
AD5940Err AppBIAInit(uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err AppBIAISR(void *pBuff, uint32_t *pCount);
|
||||
AD5940Err AppBIACtrl(int32_t BcmCtrl, void *pPara);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BodyImpedance-HiZ_Electrodes.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BodyImpedance-HiZ_Electrodes.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,591 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.17.1</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<RvdsCdeCp>0</RvdsCdeCp>
|
||||
<nBranchProt>0</nBranchProt>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<ClangAsOpt>4</ClangAsOpt>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BodyImpedance-HiZ_Electrodes.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BodyImpedance-HiZ_Electrodes.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.2" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.8.1" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.7.2" url="https://www.keil.com/pack/" vendor="Keil" version="2.17.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.8">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.7.2" url="https://www.keil.com/pack/" vendor="Keil" version="2.17.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.8.1">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.8.1" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.7.2" url="https://www.keil.com/pack/" vendor="Keil" version="2.17.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.8">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.7.2" url="https://www.keil.com/pack/" vendor="Keil" version="2.17.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: AD5940Main.c
|
||||
@author: Neo Xu
|
||||
@brief: Used to control specific application and further 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 <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "BIOZ-2Wire.h"
|
||||
|
||||
#define APPBUFF_SIZE 512
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
int32_t BIOZShowResult(uint32_t *pData, uint32_t DataCount)
|
||||
{
|
||||
float freq;
|
||||
|
||||
fImpCar_Type *pImp = (fImpCar_Type*)pData;
|
||||
AppBIOZCtrl(BIOZCTRL_GETFREQ, &freq);
|
||||
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("Freq:%.2f ", freq);
|
||||
//printf("RzMag: %f Ohm , RzPhase: %f \n",AD5940_ComplexMag(&pImp[i]), AD5940_ComplexPhase(&pImp[i])*180/MATH_PI);
|
||||
printf("Impedance:(Real,Image) = (%f,%f)\n", pImp[i].Real, pImp[i].Image);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_XTAL;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_1;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_XTAL;
|
||||
clk_cfg.HfOSC32MHzMode = bFALSE;
|
||||
clk_cfg.HFOSCEn = bFALSE;
|
||||
clk_cfg.HFXTALEn = bTRUE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 4;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP4_SYNC|GP2_TRIG|GP1_SYNC|GP0_INT;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter sleep mode. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940BIOZStructInit(void)
|
||||
{
|
||||
AppBIOZCfg_Type *pBIOZCfg;
|
||||
AppBIOZGetCfg(&pBIOZCfg);
|
||||
|
||||
pBIOZCfg->SeqStartAddr = 0;
|
||||
pBIOZCfg->MaxSeqLen = 512;
|
||||
|
||||
pBIOZCfg->SinFreq = 20e3; /* 20kHz. This value is ignored if SweepEn = bTRUE */
|
||||
pBIOZCfg->RcalVal = 10000.0; /* Value of RCAl on the evaluaiton board */
|
||||
pBIOZCfg->HstiaRtiaSel = HSTIARTIA_200;
|
||||
|
||||
/* Configure Switch matrix */
|
||||
pBIOZCfg->DswitchSel = SWD_CE0;
|
||||
pBIOZCfg->PswitchSel = SWP_CE0;
|
||||
pBIOZCfg->NswitchSel = SWN_AIN2;
|
||||
pBIOZCfg->TswitchSel = SWN_AIN2;
|
||||
|
||||
/* Configure Sweep Parameters */
|
||||
pBIOZCfg->SweepCfg.SweepEn = bTRUE;
|
||||
pBIOZCfg->SweepCfg.SweepStart = 1000;
|
||||
pBIOZCfg->SweepCfg.SweepStop = 200000.0;
|
||||
pBIOZCfg->SweepCfg.SweepPoints = 40; /* Maximum is 100 */
|
||||
pBIOZCfg->SweepCfg.SweepLog = bFALSE;
|
||||
|
||||
pBIOZCfg->BIOZODR = 5; /* ODR(Sample Rate) 5Hz */
|
||||
pBIOZCfg->NumOfData = -1; /* Never stop until you stop it manually by AppBIOZCtrl() function */
|
||||
}
|
||||
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
uint32_t temp;
|
||||
|
||||
AD5940PlatformCfg();
|
||||
|
||||
AD5940BIOZStructInit(); /* Configure your parameters in this function */
|
||||
|
||||
AppBIOZInit(AppBuff, APPBUFF_SIZE); /* Initialize BIOZ application. Provide a buffer, which is used to store sequencer commands */
|
||||
AppBIOZCtrl(BIOZCTRL_START, 0); /* Control BIOZ 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;
|
||||
AppBIOZISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
BIOZShowResult(AppBuff, temp); /* Show the results to UART */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<packages/>
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
</device>
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
</component>
|
||||
</components>
|
||||
<apis/>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,294 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>2</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BIOZ-2Wire.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BIOZ-2Wire.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>ADuCM3029</Device>
|
||||
<Vendor>Analog Devices</Vendor>
|
||||
<PackID>AnalogDevices.ADuCM302x_DFP.3.2.0</PackID>
|
||||
<PackURL>http://download.analog.com/tools/EZBoards/CM302x/Releases/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x04000) IRAM2(0x20040000,0x04000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:ADuCM3029$Include\ADuCM3029.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:ADuCM3029$SVD\ADuCM302x.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>ADICUP3029</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> </SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments></TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M3"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>0</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>1</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>4</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>1</NoZi4>
|
||||
<NoZi5>1</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>1</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20040000</StartAddress>
|
||||
<Size>0x4000</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>0</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>CHIPSEL_594X, ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\;..\..\AD5940Lib</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x00000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ADICUP3029Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\ADICUP3029Port.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BIOZ-2Wire.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BIOZ-2Wire.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="CMSIS" Cgroup="DSP" Cvendor="ARM" Cversion="1.5.2" condition="CMSIS DSP">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver">
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="Include\config\adi_cycle_counting_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_cycle_counting_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_global_config.h" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\adi_global_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_i2c_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_i2c_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="I2C" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x I2C"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="Include\config\adi_pwr_config.h" version="2.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\ADuCM3029\adi_pwr_config.h</instance>
|
||||
<component Cclass="Device" Cgroup="Drivers" Csub="Power" Cvendor="AnalogDevices" Cversion="2.0.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="2.0.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029_ARM" name="Source\ARM\startup_ADuCM3029.s" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\startup_ADuCM3029.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="ADuCM3029" name="Source\system_ADuCM3029.c" version="3.2.0">
|
||||
<instance index="0">RTE\Device\ADuCM3029\system_ADuCM3029.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" condition="ADuCM302x Driver"/>
|
||||
<package license="License/2017-05-17-CM302xEZDFP Click Thru SLA.txt" name="ADuCM302x_DFP" schemaVersion="1.2" supportContact="http://www.analog.com/en/support/technical-support.html" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="ADICUP3029"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@file: ADICUP3029Port.c
|
||||
@author: Neo Xu
|
||||
@brief: The port for ADI's ADICUP3029 board.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <AD5940.h>
|
||||
#include "ADuCM3029.h"
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to ADICUP3029 board. */
|
||||
#define SYSTICK_CLKFREQ 26000000L /* Systick clock frequency in Hz. This only appies to ADICUP3029 board */
|
||||
volatile static uint32_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficient way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
uint32_t tx_count=0, rx_count=0;
|
||||
pADI_SPI0->CNT = length;
|
||||
while(1){
|
||||
uint32_t fifo_sta = pADI_SPI0->FIFO_STAT;
|
||||
if(rx_count < length){
|
||||
if(fifo_sta&0xf00){//there is data in RX FIFO.
|
||||
*pRecvBuff++ = pADI_SPI0->RX;
|
||||
rx_count ++;
|
||||
}
|
||||
}
|
||||
if(tx_count < length){
|
||||
if((fifo_sta&0xf) < 8){// there is space in TX FIFO.
|
||||
pADI_SPI0->TX = *pSendBuffer++;
|
||||
tx_count ++;
|
||||
}
|
||||
}
|
||||
if(rx_count == length && tx_count==length)
|
||||
break; //done
|
||||
}
|
||||
while((pADI_SPI0->STAT&BITM_SPI_STAT_XFRDONE) == 0);//wait for transfer done.
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
pADI_GPIO1->CLR = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
pADI_GPIO1->SET = (1<<10);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
pADI_GPIO2->SET = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
pADI_GPIO2->CLR = 1<<6; //p2.6-ADC3-A3
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
if(time==0)return;
|
||||
if(time*10<SYSTICK_MAXCOUNT/(SYSTICK_CLKFREQ/1000000)){
|
||||
SysTick->LOAD = time*10*(SYSTICK_CLKFREQ/1000000);
|
||||
SysTick->CTRL = (1 << 2) | (1<<0); /* Enable SysTick Timer, using core clock */
|
||||
while(!((SysTick->CTRL)&(1<<16))); /* Wait until count to zero */
|
||||
SysTick->CTRL = 0; /* Disable SysTick Timer */
|
||||
}
|
||||
else {
|
||||
AD5940_Delay10us(time/2);
|
||||
AD5940_Delay10us(time/2 + (time&1));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
pADI_GPIO0->PE = 0xFFFF;
|
||||
pADI_GPIO1->PE = 0xFFFF;
|
||||
pADI_GPIO2->PE = 0xFFFF;
|
||||
pADI_GPIO2->OEN |= (1<<6); //P2.6-ADC3-A3-AD5940_Reset
|
||||
pADI_GPIO2->SET = 1<<6; //Pull high this pin.
|
||||
|
||||
/*Setup Pins P0.0-->SCLK P0.1-->MOSI P0.2-->MISO P1.10-->CS*/
|
||||
pADI_GPIO0->CFG = (1<<0)|(1<<2)|(1<<4)|(pADI_GPIO0->CFG&(~((3<<0)|(3<<2)|(3<<4))));
|
||||
pADI_GPIO1->CFG &=~(3<<14); /* Configure P1.10 to GPIO function */
|
||||
pADI_GPIO1->OEN |= (1<<10); /* P1.10 Output Enable */
|
||||
/*Set SPI Baudrate = PCLK/2x(iCLKDiv+1).*/
|
||||
pADI_SPI0->DIV = 0;/*Baudrae is 13MHz*/
|
||||
pADI_SPI0->CTL = BITM_SPI_CTL_CSRST| // Configure SPI to reset after a bit shift error is detected
|
||||
BITM_SPI_CTL_MASEN| // Enable master mode
|
||||
/*BITM_SPI_CTL_CON|*/ // Enable continous transfer mode
|
||||
BITM_SPI_CTL_OEN| // Select MISO pin to operate as normal -
|
||||
BITM_SPI_CTL_RXOF| // overwrite data in Rx FIFO during overflow states
|
||||
/*BITM_SPI_CTL_ZEN|*/ // transmit 00 when no valid data in Tx FIFO
|
||||
BITM_SPI_CTL_TIM| // initiate trasnfer with a write to SPITX
|
||||
BITM_SPI_CTL_SPIEN; // Enable SPI. SCLK idles low/ data clocked on SCLK falling edge
|
||||
pADI_SPI0->CNT = 1;// Setup to transfer 1 bytes to slave
|
||||
/* Step2: initialize GPIO interrupt that connects to AD5940's interrupt output pin(Gp0, Gp3, Gp4, Gp6 or Gp7 ) */
|
||||
pADI_GPIO0->IEN |= 1<<15;// Configure P0.15 as an input
|
||||
|
||||
pADI_XINT0->CFG0 = (0x1<<0)|(1<<3);//External IRQ0 enabled. Falling edge
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
NVIC_EnableIRQ(XINT_EVT0_IRQn); //Enable External Interrupt 0 source.
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void Ext_Int0_Handler()
|
||||
{
|
||||
pADI_XINT0->CLR = BITM_XINT_CLR_IRQ0;
|
||||
ucInterrupted = 1;
|
||||
/* This example just set the flag and deal with interrupt in AD5940Main function. It's your choice to choose how to process interrupt. */
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ADuCM3029.h"
|
||||
#include "AD5940.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0);
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
/* Below functions are used to initialize MCU Platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
int UrtCfg(int iBaud);
|
||||
|
||||
/*Stop watch dog timer(ADuCM3029)*/
|
||||
pADI_WDT0->CTL = 0xC9;
|
||||
/* Clock Configure */
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14; // Select HFOSC as system clock.
|
||||
pADI_CLKG0_OSC->CTL = // Int 32khz LFOSC selected in LFMUX
|
||||
BITM_CLKG_OSC_CTL_HFOSCEN|BITM_CLKG_OSC_CTL_HFXTALEN;
|
||||
|
||||
while((pADI_CLKG0_OSC->CTL&BITM_CLKG_OSC_CTL_HFXTALOK) == 0);
|
||||
|
||||
pADI_CLKG0_OSC->KEY = 0xCB14;
|
||||
pADI_CLKG0_CLK->CTL0 = 0x201; /* Select XTAL as system clock */
|
||||
pADI_CLKG0_CLK->CTL1 = 0; // ACLK,PCLK,HCLK divided by 1
|
||||
pADI_CLKG0_CLK->CTL5 = 0x00; // Enable clock to all peripherals - no clock gating
|
||||
|
||||
UrtCfg(230400);/*Baud rate: 230400*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief int UrtCfg(int iBaud, int iBits, int iFormat)
|
||||
==========Configure the UART.
|
||||
@param iBaud :{B1200,B2200,B2400,B4800,B9600,B19200,B38400,B57600,B115200,B230400,B430800} \n
|
||||
Set iBaud to the baudrate required:
|
||||
Values usually: 1200, 2200 (for HART), 2400, 4800, 9600,
|
||||
19200, 38400, 57600, 115200, 230400, 430800, or type in baud-rate directly
|
||||
@note
|
||||
- Powers up UART if not powered up.
|
||||
- Standard baudrates are accurate to better than 0.1% plus clock error.\n
|
||||
- Non standard baudrates are accurate to better than 1% plus clock error.
|
||||
@warning - If an external clock is used for the system the ullRtClk must be modified with \n
|
||||
the speed of the clock used.
|
||||
**/
|
||||
|
||||
int UrtCfg(int iBaud)
|
||||
{
|
||||
int iBits = 3;//8bits,
|
||||
int iFormat = 0;//, int iBits, int iFormat
|
||||
int i1;
|
||||
int iDiv;
|
||||
int iRtC;
|
||||
int iOSR;
|
||||
int iPllMulValue;
|
||||
unsigned long long ullRtClk = 16000000; // The root clock speed
|
||||
|
||||
|
||||
/*Setup P0[11:10] as UART pins*/
|
||||
pADI_GPIO0->CFG = (1<<22)|(1<<20)|(pADI_GPIO0->CFG&(~((3<<22)|(3<<20))));
|
||||
|
||||
iDiv = (pADI_CLKG0_CLK->CTL1& BITM_CLKG_CLK_CTL1_PCLKDIVCNT); // Read UART clock as set by CLKCON1[10:8]
|
||||
iDiv = iDiv>>8;
|
||||
if (iDiv == 0)
|
||||
iDiv = 1;
|
||||
iRtC = (pADI_CLKG0_CLK->CTL0& BITM_CLKG_CLK_CTL0_CLKMUX); // Check what is the root clock
|
||||
|
||||
switch (iRtC)
|
||||
{
|
||||
case 0: // HFOSC selected
|
||||
ullRtClk = 26000000;
|
||||
break;
|
||||
|
||||
case 1: // HFXTAL selected
|
||||
if ((pADI_CLKG0_CLK->CTL0 & 0x200)==0x200) // 26Mhz XTAL used
|
||||
ullRtClk = 26000000;
|
||||
else
|
||||
ullRtClk = 16000000; // Assume 16MHz XTAL
|
||||
break;
|
||||
|
||||
case 2: // SPLL output
|
||||
iPllMulValue = (pADI_CLKG0_CLK->CTL3 & // Check muliplication factor in PLL settings
|
||||
BITM_CLKG_CLK_CTL3_SPLLNSEL); // bits[4:0]. Assume div value of 0xD in bits [14:11]
|
||||
ullRtClk = (iPllMulValue *1000000); // Assume straight multiplication by pADI_CLKG0_CLK->CTL3[4:0]
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ullRtClk = 26000000; //External clock is assumed to be 26MhZ, if different
|
||||
break; //clock speed is used, this should be changed
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// iOSR = (pADI_UART0->COMLCR2 & 0x3);
|
||||
// iOSR = 2^(2+iOSR);
|
||||
pADI_UART0->COMLCR2 = 0x3;
|
||||
iOSR = 32;
|
||||
//i1 = (ullRtClk/(iOSR*iDiv))/iBaud; // UART baud rate clock source is PCLK divided by OSR
|
||||
i1 = (ullRtClk/(iOSR*iDiv))/iBaud-1; //for bigger M and N value
|
||||
pADI_UART0->COMDIV = i1;
|
||||
|
||||
pADI_UART0->COMFBR = 0x8800|(((((2048/(iOSR*iDiv))*ullRtClk)/i1)/iBaud)-2048);
|
||||
pADI_UART0->COMIEN = 0;
|
||||
pADI_UART0->COMLCR = (iFormat&0x3c)|(iBits&3);
|
||||
|
||||
|
||||
pADI_UART0->COMFCR = (BITM_UART_COMFCR_RFTRIG & 0/*RX_FIFO_1BYTE*/ ) |BITM_UART_COMFCR_FIFOEN;
|
||||
pADI_UART0->COMFCR |= BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR; // Clear the UART FIFOs
|
||||
pADI_UART0->COMFCR &= ~(BITM_UART_COMFCR_RFCLR|BITM_UART_COMFCR_TFCLR); // Disable clearing mechanism
|
||||
|
||||
NVIC_EnableIRQ(UART_EVT_IRQn); // Enable UART interrupt source in NVIC
|
||||
pADI_UART0->COMIEN = BITM_UART_COMIEN_ERBFI|BITM_UART_COMIEN_ELSI; /* Rx Interrupt */
|
||||
return pADI_UART0->COMLSR;
|
||||
}
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
pADI_UART0->COMTX = c;
|
||||
while((pADI_UART0->COMLSR&0x20) == 0);// tx fifo empty
|
||||
return c;
|
||||
}
|
||||
|
|
@ -0,0 +1,710 @@
|
|||
/******************************************************************************
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include "BIOZ-2Wire.h"
|
||||
|
||||
/**
|
||||
* @note This example is modified from BIOZ example. This one is for 2-wire impedance measuremnt.
|
||||
* The default pins used are CE0 and AIN2. The differnce with BIOZ is that the body voltage
|
||||
* Measurment is replaced with excitation voltage measurment and it's only measured once.
|
||||
*/
|
||||
|
||||
/*
|
||||
Application configuration structure. Specified by user from template.
|
||||
The variables are usable in this whole application.
|
||||
It includes basic configuration for sequencer generator and application related parameters
|
||||
*/
|
||||
AppBIOZCfg_Type AppBIOZCfg =
|
||||
{
|
||||
.bParaChanged = bFALSE,
|
||||
.SeqStartAddr = 0,
|
||||
.MaxSeqLen = 0,
|
||||
|
||||
.SeqStartAddrCal = 0,
|
||||
.MaxSeqLenCal = 0,
|
||||
|
||||
.ReDoRtiaCal = bFALSE,
|
||||
.SysClkFreq = 16000000.0,
|
||||
.WuptClkFreq = 32000.0,
|
||||
.AdcClkFreq = 16000000.0,
|
||||
.BIOZODR = 20.0, /* 20.0 Hz*/
|
||||
.NumOfData = -1,
|
||||
.RcalVal = 10000.0, /* 10kOhm */
|
||||
|
||||
.PwrMod = AFEPWR_LP,
|
||||
.HstiaRtiaSel = HSTIARTIA_10K,
|
||||
.CtiaSel = 16,
|
||||
.ExcitBufGain = EXCITBUFGAIN_2,
|
||||
.HsDacGain = HSDACGAIN_1,
|
||||
.HsDacUpdateRate = 7,
|
||||
.DacVoltPP = 600.0,
|
||||
|
||||
.SinFreq = 50000.0, /* 5000Hz */
|
||||
|
||||
.ADCPgaGain = ADCPGA_1P5,
|
||||
.ADCSinc3Osr = ADCSINC3OSR_2,
|
||||
.ADCSinc2Osr = ADCSINC2OSR_22,
|
||||
|
||||
.DftNum = DFTNUM_8192,
|
||||
.DftSrc = DFTSRC_SINC3,
|
||||
.HanWinEn = bTRUE,
|
||||
|
||||
.SweepCfg.SweepEn = bFALSE,
|
||||
.SweepCfg.SweepStart = 10000,
|
||||
.SweepCfg.SweepStop = 150000.0,
|
||||
.SweepCfg.SweepPoints = 100,
|
||||
.SweepCfg.SweepLog = bTRUE,
|
||||
.SweepCfg.SweepIndex = 0,
|
||||
|
||||
.FifoThresh = 4, /* Must be 4 when SweepEn = bTRUE*/
|
||||
.BIOZInited = bFALSE,
|
||||
.StopRequired = bFALSE,
|
||||
};
|
||||
|
||||
/**
|
||||
This function is provided for upper controllers that want to change
|
||||
application parameters specially for user defined parameters.
|
||||
*/
|
||||
AD5940Err AppBIOZGetCfg(void *pCfg)
|
||||
{
|
||||
if(pCfg){
|
||||
*(AppBIOZCfg_Type**)pCfg = &AppBIOZCfg;
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
return AD5940ERR_PARA;
|
||||
}
|
||||
|
||||
AD5940Err AppBIOZCtrl(int32_t BcmCtrl, void *pPara)
|
||||
{
|
||||
switch (BcmCtrl)
|
||||
{
|
||||
case BIOZCTRL_START:
|
||||
{
|
||||
WUPTCfg_Type wupt_cfg;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
if(AppBIOZCfg.BIOZInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
/* Start the wakeup timer */
|
||||
wupt_cfg.WuptEn = bTRUE;
|
||||
wupt_cfg.WuptEndSeq = WUPTENDSEQ_A;
|
||||
wupt_cfg.WuptOrder[0] = SEQID_0;
|
||||
wupt_cfg.SeqxSleepTime[SEQID_0] = (uint32_t)(AppBIOZCfg.WuptClkFreq/AppBIOZCfg.BIOZODR)-2-1;
|
||||
wupt_cfg.SeqxWakeupTime[SEQID_0] = 1; /* The minimum value is 1. Do not set it to zero. Set it to 1 will spend 2 32kHz clock. */
|
||||
AD5940_WUPTCfg(&wupt_cfg);
|
||||
|
||||
AppBIOZCfg.FifoDataCount = 0; /* restart */
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("BIOZ Start...\n");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case BIOZCTRL_STOPNOW:
|
||||
{
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
/* Stop Wupt right now */
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("BIOZ Stop Now...\n");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case BIOZCTRL_STOPSYNC:
|
||||
{
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("BIOZ Stop SYNC...\n");
|
||||
#endif
|
||||
AppBIOZCfg.StopRequired = bTRUE;
|
||||
break;
|
||||
}
|
||||
case BIOZCTRL_GETFREQ:
|
||||
if(pPara)
|
||||
{
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn == bTRUE)
|
||||
*(float*)pPara = AppBIOZCfg.FreqofData;
|
||||
else
|
||||
*(float*)pPara = AppBIOZCfg.SinFreq;
|
||||
}
|
||||
break;
|
||||
case BIOZCTRL_SHUTDOWN:
|
||||
{
|
||||
AppBIOZCtrl(BIOZCTRL_STOPNOW, 0); /* Stop the measurment if it's running. */
|
||||
/* Turn off LPloop related blocks which are not controlled automatically by sleep operation */
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
LPLoopCfg_Type lp_loop;
|
||||
memset(&aferef_cfg, 0, sizeof(aferef_cfg));
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
memset(&lp_loop, 0, sizeof(lp_loop));
|
||||
AD5940_LPLoopCfgS(&lp_loop);
|
||||
AD5940_EnterSleepS(); /* Enter Hibernate */
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("BIOZ Shut down...\n");
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Generate init sequence */
|
||||
static AD5940Err AppBIOZSeqCfgGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
AFERefCfg_Type aferef_cfg;
|
||||
HSLoopCfg_Type hs_loop;
|
||||
DSPCfg_Type dsp_cfg;
|
||||
float sin_freq;
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
aferef_cfg.HpBandgapEn = bTRUE;
|
||||
aferef_cfg.Hp1V1BuffEn = bTRUE;
|
||||
aferef_cfg.Hp1V8BuffEn = bTRUE;
|
||||
aferef_cfg.Disc1V1Cap = bFALSE;
|
||||
aferef_cfg.Disc1V8Cap = bFALSE;
|
||||
aferef_cfg.Hp1V8ThemBuff = bFALSE;
|
||||
aferef_cfg.Hp1V8Ilimit = bFALSE;
|
||||
aferef_cfg.Lp1V1BuffEn = bFALSE;
|
||||
aferef_cfg.Lp1V8BuffEn = bFALSE;
|
||||
|
||||
/* LP reference control - turn off them to save powr*/
|
||||
aferef_cfg.LpBandgapEn = bTRUE;
|
||||
aferef_cfg.LpRefBufEn = bTRUE;
|
||||
aferef_cfg.LpRefBoostEn = bFALSE;
|
||||
AD5940_REFCfgS(&aferef_cfg);
|
||||
hs_loop.HsDacCfg.ExcitBufGain = AppBIOZCfg.ExcitBufGain;
|
||||
hs_loop.HsDacCfg.HsDacGain = AppBIOZCfg.HsDacGain;
|
||||
hs_loop.HsDacCfg.HsDacUpdateRate = AppBIOZCfg.HsDacUpdateRate;
|
||||
|
||||
hs_loop.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hs_loop.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hs_loop.HsTiaCfg.HstiaCtia = AppBIOZCfg.CtiaSel; /* 31pF + 2pF */
|
||||
hs_loop.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_OPEN;
|
||||
hs_loop.HsTiaCfg.HstiaRtiaSel = AppBIOZCfg.HstiaRtiaSel;
|
||||
|
||||
hs_loop.SWMatCfg.Dswitch = SWD_OPEN;
|
||||
hs_loop.SWMatCfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
hs_loop.SWMatCfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
hs_loop.SWMatCfg.Tswitch = SWT_TRTIA;
|
||||
|
||||
hs_loop.WgCfg.WgType = WGTYPE_SIN;
|
||||
hs_loop.WgCfg.GainCalEn = bFALSE;
|
||||
hs_loop.WgCfg.OffsetCalEn = bFALSE;
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIOZCfg.SweepCfg.SweepIndex = 0;
|
||||
AppBIOZCfg.FreqofData = AppBIOZCfg.SweepCfg.SweepStart;
|
||||
AppBIOZCfg.SweepCurrFreq = AppBIOZCfg.SweepCfg.SweepStart;
|
||||
AD5940_SweepNext(&AppBIOZCfg.SweepCfg, &AppBIOZCfg.SweepNextFreq);
|
||||
sin_freq = AppBIOZCfg.SweepCurrFreq;
|
||||
}
|
||||
else
|
||||
{
|
||||
sin_freq = AppBIOZCfg.SinFreq;
|
||||
AppBIOZCfg.FreqofData = sin_freq;
|
||||
}
|
||||
hs_loop.WgCfg.SinCfg.SinFreqWord = AD5940_WGFreqWordCal(sin_freq, AppBIOZCfg.SysClkFreq);
|
||||
hs_loop.WgCfg.SinCfg.SinAmplitudeWord = (uint32_t)(AppBIOZCfg.DacVoltPP/800.0f*2047 + 0.5f);
|
||||
hs_loop.WgCfg.SinCfg.SinOffsetWord = 0;
|
||||
hs_loop.WgCfg.SinCfg.SinPhaseWord = 0;
|
||||
AD5940_HSLoopCfgS(&hs_loop);
|
||||
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxN = ADCMUXN_HSTIA_N;
|
||||
dsp_cfg.ADCBaseCfg.ADCMuxP = ADCMUXP_HSTIA_P;
|
||||
dsp_cfg.ADCBaseCfg.ADCPga = AppBIOZCfg.ADCPgaGain;
|
||||
|
||||
memset(&dsp_cfg.ADCDigCompCfg, 0, sizeof(dsp_cfg.ADCDigCompCfg));
|
||||
|
||||
dsp_cfg.ADCFilterCfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care becase it's disabled */
|
||||
dsp_cfg.ADCFilterCfg.ADCRate = ADCRATE_800KHZ; /* Tell filter block clock rate of ADC*/
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc2Osr = AppBIOZCfg.ADCSinc2Osr;
|
||||
dsp_cfg.ADCFilterCfg.ADCSinc3Osr = AppBIOZCfg.ADCSinc3Osr;
|
||||
dsp_cfg.ADCFilterCfg.BpSinc3 = bFALSE;
|
||||
dsp_cfg.ADCFilterCfg.BpNotch = bTRUE;
|
||||
dsp_cfg.ADCFilterCfg.Sinc2NotchEnable = bTRUE;
|
||||
dsp_cfg.DftCfg.DftNum = AppBIOZCfg.DftNum;
|
||||
dsp_cfg.DftCfg.DftSrc = AppBIOZCfg.DftSrc;
|
||||
dsp_cfg.DftCfg.HanWinEn = AppBIOZCfg.HanWinEn;
|
||||
|
||||
memset(&dsp_cfg.StatCfg, 0, sizeof(dsp_cfg.StatCfg)); /* Don't care about Statistic */
|
||||
AD5940_DSPCfgS(&dsp_cfg);
|
||||
|
||||
/* Enable all of them. They are automatically turned off during hibernate mode to save power */
|
||||
AD5940_AFECtrlS(AFECTRL_HPREFPWR|AFECTRL_HSTIAPWR|AFECTRL_INAMPPWR|AFECTRL_EXTBUFPWR|\
|
||||
AFECTRL_DACREFPWR|AFECTRL_HSDACPWR|\
|
||||
AFECTRL_SINC2NOTCH, bTRUE);
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
/* Sequence end. */
|
||||
AD5940_SEQGenInsert(SEQ_STOP()); /* Add one extral command to disable sequencer for initialization sequence because we only want it to run one time. */
|
||||
|
||||
/* Stop here */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop seuqncer generator */
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIOZCfg.InitSeqInfo.SeqId = SEQID_1;
|
||||
AppBIOZCfg.InitSeqInfo.SeqRamAddr = AppBIOZCfg.SeqStartAddr;
|
||||
AppBIOZCfg.InitSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIOZCfg.InitSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIOZCfg.InitSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIOZSeqMeasureGen(void)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
uint32_t const *pSeqCmd;
|
||||
uint32_t SeqLen;
|
||||
|
||||
uint32_t WaitClks;
|
||||
SWMatrixCfg_Type sw_cfg;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = AppBIOZCfg.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(AppBIOZCfg.DftNum+2); /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = AppBIOZCfg.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = AppBIOZCfg.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBIOZCfg.SysClkFreq/AppBIOZCfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
/* Start sequence generator here */
|
||||
AD5940_SEQGenCtrl(bTRUE);
|
||||
|
||||
AD5940_SEQGpioCtrlS(AGPIO_Pin1/*|AGPIO_Pin5|AGPIO_Pin1*/);//GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
|
||||
/* Configure switch matrix to connect the sensor */
|
||||
sw_cfg.Dswitch = AppBIOZCfg.DswitchSel;
|
||||
sw_cfg.Pswitch = AppBIOZCfg.PswitchSel;
|
||||
sw_cfg.Nswitch = AppBIOZCfg.NswitchSel;
|
||||
sw_cfg.Tswitch = AppBIOZCfg.TswitchSel|SWT_TRTIA;
|
||||
AD5940_SWMatrixCfgS(&sw_cfg);
|
||||
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*250));
|
||||
/* Step 1: Measure Current */
|
||||
AD5940_ADCMuxCfgS(ADCMUXP_HSTIA_P, ADCMUXN_HSTIA_N);
|
||||
AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(1));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
|
||||
/* Step 2: Measure Voltage */
|
||||
AD5940_ADCMuxCfgS(ADCMUXP_VCE0, ADCMUXN_N_NODE);
|
||||
AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE); /* Enable Waveform generator, ADC power */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(16*50));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE); /* Start ADC convert and DFT */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(WaitClks)); /* wait for first data ready */
|
||||
AD5940_SEQGenInsert(SEQ_WAIT(1));
|
||||
AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE); /* Stop ADC convert and DFT */
|
||||
|
||||
sw_cfg.Dswitch = SWD_OPEN;
|
||||
sw_cfg.Pswitch = SWP_PL|SWP_PL2;
|
||||
sw_cfg.Nswitch = SWN_NL|SWN_NL2;
|
||||
sw_cfg.Tswitch = SWT_TRTIA;
|
||||
AD5940_SWMatrixCfgS(&sw_cfg); /* Float switches */
|
||||
|
||||
AD5940_SEQGpioCtrlS(0/*AGPIO_Pin6|AGPIO_Pin5|AGPIO_Pin1*/); //GP6->endSeq, GP5 -> AD8233=OFF, GP1->RLD=OFF .
|
||||
AD5940_EnterSleepS();/* Goto hibernate */
|
||||
/* Sequence end. */
|
||||
error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
|
||||
AD5940_SEQGenCtrl(bFALSE); /* Stop seuqncer generator */
|
||||
|
||||
if(error == AD5940ERR_OK)
|
||||
{
|
||||
AppBIOZCfg.MeasureSeqInfo.SeqId = SEQID_0;
|
||||
AppBIOZCfg.MeasureSeqInfo.SeqRamAddr = AppBIOZCfg.InitSeqInfo.SeqRamAddr + AppBIOZCfg.InitSeqInfo.SeqLen ;
|
||||
AppBIOZCfg.MeasureSeqInfo.pSeqCmd = pSeqCmd;
|
||||
AppBIOZCfg.MeasureSeqInfo.SeqLen = SeqLen;
|
||||
/* Write command to SRAM */
|
||||
AD5940_SEQCmdWrite(AppBIOZCfg.MeasureSeqInfo.SeqRamAddr, pSeqCmd, SeqLen);
|
||||
}
|
||||
else
|
||||
return error; /* Error */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
static AD5940Err AppBIOZRtiaCal(void)
|
||||
{
|
||||
HSRTIACal_Type hsrtia_cal;
|
||||
FreqParams_Type freq_params;
|
||||
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
hsrtia_cal.fFreq = AppBIOZCfg.SweepCfg.SweepStart;
|
||||
freq_params = AD5940_GetFreqParameters(AppBIOZCfg.SweepCfg.SweepStart);
|
||||
}
|
||||
else
|
||||
{
|
||||
hsrtia_cal.fFreq = AppBIOZCfg.SinFreq;
|
||||
freq_params = AD5940_GetFreqParameters(AppBIOZCfg.SinFreq);
|
||||
}
|
||||
|
||||
if(freq_params.HighPwrMode == bTRUE)
|
||||
hsrtia_cal.AdcClkFreq = 32e6;
|
||||
else
|
||||
hsrtia_cal.AdcClkFreq = 16e6;
|
||||
hsrtia_cal.ADCSinc2Osr = freq_params.ADCSinc2Osr;
|
||||
hsrtia_cal.ADCSinc3Osr = freq_params.ADCSinc3Osr;
|
||||
hsrtia_cal.DftCfg.DftNum = freq_params.DftNum;
|
||||
hsrtia_cal.DftCfg.DftSrc = freq_params.DftSrc;
|
||||
hsrtia_cal.bPolarResult = bTRUE; /* We need magnitude and phase here */
|
||||
hsrtia_cal.DftCfg.HanWinEn = AppBIOZCfg.HanWinEn;
|
||||
hsrtia_cal.fRcal= AppBIOZCfg.RcalVal;
|
||||
hsrtia_cal.HsTiaCfg.DiodeClose = bFALSE;
|
||||
hsrtia_cal.HsTiaCfg.HstiaBias = HSTIABIAS_1P1;
|
||||
hsrtia_cal.HsTiaCfg.HstiaCtia = AppBIOZCfg.CtiaSel;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRload = HSTIADERLOAD_OPEN;
|
||||
hsrtia_cal.HsTiaCfg.HstiaDeRtia = HSTIADERTIA_OPEN;
|
||||
hsrtia_cal.HsTiaCfg.HstiaRtiaSel = AppBIOZCfg.HstiaRtiaSel;
|
||||
hsrtia_cal.SysClkFreq = AppBIOZCfg.SysClkFreq;
|
||||
|
||||
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
uint32_t i;
|
||||
AppBIOZCfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
for(i=0;i<AppBIOZCfg.SweepCfg.SweepPoints;i++)
|
||||
{
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, &AppBIOZCfg.RtiaCalTable[i]);
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("Freq:%.2f, (%f, %f)Ohm\n", hsrtia_cal.fFreq, AppBIOZCfg.RtiaCalTable[i].Real, AppBIOZCfg.RtiaCalTable[i].Image);
|
||||
#endif
|
||||
AD5940_SweepNext(&AppBIOZCfg.SweepCfg, &hsrtia_cal.fFreq);
|
||||
freq_params = AD5940_GetFreqParameters(hsrtia_cal.fFreq);
|
||||
|
||||
if(freq_params.HighPwrMode == bTRUE)
|
||||
{
|
||||
hsrtia_cal.AdcClkFreq = 32e6;
|
||||
/* Change clock to 32MHz oscillator */
|
||||
AD5940_HPModeEn(bTRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
hsrtia_cal.AdcClkFreq = 16e6;
|
||||
/* Change clock to 16MHz oscillator */
|
||||
AD5940_HPModeEn(bFALSE);
|
||||
}
|
||||
hsrtia_cal.ADCSinc2Osr = freq_params.ADCSinc2Osr;
|
||||
hsrtia_cal.ADCSinc3Osr = freq_params.ADCSinc3Osr;
|
||||
hsrtia_cal.DftCfg.DftNum = freq_params.DftNum;
|
||||
hsrtia_cal.DftCfg.DftSrc = freq_params.DftSrc;
|
||||
}
|
||||
|
||||
AppBIOZCfg.SweepCfg.SweepIndex = 0; /* Reset index */
|
||||
AppBIOZCfg.RtiaCurrValue = AppBIOZCfg.RtiaCalTable[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
AD5940_HSRtiaCal(&hsrtia_cal, &AppBIOZCfg.RtiaCurrValue);
|
||||
#ifdef ADI_DEBUG
|
||||
ADI_Print("Freq:%.2f, (%f, %f)Ohm\n", hsrtia_cal.fFreq, AppBIOZCfg.RtiaCurrValue.Real, AppBIOZCfg.RtiaCurrValue.Image);
|
||||
#endif
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* This function provide application initialize. */
|
||||
AD5940Err AppBIOZInit(uint32_t *pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
AD5940Err error = AD5940ERR_OK;
|
||||
SEQCfg_Type seq_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB; /* 2kB SRAM is used for sequencer, others for data FIFO */
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Do RTIA calibration */
|
||||
if((AppBIOZCfg.ReDoRtiaCal == bTRUE) || \
|
||||
AppBIOZCfg.BIOZInited == bFALSE) /* Do calibration on the first initializaion */
|
||||
{
|
||||
AppBIOZRtiaCal();
|
||||
AppBIOZCfg.ReDoRtiaCal = bFALSE;
|
||||
}
|
||||
/* Reconfigure FIFO */
|
||||
AD5940_FIFOCtrlS(FIFOSRC_DFT, bFALSE); /* Disable FIFO firstly */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = AppBIOZCfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg);
|
||||
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Start sequence generator */
|
||||
/* Initialize sequencer generator */
|
||||
if((AppBIOZCfg.BIOZInited == bFALSE)||\
|
||||
(AppBIOZCfg.bParaChanged == bTRUE))
|
||||
{
|
||||
if(pBuffer == 0) return AD5940ERR_PARA;
|
||||
if(BufferSize == 0) return AD5940ERR_PARA;
|
||||
AD5940_SEQGenInit(pBuffer, BufferSize);
|
||||
|
||||
/* Generate initialize sequence */
|
||||
error = AppBIOZSeqCfgGen(); /* Application initialization sequence using either MCU or sequencer */
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
/* Generate measurement sequence */
|
||||
error = AppBIOZSeqMeasureGen();
|
||||
if(error != AD5940ERR_OK) return error;
|
||||
|
||||
AppBIOZCfg.bParaChanged = bFALSE; /* Clear this flag as we already implemented the new configuration */
|
||||
}
|
||||
|
||||
/* Initialization sequencer */
|
||||
AppBIOZCfg.InitSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIOZCfg.InitSeqInfo);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer */
|
||||
AD5940_SEQMmrTrig(AppBIOZCfg.InitSeqInfo.SeqId);
|
||||
while(AD5940_INTCTestFlag(AFEINTC_1, AFEINTSRC_ENDSEQ) == bFALSE);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
|
||||
/* Measurment sequence */
|
||||
AppBIOZCfg.MeasureSeqInfo.WriteSRAM = bFALSE;
|
||||
AD5940_SEQInfoCfg(&AppBIOZCfg.MeasureSeqInfo);
|
||||
|
||||
AppBIOZCheckFreq(AppBIOZCfg.FreqofData);
|
||||
seq_cfg.SeqEnable = bTRUE;
|
||||
AD5940_SEQCfg(&seq_cfg); /* Enable sequencer, and wait for trigger */
|
||||
AD5940_ClrMCUIntFlag(); /* Clear interrupt flag generated before */
|
||||
|
||||
AppBIOZCfg.BIOZInited = bTRUE; /* BIOZ application has been initialized. */
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on frequency of Sin wave set optimum filter settings */
|
||||
AD5940Err AppBIOZCheckFreq(float freq)
|
||||
{
|
||||
ADCFilterCfg_Type filter_cfg;
|
||||
DFTCfg_Type dft_cfg;
|
||||
HSDACCfg_Type hsdac_cfg;
|
||||
uint32_t WaitClks;
|
||||
ClksCalInfo_Type clks_cal;
|
||||
FreqParams_Type freq_params;
|
||||
uint32_t SeqCmdBuff[2];
|
||||
uint32_t SRAMAddr = 0;;
|
||||
/* Step 1: Check Frequency */
|
||||
freq_params = AD5940_GetFreqParameters(freq);
|
||||
|
||||
/* Set power mode */
|
||||
if(freq_params.HighPwrMode == bTRUE)
|
||||
{
|
||||
/* Update HSDAC update rate */
|
||||
hsdac_cfg.ExcitBufGain = AppBIOZCfg.ExcitBufGain;
|
||||
hsdac_cfg.HsDacGain = AppBIOZCfg.HsDacGain;
|
||||
hsdac_cfg.HsDacUpdateRate = 0x7;
|
||||
AD5940_HSDacCfgS(&hsdac_cfg);
|
||||
|
||||
/*Update ADC rate */
|
||||
filter_cfg.ADCRate = ADCRATE_1P6MHZ;
|
||||
AppBIOZCfg.AdcClkFreq = 32e6;
|
||||
|
||||
/* Change clock to 32MHz oscillator */
|
||||
AD5940_HPModeEn(bTRUE);
|
||||
}else
|
||||
{
|
||||
/* Update HSDAC update rate */
|
||||
hsdac_cfg.ExcitBufGain = AppBIOZCfg.ExcitBufGain;
|
||||
hsdac_cfg.HsDacGain = AppBIOZCfg.HsDacGain;
|
||||
hsdac_cfg.HsDacUpdateRate = 0x1B;
|
||||
AD5940_HSDacCfgS(&hsdac_cfg);
|
||||
/* Update ADC rate */
|
||||
filter_cfg.ADCRate = ADCRATE_800KHZ;
|
||||
AppBIOZCfg.AdcClkFreq = 16e6;
|
||||
|
||||
/* Change clock to 16MHz oscillator */
|
||||
AD5940_HPModeEn(bFALSE);
|
||||
}
|
||||
|
||||
/* Step 2: Adjust ADCFILTERCON and DFTCON to set optimumn SINC3, SINC2 and DFTNUM settings */
|
||||
filter_cfg.ADCAvgNum = ADCAVGNUM_16; /* Don't care because it's disabled */
|
||||
filter_cfg.ADCSinc2Osr = freq_params.ADCSinc2Osr;
|
||||
filter_cfg.ADCSinc3Osr = freq_params.ADCSinc3Osr;
|
||||
filter_cfg.BpSinc3 = bFALSE;
|
||||
filter_cfg.BpNotch = bTRUE;
|
||||
filter_cfg.Sinc2NotchEnable = bTRUE;
|
||||
dft_cfg.DftNum = freq_params.DftNum;
|
||||
dft_cfg.DftSrc = freq_params.DftSrc;
|
||||
dft_cfg.HanWinEn = AppBIOZCfg.HanWinEn;
|
||||
AD5940_ADCFilterCfgS(&filter_cfg);
|
||||
AD5940_DFTCfgS(&dft_cfg);
|
||||
|
||||
/* Step 3: Calculate clocks needed to get result to FIFO and update sequencer wait command */
|
||||
clks_cal.DataType = DATATYPE_DFT;
|
||||
clks_cal.DftSrc = freq_params.DftSrc;
|
||||
clks_cal.DataCount = 1L<<(freq_params.DftNum+2); /* 2^(DFTNUMBER+2) */
|
||||
clks_cal.ADCSinc2Osr = freq_params.ADCSinc2Osr;
|
||||
clks_cal.ADCSinc3Osr = freq_params.ADCSinc3Osr;
|
||||
clks_cal.ADCAvgNum = 0;
|
||||
clks_cal.RatioSys2AdcClk = AppBIOZCfg.SysClkFreq/AppBIOZCfg.AdcClkFreq;
|
||||
AD5940_ClksCalculate(&clks_cal, &WaitClks);
|
||||
|
||||
/* Maximum number of clocks is 0x3FFFFFFF. More are needed if the frequency is low */
|
||||
if(WaitClks > 0x3FFFFFFF)
|
||||
{
|
||||
WaitClks /=2;
|
||||
SRAMAddr = AppBIOZCfg.MeasureSeqInfo.SeqRamAddr;
|
||||
SeqCmdBuff[0] = SEQ_WAIT(WaitClks);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+11, SeqCmdBuff, 1);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+12, SeqCmdBuff, 1);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+18, SeqCmdBuff, 1);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+19, SeqCmdBuff, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SRAMAddr = AppBIOZCfg.MeasureSeqInfo.SeqRamAddr;
|
||||
SeqCmdBuff[0] = SEQ_WAIT(WaitClks);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+11, SeqCmdBuff, 1);
|
||||
AD5940_SEQCmdWrite(SRAMAddr+18, SeqCmdBuff, 1);
|
||||
}
|
||||
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Modify registers when AFE wakeup */
|
||||
static AD5940Err AppBIOZRegModify(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
if(AppBIOZCfg.NumOfData > 0)
|
||||
{
|
||||
AppBIOZCfg.FifoDataCount += *pDataCount/4;
|
||||
if(AppBIOZCfg.FifoDataCount >= AppBIOZCfg.NumOfData)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
}
|
||||
if(AppBIOZCfg.StopRequired == bTRUE)
|
||||
{
|
||||
AD5940_WUPTCtrl(bFALSE);
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn) /* Need to set new frequency and set power mode */
|
||||
{
|
||||
AppBIOZCheckFreq(AppBIOZCfg.SweepNextFreq);
|
||||
AD5940_WGFreqCtrlS(AppBIOZCfg.SweepNextFreq, AppBIOZCfg.SysClkFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/* Depending on the data type, do appropriate data pre-process before return back to controller */
|
||||
static AD5940Err AppBIOZDataProcess(int32_t * const pData, uint32_t *pDataCount)
|
||||
{
|
||||
uint32_t DataCount = *pDataCount;
|
||||
uint32_t ImpResCount = DataCount/4;
|
||||
|
||||
fImpCar_Type * pOut = (fImpCar_Type*)pData;
|
||||
iImpCar_Type * pSrcData = (iImpCar_Type*)pData;
|
||||
|
||||
*pDataCount = 0;
|
||||
|
||||
DataCount = (DataCount/4)*4; /* One DFT result has two data in FIFO, real part and imaginary part. Each measurement has 2 DFT results, one for voltage measurement, one for current */
|
||||
|
||||
/* Convert DFT result to int32_t type */
|
||||
for(uint32_t i=0; i<DataCount; i++)
|
||||
{
|
||||
pData[i] &= 0x3ffff;
|
||||
if(pData[i]&(1<<17)) /* Bit17 is sign bit */
|
||||
{
|
||||
pData[i] |= 0xfffc0000; /* Data is 18bit in two's complement, bit17 is the sign bit */
|
||||
}
|
||||
}
|
||||
for(uint32_t i=0; i<ImpResCount; i++)
|
||||
{
|
||||
fImpCar_Type DftCurr, DftVolt;
|
||||
fImpCar_Type res;
|
||||
|
||||
DftCurr.Real = (float)pSrcData[i].Real;
|
||||
DftCurr.Image = (float)pSrcData[i].Image;
|
||||
DftVolt.Real = (float)pSrcData[i+1].Real;
|
||||
DftVolt.Image = (float)pSrcData[i+1].Image;
|
||||
|
||||
DftCurr.Real = -DftCurr.Real;
|
||||
DftCurr.Image = -DftCurr.Image;
|
||||
DftVolt.Real = DftVolt.Real;
|
||||
DftVolt.Image = DftVolt.Image;
|
||||
res = AD5940_ComplexDivFloat(&DftCurr, &AppBIOZCfg.RtiaCurrValue); /* I=Vrtia/Zrtia */
|
||||
res = AD5940_ComplexDivFloat(&DftVolt, &res);
|
||||
pOut[i] = res;
|
||||
}
|
||||
*pDataCount = ImpResCount;
|
||||
/* Calculate next frequency point */
|
||||
if(AppBIOZCfg.SweepCfg.SweepEn == bTRUE)
|
||||
{
|
||||
AppBIOZCfg.FreqofData = AppBIOZCfg.SweepCurrFreq;
|
||||
AppBIOZCfg.SweepCurrFreq = AppBIOZCfg.SweepNextFreq;
|
||||
AppBIOZCfg.RtiaCurrValue = AppBIOZCfg.RtiaCalTable[AppBIOZCfg.SweepCfg.SweepIndex];
|
||||
AD5940_SweepNext(&AppBIOZCfg.SweepCfg, &AppBIOZCfg.SweepNextFreq);
|
||||
}
|
||||
return AD5940ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
AD5940Err AppBIOZISR(void *pBuff, uint32_t *pCount)
|
||||
{
|
||||
uint32_t BuffCount;
|
||||
uint32_t FifoCnt;
|
||||
if(AppBIOZCfg.BIOZInited == bFALSE)
|
||||
return AD5940ERR_APPERROR;
|
||||
if(AD5940_WakeUp(10) > 10) /* Wakeup AFE by read register, read 10 times at most */
|
||||
return AD5940ERR_WAKEUP; /* Wakeup Failed */
|
||||
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_LOCK); /* Don't enter hibernate */
|
||||
*pCount = 0;
|
||||
|
||||
if(AD5940_INTCTestFlag(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH) == bTRUE)
|
||||
{
|
||||
/* Now there should be 4 data in FIFO */
|
||||
FifoCnt = (AD5940_FIFOGetCnt()/4)*4;
|
||||
AD5940_FIFORd((uint32_t *)pBuff, FifoCnt);
|
||||
AD5940_INTCClrFlag(AFEINTSRC_DATAFIFOTHRESH);
|
||||
AppBIOZRegModify(pBuff, &FifoCnt); /* If there is need to do AFE re-configure, do it here when AFE is in active state */
|
||||
AD5940_EnterSleepS(); /* Manually put AFE back to hibernate mode to save power. */
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Allow AFE to enter hibernate mode */
|
||||
/* Process data */
|
||||
AppBIOZDataProcess((int32_t*)pBuff,&FifoCnt);
|
||||
*pCount = FifoCnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
/*!
|
||||
@file: BIOZ-2Wire.h
|
||||
@author: Neo Xu
|
||||
@brief: 4-wire BIOZ measurement header file.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _BODYCOMPOSITION_H_
|
||||
#define _BODYCOMPOSITION_H_
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
#define MAXSWEEP_POINTS 100 /* Need to know how much buffer is needed to save RTIA calibration result */
|
||||
|
||||
/*
|
||||
Note: this example will use SEQID_0 as measurement sequence, and use SEQID_1 as init sequence.
|
||||
SEQID_3 is used for calibration.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Common configurations for all kinds of Application. */
|
||||
BoolFlag bParaChanged; /* Indicate to generate sequence again. It's auto cleared by AppBIOZInit */
|
||||
uint32_t SeqStartAddr; /* Initialaztion sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLen; /* Limit the maximum sequence. */
|
||||
uint32_t SeqStartAddrCal; /* Measurement sequence start address in SRAM of AD5940 */
|
||||
uint32_t MaxSeqLenCal;
|
||||
/* Application related parameters */
|
||||
//BoolFlag bBioElecBoard; /* The code is same for BioElec board and AD5941Sens1 board. No changes are needed */
|
||||
BoolFlag ReDoRtiaCal; /* Set this flag to bTRUE when there is need to do calibration. */
|
||||
float SysClkFreq; /* The real frequency of system clock */
|
||||
float WuptClkFreq; /* The clock frequency of Wakeup Timer in Hz. Typically it's 32kHz. Leave it here in case we calibrate clock in software method */
|
||||
float AdcClkFreq; /* The real frequency of ADC clock */
|
||||
uint32_t FifoThresh; /* FIFO threshold. Should be N*2 */
|
||||
float BIOZODR; /* in Hz. ODR decides the period of WakeupTimer who will trigger sequencer periodically. DFT number and sample frequency decides the maxim ODR. */
|
||||
int32_t NumOfData; /* By default it's '-1'. If you want the engine stops after get NumofData, then set the value here. Otherwise, set it to '-1' which means never stop. */
|
||||
float SinFreq; /* Frequency of excitation signal */
|
||||
float RcalVal; /* Rcal value in Ohm */
|
||||
uint32_t PwrMod; /* Control Chip power mode(LP/HP) */
|
||||
float DacVoltPP; /* Final excitation voltage is DacVoltPP*DAC_PGA*EXCIT_GAIN, DAC_PGA= 1 or 0.2, EXCIT_GAIN=2 or 0.25. DAC output voltage in mV peak to peak. Maximum value is 800mVpp. Peak to peak voltage */
|
||||
uint32_t ExcitBufGain; /* Select from EXCITBUFGAIN_2, EXCITBUFGAIN_0P25 */
|
||||
uint32_t HsDacGain; /* Select from HSDACGAIN_1, HSDACGAIN_0P2 */
|
||||
uint32_t HsDacUpdateRate; /* DAC update rate is SystemCLoock/Divider. The available value is 7 to 255. Set to 7 for better performance */
|
||||
uint32_t ADCPgaGain; /* PGA Gain select from GNPGA_1, GNPGA_1_5, GNPGA_2, GNPGA_4, GNPGA_9 !!! We must ensure signal is in range of +-1.5V which is limited by ADC input stage */
|
||||
uint8_t ADCSinc3Osr; /* SINC3 OSR selection. ADCSINC3OSR_2, ADCSINC3OSR_4 */
|
||||
uint8_t ADCSinc2Osr; /* SINC2 OSR selection. ADCSINC2OSR_22...ADCSINC2OSR_1333 */
|
||||
uint32_t HstiaRtiaSel; /* Use internal RTIA, select from RTIA_INT_200, RTIA_INT_1K, RTIA_INT_5K, RTIA_INT_10K, RTIA_INT_20K, RTIA_INT_40K, RTIA_INT_80K, RTIA_INT_160K */
|
||||
uint32_t CtiaSel; /* Select CTIA in pF unit from 0 to 31pF */
|
||||
|
||||
uint32_t DftNum; /* DFT number */
|
||||
uint32_t DftSrc; /* DFT Source */
|
||||
BoolFlag HanWinEn; /* Enable Hanning window */
|
||||
|
||||
/* Switch Configuration */
|
||||
uint32_t DswitchSel;
|
||||
uint32_t PswitchSel;
|
||||
uint32_t NswitchSel;
|
||||
uint32_t TswitchSel;
|
||||
|
||||
/* Sweep Function Control */
|
||||
SoftSweepCfg_Type SweepCfg;
|
||||
/* Private variables for internal usage */
|
||||
float SweepCurrFreq;
|
||||
float SweepNextFreq;
|
||||
fImpCar_Type RtiaCurrValue; /* Calibrated Rtia value at current frequency */
|
||||
fImpCar_Type RtiaCalTable[MAXSWEEP_POINTS]; /* Calibrated Rtia Value table */
|
||||
float FreqofData; /* The frequency of latest data sampled */
|
||||
BoolFlag BIOZInited; /* If the program run firstly, generated sequence commands */
|
||||
SEQInfo_Type InitSeqInfo;
|
||||
SEQInfo_Type MeasureSeqInfo;
|
||||
BoolFlag StopRequired; /* After FIFO is ready, stop the measurement sequence */
|
||||
uint32_t FifoDataCount; /* Count how many times impedance have been measured */
|
||||
/* End */
|
||||
}AppBIOZCfg_Type;
|
||||
|
||||
#define BIOZCTRL_START 0
|
||||
#define BIOZCTRL_STOPNOW 1
|
||||
#define BIOZCTRL_STOPSYNC 2
|
||||
#define BIOZCTRL_GETFREQ 3 /* Get Current frequency of returned data from ISR */
|
||||
#define BIOZCTRL_SHUTDOWN 4 /* Note: shutdown here means turn off everything and put AFE to hibernate mode. The word 'SHUT DOWN' is only used here. */
|
||||
|
||||
AD5940Err AppBIOZGetCfg(void *pCfg);
|
||||
AD5940Err AppBIOZInit(uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err AppBIOZISR(void *pBuff, uint32_t *pCount);
|
||||
AD5940Err AppBIOZCtrl(int32_t BcmCtrl, void *pPara);
|
||||
AD5940Err AppBIOZCheckFreq(float freq);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>16000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name>(105=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066EFF485457725187092317 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>1</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.DACCodePerStep</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrRampCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>3</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.CurrVzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>4</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>VzeroCode</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>5</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroStart</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>6</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>AppRAMPCfg.VzeroPeak </ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\NUCLEOF411Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>NUCLEOF411Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BIOZ-2Wire.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BIOZ-2Wire.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
|
|
@ -0,0 +1,589 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>AD5940Prj</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pArmCC>5060750::V5.06 update 6 (build 750)::ARMCC</pArmCC>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32F411RETx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x20000) IROM(0x08000000,0x80000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL080000 -FP0($$Device:STM32F411RETx$CMSIS\Flash\STM32F4xx_512.FLM))</FlashDriverDll>
|
||||
<DeviceId>0</DeviceId>
|
||||
<RegisterFile>$$Device:STM32F411RETx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h</RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32F411RETx$CMSIS\SVD\STM32F411xx.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\OUT\</OutputDirectory>
|
||||
<OutputName>NUCLEOF411</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>1</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>1</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments> -REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments> -MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x80000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x20000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_STDPERIPH_DRIVER,STM32F411xE,CHIPSEL_594X,ADI_DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\AD5940Lib;..\..\STM32F4StdLib\CMSIS\Device\ST\STM32F4xx\Include;..\..\STM32F4StdLib\STM32F4xx_StdPeriph_Driver\inc;..\..\STM32F4StdLib\CMSIS\Include;..\;.\</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>0</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>ad5940.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\AD5940Lib\ad5940.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>NUCLEOF411Port.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\NUCLEOF411Port.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>AD5940Main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\AD5940Main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>BIOZ-2Wire.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\BIOZ-2Wire.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis>
|
||||
<api Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" exclusive="1">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</api>
|
||||
</apis>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.2.0" condition="ARMv6_7_8-M Device">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.5.1"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 Framework Classic">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Common" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL Common">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="Cortex" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="DMA" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="GPIO" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="PWR" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="RCC" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL GPIO">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="SPI" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="STM32Cube HAL" Csub="UART" Cvendor="Keil" Cversion="1.7.4" condition="STM32F4 HAL DMA">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.2" condition="STM32F4 CMSIS">
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.13.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx MD ARMCC" name="Device\Source\ARM\startup_stm32f10x_md.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\startup_stm32f10x_md.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103C8\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="RTE_Driver\Config\RTE_Device.h" version="1.1.2">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\RTE_Device.h</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F1xx HD ARMCC" name="Device\Source\ARM\startup_stm32f10x_hd.s" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\startup_stm32f10x_hd.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\StdPeriph_Driver\templates\stm32f10x_conf.h" version="3.5.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\stm32f10x_conf.h</instance>
|
||||
<component Cclass="Device" Cgroup="StdPeriph Drivers" Csub="Framework" Cvendor="Keil" Cversion="3.5.1" condition="STM32F1xx STDPERIPH"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Device\Source\system_stm32f10x.c" version="1.0.0">
|
||||
<instance index="0" removed="1">RTE\Device\STM32F103RE\system_stm32f10x.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="STM32F1xx CMSIS"/>
|
||||
<package name="STM32F1xx_DFP" schemaVersion="1.4.0" url="http://www.keil.com/pack/" vendor="Keil" version="2.2.0"/>
|
||||
<targetInfos/>
|
||||
</file>
|
||||
<file attr="config" category="header" name="CMSIS\Driver\Config\RTE_Device.h" version="2.4.5">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\RTE_Device.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" condition="STM32F411xE_ARMCC" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm\startup_stm32f411xe.s" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\startup_stm32f411xe.s</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="header" name="MDK\Templates\Inc\stm32f4xx_hal_conf.h" version="1.7.6">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\stm32f4xx_hal_conf.h</instance>
|
||||
<component Capiversion="1.0.0" Cclass="Device" Cgroup="STM32Cube Framework" Csub="Classic" Cvendor="Keil" Cversion="1.7.6" condition="STM32F4 Framework Classic"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
<file attr="config" category="source" name="Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c" version="2.6.2">
|
||||
<instance index="0">RTE\Device\STM32F411RETx\system_stm32f4xx.c</instance>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="2.6.3" condition="STM32F4 CMSIS"/>
|
||||
<package name="STM32F4xx_DFP" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="2.14.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="AD5940Prj"/>
|
||||
</targetInfos>
|
||||
</file>
|
||||
</files>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
/**
|
||||
* @file NUCLEOF411Port.c
|
||||
* @brief ST NUCLEOF411 board port file.
|
||||
* @version V0.2.0
|
||||
* @author ADI
|
||||
* @date March 2019
|
||||
* @par Revision History:
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
#include "ad5940.h"
|
||||
#include "stdio.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Definition for STM32 SPI clock resources */
|
||||
#define AD5940SPI SPI1
|
||||
#define AD5940_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE()
|
||||
#define AD5940_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MISO_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define AD5940_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_RST_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define AD5940_GP0INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
#define AD5940SPI_FORCE_RESET() __HAL_RCC_SPI1_FORCE_RESET()
|
||||
#define AD5940SPI_RELEASE_RESET() __HAL_RCC_SPI1_RELEASE_RESET()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define AD5940_SCK_PIN GPIO_PIN_5
|
||||
#define AD5940_SCK_GPIO_PORT GPIOA
|
||||
#define AD5940_SCK_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MISO_PIN GPIO_PIN_6
|
||||
#define AD5940_MISO_GPIO_PORT GPIOA
|
||||
#define AD5940_MISO_AF GPIO_AF5_SPI1
|
||||
#define AD5940_MOSI_PIN GPIO_PIN_7
|
||||
#define AD5940_MOSI_GPIO_PORT GPIOA
|
||||
#define AD5940_MOSI_AF GPIO_AF5_SPI1
|
||||
|
||||
#define AD5940_CS_PIN GPIO_PIN_6
|
||||
#define AD5940_CS_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_RST_PIN GPIO_PIN_0 //A3
|
||||
#define AD5940_RST_GPIO_PORT GPIOB
|
||||
|
||||
#define AD5940_GP0INT_PIN GPIO_PIN_10 //A3
|
||||
#define AD5940_GP0INT_GPIO_PORT GPIOA
|
||||
#define AD5940_GP0INT_IRQn EXTI15_10_IRQn
|
||||
|
||||
SPI_HandleTypeDef SpiHandle;
|
||||
|
||||
#define SYSTICK_MAXCOUNT ((1L<<24)-1) /* we use Systick to complete function Delay10uS(). This value only applies to NUCLEOF411 board. */
|
||||
#define SYSTICK_CLKFREQ 100000000L /* Systick clock frequency in Hz. This only appies to NUCLEOF411 board */
|
||||
volatile static uint8_t ucInterrupted = 0; /* Flag to indicate interrupt occurred */
|
||||
|
||||
/**
|
||||
@brief Using SPI to transmit N bytes and return the received bytes. This function targets to
|
||||
provide a more efficent way to transmit/receive data.
|
||||
@param pSendBuffer :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the data to be sent.
|
||||
@param pRecvBuff :{0 - 0xFFFFFFFF}
|
||||
- Pointer to the buffer used to store received data.
|
||||
@param length :{0 - 0xFFFFFFFF}
|
||||
- Data length in SendBuffer.
|
||||
@return None.
|
||||
**/
|
||||
void AD5940_ReadWriteNBytes(unsigned char *pSendBuffer,unsigned char *pRecvBuff,unsigned long length)
|
||||
{
|
||||
HAL_SPI_TransmitReceive(&SpiHandle, pSendBuffer, pRecvBuff, length, (uint32_t)-1);
|
||||
}
|
||||
|
||||
void AD5940_CsClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_CsSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_CS_GPIO_PORT, AD5940_CS_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstSet(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
void AD5940_RstClr(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(AD5940_RST_GPIO_PORT, AD5940_RST_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
void AD5940_Delay10us(uint32_t time)
|
||||
{
|
||||
time/=100;
|
||||
if(time == 0) time =1;
|
||||
HAL_Delay(time);
|
||||
}
|
||||
|
||||
uint32_t AD5940_GetMCUIntFlag(void)
|
||||
{
|
||||
return ucInterrupted;
|
||||
}
|
||||
|
||||
uint32_t AD5940_ClrMCUIntFlag(void)
|
||||
{
|
||||
ucInterrupted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t AD5940_MCUResourceInit(void *pCfg)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
/* Step1, initialize SPI peripheral and its GPIOs for CS/RST */
|
||||
AD5940_SCK_GPIO_CLK_ENABLE();
|
||||
AD5940_MISO_GPIO_CLK_ENABLE();
|
||||
AD5940_MOSI_GPIO_CLK_ENABLE();
|
||||
AD5940_CS_GPIO_CLK_ENABLE();
|
||||
AD5940_RST_GPIO_CLK_ENABLE();
|
||||
/* Enable SPI clock */
|
||||
AD5940_CLK_ENABLE();
|
||||
|
||||
GPIO_InitStruct.Pin = AD5940_SCK_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = AD5940_SCK_AF;
|
||||
HAL_GPIO_Init(AD5940_SCK_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MISO GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MISO_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MISO_AF;
|
||||
HAL_GPIO_Init(AD5940_MISO_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI MOSI GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_MOSI_PIN;
|
||||
GPIO_InitStruct.Alternate = AD5940_MOSI_AF;
|
||||
HAL_GPIO_Init(AD5940_MOSI_GPIO_PORT, &GPIO_InitStruct);
|
||||
/* SPI CS GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_CS_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
HAL_GPIO_Init(AD5940_CS_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* SPI RST GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = AD5940_RST_PIN;
|
||||
HAL_GPIO_Init(AD5940_RST_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
AD5940_CsSet();
|
||||
AD5940_RstSet();
|
||||
|
||||
/* Set the SPI parameters */
|
||||
SpiHandle.Instance = AD5940SPI;
|
||||
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; //SPI clock should be < AD5940_SystemClock
|
||||
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
SpiHandle.Init.CRCPolynomial = 7;
|
||||
SpiHandle.Init.NSS = SPI_NSS_SOFT;
|
||||
SpiHandle.Init.Mode = SPI_MODE_MASTER;
|
||||
HAL_SPI_Init(&SpiHandle);
|
||||
|
||||
/* Step 2: Configure external interrupot line */
|
||||
AD5940_GP0INT_GPIO_CLK_ENABLE();
|
||||
GPIO_InitStruct.Pin = AD5940_GP0INT_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = 0;
|
||||
HAL_GPIO_Init(AD5940_GP0INT_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Enable and set EXTI Line0 Interrupt to the lowest priority */
|
||||
HAL_NVIC_EnableIRQ(AD5940_GP0INT_IRQn);
|
||||
// HAL_NVIC_SetPriority(AD5940_GP0INT_IRQn, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* MCU related external line interrupt service routine */
|
||||
void EXTI15_10_IRQHandler()
|
||||
{
|
||||
ucInterrupted = 1;
|
||||
__HAL_GPIO_EXTI_CLEAR_IT(AD5940_GP0INT_PIN);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
#include "stdio.h"
|
||||
#include "AD5940.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Functions that used to initialize MCU platform */
|
||||
uint32_t MCUPlatformInit(void *pCfg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void AD5940_Main(void);
|
||||
MCUPlatformInit(0);
|
||||
AD5940_MCUResourceInit(0); /* Initialize resources that AD5940 use, like SPI/GPIO/Interrupt. */
|
||||
|
||||
printf("Hello AD5940-Build Time:%s\n",__TIME__);
|
||||
AD5940_Main();
|
||||
}
|
||||
|
||||
#define DEBUG_UART USART2
|
||||
#define DEBUG_UART_IRQN USART2_IRQn
|
||||
#define DEBUGUART_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
|
||||
#define DEBUGUART_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
|
||||
/* Definition for AD5940 Pins */
|
||||
#define DEBUGUART_TX_PIN GPIO_PIN_2
|
||||
#define DEBUGUART_TX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_TX_AF GPIO_AF7_USART2
|
||||
|
||||
#define DEBUGUART_RX_PIN GPIO_PIN_3
|
||||
#define DEBUGUART_RX_GPIO_PORT GPIOA
|
||||
#define DEBUGUART_RX_AF GPIO_AF7_USART2
|
||||
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void Error_Handler(void){
|
||||
while(1);
|
||||
}
|
||||
/**
|
||||
* @brief SPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* @param husart: SPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef *husart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
if(husart->Instance == DEBUG_UART)
|
||||
{
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable GPIO TX/RX clock */
|
||||
DEBUGUART_GPIO_CLK_ENABLE();
|
||||
/* Enable UART clock */
|
||||
DEBUGUART_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* UART TX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_TX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_TX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_TX_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* UART RX GPIO pin configuration */
|
||||
GPIO_InitStruct.Pin = DEBUGUART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Alternate = DEBUGUART_RX_AF;
|
||||
HAL_GPIO_Init(DEBUGUART_RX_GPIO_PORT, &GPIO_InitStruct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
|
||||
/** Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 100;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/** Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MCUPlatformInit(void *pCfg)
|
||||
{
|
||||
HAL_Init();
|
||||
SystemClock_Config();
|
||||
HAL_Init();
|
||||
/* Init UART */
|
||||
UartHandle.Instance = DEBUG_UART;
|
||||
|
||||
UartHandle.Init.BaudRate = 230400;
|
||||
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
UartHandle.Init.StopBits = UART_STOPBITS_1;
|
||||
UartHandle.Init.Parity = UART_PARITY_NONE;
|
||||
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
|
||||
UartHandle.Init.Mode = UART_MODE_TX_RX;
|
||||
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
|
||||
if(HAL_UART_Init(&UartHandle) != HAL_OK)
|
||||
{
|
||||
/* Initialization Error */
|
||||
return 0;
|
||||
}
|
||||
__HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);
|
||||
HAL_NVIC_EnableIRQ(DEBUG_UART_IRQN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
//void UARTCmd_Process(char);
|
||||
volatile char c;
|
||||
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE))
|
||||
{
|
||||
c = USART2->DR;
|
||||
//UARTCmd_Process(c);
|
||||
}
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#ifdef __ICCARM__
|
||||
int putchar(int c)
|
||||
#else
|
||||
int fputc(int c, FILE *f)
|
||||
#endif
|
||||
{
|
||||
uint8_t t = c;
|
||||
HAL_UART_Transmit(&UartHandle, &t, 1, 1000);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
|
@ -0,0 +1,338 @@
|
|||
/*!
|
||||
*****************************************************************************
|
||||
@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.
|
||||
|
||||
*****************************************************************************/
|
||||
#include "ad5940.h"
|
||||
#include "AD5940.h"
|
||||
#include <stdio.h>
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
#include "BodyImpedance.h"
|
||||
#include "Electrocardiograph.h"
|
||||
#include "ElectrodermalActivity.h"
|
||||
|
||||
#define APP_NUM 3 /* Totally, we have 3 applications */
|
||||
|
||||
#define APP_ID_EDA 0
|
||||
#define APP_ID_ECG 1
|
||||
#define APP_ID_BIA 2
|
||||
|
||||
#define APP_EDA_SEQ_ADDR 0
|
||||
#define APP_ECG_SEQ_ADDR 256
|
||||
#define APP_BIA_SEQ_ADDR 384
|
||||
|
||||
#define APP_EDA_MAX_SEQLEN 256
|
||||
#define APP_ECG_MAX_SEQLEN 128
|
||||
#define APP_BIA_MAX_SEQLEN 128
|
||||
|
||||
typedef struct
|
||||
{
|
||||
AD5940Err (*pAppGetCfg) (void *pCfg);
|
||||
AD5940Err (*pAppInit) (uint32_t *pBuffer, uint32_t BufferSize);
|
||||
AD5940Err (*pAppISR) (void *pBuff, uint32_t *pCount);
|
||||
AD5940Err (*pAppCtrl) (int32_t BcmCtrl, void *pPara);
|
||||
AD5940Err (*pAppUserDataProc) (void *pBuff, uint32_t pCount);
|
||||
}BioElecApp_Type;
|
||||
|
||||
AD5940Err BIAShowResult(void *pData, uint32_t DataCount);
|
||||
AD5940Err ECGShowResult(void *pData, uint32_t DataCount);
|
||||
AD5940Err EDAShowResult(void *pData, uint32_t DataCount);
|
||||
|
||||
BioElecApp_Type BioElecAppList[APP_NUM]=
|
||||
{
|
||||
/* EDA App */
|
||||
{
|
||||
.pAppGetCfg = AppEDAGetCfg,
|
||||
.pAppInit = AppEDAInit,
|
||||
.pAppISR = AppEDAISR,
|
||||
.pAppCtrl = AppEDACtrl,
|
||||
.pAppUserDataProc = EDAShowResult,
|
||||
},
|
||||
/* ECG App */
|
||||
{
|
||||
.pAppGetCfg = AppECGGetCfg,
|
||||
.pAppInit = AppECGInit,
|
||||
.pAppISR = AppECGISR,
|
||||
.pAppCtrl = AppECGCtrl,
|
||||
.pAppUserDataProc = ECGShowResult,
|
||||
},
|
||||
/* BIA App */
|
||||
{
|
||||
.pAppGetCfg = AppBIAGetCfg,
|
||||
.pAppInit = AppBIAInit,
|
||||
.pAppISR = AppBIAISR,
|
||||
.pAppCtrl = AppBIACtrl,
|
||||
.pAppUserDataProc = BIAShowResult,
|
||||
},
|
||||
};
|
||||
#define APPBUFF_SIZE 512
|
||||
uint32_t AppBuff[APPBUFF_SIZE];
|
||||
float LFOSCFreq; /* Measured LFOSC frequency */
|
||||
|
||||
/* It's your choice here how to do with the data. Here is just an example to print them to UART */
|
||||
AD5940Err BIAShowResult(void *pData, uint32_t DataCount)
|
||||
{
|
||||
float freq;
|
||||
|
||||
fImpPol_Type *pImp = (fImpPol_Type*)pData;
|
||||
AppBIACtrl(BIACTRL_GETFREQ, &freq);
|
||||
|
||||
printf("Freq:%.2f ", freq);
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("RzMag: %f Ohm , RzPhase: %f \n",pImp[i].Magnitude,pImp[i].Phase*180/MATH_PI);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* print ECG result to uart */
|
||||
AD5940Err ECGShowResult(void *pData, uint32_t DataCount)
|
||||
{
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
printf("i:%d, %d \n", i, ((uint32_t *)pData)[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* print EDA result to uart */
|
||||
AD5940Err EDAShowResult(void *pData, uint32_t DataCount)
|
||||
{
|
||||
float RtiaMag;
|
||||
float mag, phase;
|
||||
/*Process data*/
|
||||
fImpCar_Type *pImp = (fImpCar_Type*)pData;
|
||||
AppEDACtrl(EDACTRL_GETRTIAMAG, &RtiaMag);
|
||||
|
||||
/*Process data*/
|
||||
for(int i=0;i<DataCount;i++)
|
||||
{
|
||||
mag = AD5940_ComplexMag(&pImp[i]);
|
||||
phase = AD5940_ComplexPhase(&pImp[i])*180/MATH_PI;
|
||||
printf("Rtia:%.2f, RzMag: %f Ohm , RzPhase: %f degree \n",RtiaMag, mag, phase);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize AD5940 basic blocks like clock */
|
||||
static int32_t AD5940PlatformCfg(void)
|
||||
{
|
||||
CLKCfg_Type clk_cfg;
|
||||
FIFOCfg_Type fifo_cfg;
|
||||
SEQCfg_Type seq_cfg;
|
||||
AGPIOCfg_Type gpio_cfg;
|
||||
LFOSCMeasure_Type LfoscMeasure;
|
||||
|
||||
/* Use hardware reset */
|
||||
AD5940_HWReset();
|
||||
/* Platform configuration */
|
||||
AD5940_Initialize();
|
||||
/* Step1. Configure clock */
|
||||
clk_cfg.ADCClkDiv = ADCCLKDIV_1;
|
||||
clk_cfg.ADCCLkSrc = ADCCLKSRC_HFOSC;
|
||||
clk_cfg.SysClkDiv = SYSCLKDIV_1;
|
||||
clk_cfg.SysClkSrc = SYSCLKSRC_HFOSC;
|
||||
clk_cfg.HfOSC32MHzMode = bFALSE;
|
||||
clk_cfg.HFOSCEn = bTRUE;
|
||||
clk_cfg.HFXTALEn = bFALSE;
|
||||
clk_cfg.LFOSCEn = bTRUE;
|
||||
AD5940_CLKCfg(&clk_cfg);
|
||||
/* Step2. Configure FIFO and Sequencer*/
|
||||
fifo_cfg.FIFOEn = bFALSE;
|
||||
fifo_cfg.FIFOMode = FIFOMODE_FIFO;
|
||||
fifo_cfg.FIFOSize = FIFOSIZE_4KB; /* 4kB for FIFO, The reset 2kB for sequencer */
|
||||
fifo_cfg.FIFOSrc = FIFOSRC_DFT;
|
||||
fifo_cfg.FIFOThresh = 4;//AppBIACfg.FifoThresh; /* DFT result. One pair for RCAL, another for Rz. One DFT result have real part and imaginary part */
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Disable to reset FIFO. */
|
||||
fifo_cfg.FIFOEn = bTRUE;
|
||||
AD5940_FIFOCfg(&fifo_cfg); /* Enable FIFO here */
|
||||
/* Configure sequencer and stop it */
|
||||
seq_cfg.SeqMemSize = SEQMEMSIZE_2KB;
|
||||
seq_cfg.SeqBreakEn = bFALSE;
|
||||
seq_cfg.SeqIgnoreEn = bFALSE;
|
||||
seq_cfg.SeqCntCRCClr = bTRUE;
|
||||
seq_cfg.SeqEnable = bFALSE;
|
||||
seq_cfg.SeqWrTimer = 0;
|
||||
AD5940_SEQCfg(&seq_cfg);
|
||||
|
||||
/* Step3. Interrupt controller */
|
||||
AD5940_INTCCfg(AFEINTC_1, AFEINTSRC_ALLINT, bTRUE); /* Enable all interrupt in Interrupt Controller 1, so we can check INTC flags */
|
||||
AD5940_INTCCfg(AFEINTC_0, AFEINTSRC_DATAFIFOTHRESH, bTRUE); /* Interrupt Controller 0 will control GP0 to generate interrupt to MCU */
|
||||
AD5940_INTCClrFlag(AFEINTSRC_ALLINT);
|
||||
/* Step4: Reconfigure GPIO */
|
||||
gpio_cfg.FuncSet = GP6_SYNC|GP5_SYNC|GP4_SYNC|GP2_EXTCLK|GP1_SYNC|GP0_INT;
|
||||
gpio_cfg.InputEnSet = AGPIO_Pin2;
|
||||
gpio_cfg.OutputEnSet = AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6;
|
||||
gpio_cfg.OutVal = 0;
|
||||
gpio_cfg.PullEnSet = 0;
|
||||
AD5940_AGPIOCfg(&gpio_cfg);
|
||||
|
||||
AD5940_SleepKeyCtrlS(SLPKEY_UNLOCK); /* Enable AFE to enter sleep mode. */
|
||||
|
||||
/* Measure LFOSC frequency */
|
||||
LfoscMeasure.CalDuration = 1000.0; /* 1000ms used for calibration. */
|
||||
LfoscMeasure.CalSeqAddr = 0;
|
||||
LfoscMeasure.SystemClkFreq = 16000000.0f; /* 16MHz in this firmware. */
|
||||
AD5940_LFOSCMeasure(&LfoscMeasure, &LFOSCFreq);
|
||||
printf("Freq:%f\n", LFOSCFreq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940BIAStructInit(void)
|
||||
{
|
||||
AppBIACfg_Type *pBIACfg;
|
||||
|
||||
AppBIAGetCfg(&pBIACfg);
|
||||
|
||||
pBIACfg->SeqStartAddr = APP_BIA_SEQ_ADDR;
|
||||
pBIACfg->MaxSeqLen = APP_BIA_MAX_SEQLEN; /* @todo add checker in function */
|
||||
|
||||
pBIACfg->RcalVal = 10000.0;
|
||||
pBIACfg->DftNum = DFTNUM_8192;
|
||||
pBIACfg->NumOfData = -1; /* Never stop until you stop it manually by AppBIACtrl() function */
|
||||
pBIACfg->BiaODR = 20; /* ODR(Sample Rate) 20Hz */
|
||||
pBIACfg->FifoThresh = 4; /* 4 */
|
||||
pBIACfg->ADCSinc3Osr = ADCSINC3OSR_2;
|
||||
pBIACfg->LfoscClkFreq = LFOSCFreq;
|
||||
|
||||
pBIACfg->bParaChanged = bTRUE; /* Always initialize AFE. */
|
||||
}
|
||||
|
||||
/* !!Change the application parameters here if you want to change it to none-default value */
|
||||
void AD5940ECGStructInit(void)
|
||||
{
|
||||
AppECGCfg_Type *pCfg;
|
||||
|
||||
AppECGGetCfg(&pCfg);
|
||||
|
||||
pCfg->SeqStartAddr = APP_ECG_SEQ_ADDR;
|
||||
pCfg->MaxSeqLen = APP_ECG_MAX_SEQLEN; /* @todo add checker in function */
|
||||
|
||||
pCfg->ECGODR = 250; /* ODR(Sample Rate) 200Hz */
|
||||
pCfg->FifoThresh = 256; /* 4 */
|
||||
pCfg->ADCSinc3Osr = ADCSINC3OSR_2;
|
||||
pCfg->LfoscClkFreq = LFOSCFreq;
|
||||
pCfg->bParaChanged = bTRUE; /* We always initialize AFE. */
|
||||
}
|
||||
|
||||
void AD5940EDAStructInit(void)
|
||||
{
|
||||
AppEDACfg_Type *pCfg;
|
||||
|
||||
AppEDAGetCfg(&pCfg);
|
||||
pCfg->SeqStartAddr = APP_EDA_SEQ_ADDR;
|
||||
pCfg->MaxSeqLen = APP_EDA_MAX_SEQLEN;
|
||||
|
||||
pCfg->LfoscClkFreq = LFOSCFreq;
|
||||
|
||||
pCfg->bParaChanged = bTRUE; /* We always initialize AFE. */
|
||||
}
|
||||
|
||||
BioElecApp_Type *pCurrApp;
|
||||
uint8_t bSwitchingApp = 1;
|
||||
uint8_t toApp = APP_ID_BIA;
|
||||
|
||||
void AD5940_Main(void)
|
||||
{
|
||||
static uint32_t IntCount;
|
||||
uint32_t temp;
|
||||
|
||||
AD5940PlatformCfg();
|
||||
AD5940BIAStructInit(); /* Configure your parameters in this function */
|
||||
AD5940ECGStructInit(); /* */
|
||||
AD5940EDAStructInit(); /* */
|
||||
pCurrApp = &BioElecAppList[toApp];
|
||||
while(1)
|
||||
{
|
||||
if(bSwitchingApp)
|
||||
{
|
||||
//if the 'old' app stopped?
|
||||
BoolFlag running;
|
||||
if(pCurrApp->pAppCtrl(APPCTRL_RUNNING, &running) == AD5940ERR_OK){
|
||||
if(running == bFALSE){
|
||||
bSwitchingApp = 0;
|
||||
pCurrApp = &BioElecAppList[toApp];
|
||||
/* Initialize registers that fit to all measurements */
|
||||
AD5940PlatformCfg();
|
||||
pCurrApp->pAppInit(AppBuff, APPBUFF_SIZE);
|
||||
AD5940_ClrMCUIntFlag(); /* Clear the interrupts happened during initialization */
|
||||
pCurrApp->pAppCtrl(APPCTRL_START, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Check if interrupt flag which will be set when interrupt occurred. */
|
||||
if(AD5940_GetMCUIntFlag())
|
||||
{
|
||||
AD5940_ClrMCUIntFlag(); /* Clear this flag */
|
||||
temp = APPBUFF_SIZE;
|
||||
pCurrApp->pAppISR(AppBuff, &temp); /* Deal with it and provide a buffer to store data we got */
|
||||
if(pCurrApp->pAppUserDataProc)
|
||||
pCurrApp->pAppUserDataProc(AppBuff, temp); /* Show the results to UART */
|
||||
|
||||
if(IntCount++ == 10)
|
||||
{
|
||||
IntCount = 0;
|
||||
/* Control the application at any time */
|
||||
/* For example, I want to measure EDA excitation voltage periodically */
|
||||
//if(toApp == APP_ID_EDA)
|
||||
// pCurrApp->pAppCtrl(EDACTRL_MEASVOLT, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32_t command_start_measurement(uint32_t para1, uint32_t para2)
|
||||
{
|
||||
pCurrApp->pAppCtrl(APPCTRL_START, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t command_stop_measurement(uint32_t para1, uint32_t para2)
|
||||
{
|
||||
pCurrApp->pAppCtrl(APPCTRL_STOPNOW, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t command_switch_app(uint32_t AppID, uint32_t para2)
|
||||
{
|
||||
if(AppID == APP_ID_EDA)
|
||||
{
|
||||
AD5940EDAStructInit();
|
||||
printf("Switch to EDA application\n");
|
||||
}
|
||||
else if(AppID == APP_ID_ECG)
|
||||
{
|
||||
AD5940ECGStructInit();
|
||||
printf("Switch to ECG application\n");
|
||||
}
|
||||
else if(AppID == APP_ID_BIA)
|
||||
{
|
||||
AD5940BIAStructInit();
|
||||
printf("Switch to BIA application\n");
|
||||
}
|
||||
else{
|
||||
printf("Wrong application ID.\n");
|
||||
return (uint32_t)-1;
|
||||
}
|
||||
|
||||
if(pCurrApp)
|
||||
pCurrApp->pAppCtrl(APPCTRL_STOPSYNC, 0);
|
||||
bSwitchingApp = 1;
|
||||
toApp = AppID;
|
||||
return 0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configuration xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<packages/>
|
||||
<device Dclock="26000000" Dcore="Cortex-M3" DcoreVersion="r2p1" Dendian="Little-endian" Dfamily="ADuCM302x Series" Dfpu="NO_FPU" Dmpu="NO_MPU" Dname="ADuCM3029" Dvendor="Analog Devices:1" Pname="">
|
||||
<url>http://www.keil.com/dd2/analogdevices/aducm3029</url>
|
||||
<package info="Analog Devices ADuCM302x Device Support. (Subject to the Software License Agreement referred to in the Release Notes.)" name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
</device>
|
||||
<toolchain Tcompiler="IAR" Toutput="exe"/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.2">
|
||||
<package name="CMSIS" url="http://www.keil.com/pack/" vendor="ARM" version="5.4.0"/>
|
||||
<file category="doc" name="CMSIS/Documentation/Core/html/index.html"/>
|
||||
<file category="include" name="CMSIS/Core/Include/"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Global Configuration" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_cycle_counting_config.h" version="3.2.0"/>
|
||||
<file attr="config" category="header" deviceDependent="1" name="Include/config/adi_global_config.h" version="3.2.0"/>
|
||||
</component>
|
||||
<component Cclass="Device" Cgroup="Startup" Cvendor="AnalogDevices" Cversion="3.2.0" deviceDependent="1">
|
||||
<package name="ADuCM302x_DFP" url="http://download.analog.com/tools/EZBoards/CM302x/Releases/" vendor="AnalogDevices" version="3.2.0"/>
|
||||
<file category="include" deviceDependent="1" name="Include/"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029_IAR" deviceDependent="1" name="Source/IAR/startup_ADuCM3029.s" version="3.2.0"/>
|
||||
<file attr="config" category="source" condition="ADuCM3029" deviceDependent="1" name="Source/system_ADuCM3029.c" version="3.2.0"/>
|
||||
</component>
|
||||
</components>
|
||||
<apis/>
|
||||
</configuration>
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||
|
||||
<SchemaVersion>1.0</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Extensions>
|
||||
<cExt>*.c</cExt>
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
</Extensions>
|
||||
|
||||
<DaveTm>
|
||||
<dwLowDateTime>0</dwLowDateTime>
|
||||
<dwHighDateTime>0</dwHighDateTime>
|
||||
</DaveTm>
|
||||
|
||||
<Target>
|
||||
<TargetName>ADICUP3029</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<FlashByte>65535</FlashByte>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
</OPTHX>
|
||||
<OPTLEX>
|
||||
<PageWidth>79</PageWidth>
|
||||
<PageLength>66</PageLength>
|
||||
<TabStop>8</TabStop>
|
||||
<ListingPath>.\OUT\</ListingPath>
|
||||
</OPTLEX>
|
||||
<ListingPage>
|
||||
<CreateCListing>1</CreateCListing>
|
||||
<CreateAListing>1</CreateAListing>
|
||||
<CreateLListing>1</CreateLListing>
|
||||
<CreateIListing>0</CreateIListing>
|
||||
<AsmCond>1</AsmCond>
|
||||
<AsmSymb>1</AsmSymb>
|
||||
<AsmXref>0</AsmXref>
|
||||
<CCond>1</CCond>
|
||||
<CCode>0</CCode>
|
||||
<CListInc>0</CListInc>
|
||||
<CSymb>0</CSymb>
|
||||
<LinkerCodeListing>0</LinkerCodeListing>
|
||||
</ListingPage>
|
||||
<OPTXL>
|
||||
<LMap>1</LMap>
|
||||
<LComments>1</LComments>
|
||||
<LGenerateSymbols>1</LGenerateSymbols>
|
||||
<LLibSym>1</LLibSym>
|
||||
<LLines>1</LLines>
|
||||
<LLocSym>1</LLocSym>
|
||||
<LPubSym>1</LPubSym>
|
||||
<LXref>0</LXref>
|
||||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
<sRwatch>1</sRwatch>
|
||||
<sRmem>1</sRmem>
|
||||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
<tRfunc>0</tRfunc>
|
||||
<tRbox>1</tRbox>
|
||||
<tRtrace>1</tRtrace>
|
||||
<sRSysVw>1</sRSysVw>
|
||||
<tRSysVw>1</tRSysVw>
|
||||
<sRunDeb>0</sRunDeb>
|
||||
<sLrtime>0</sLrtime>
|
||||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>3</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
<sDlgPa></sDlgPa>
|
||||
<sIfile></sIfile>
|
||||
<tDll></tDll>
|
||||
<tDllPa></tDllPa>
|
||||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMRTXEVENTFLAGS</Key>
|
||||
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGTARM</Key>
|
||||
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGUARM</Key>
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>CMSIS_AGDI</Key>
|
||||
<Name>-X"Any" -UAny -O198 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>JL2CM3</Key>
|
||||
<Name>-U228200467 -O79 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8008 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x.FLM -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0ADuCM302x -FS00 -FL040000 -FP0($$Device:ADuCM3029$Flash\ADuCM302x.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>wupt_cfg.SeqxSleepTime[0],0x0A</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>0</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
<aPa>0</aPa>
|
||||
<viewmode>1</viewmode>
|
||||
<vrSel>0</vrSel>
|
||||
<aSym>0</aSym>
|
||||
<aTbox>0</aTbox>
|
||||
<AscS1>0</AscS1>
|
||||
<AscS2>0</AscS2>
|
||||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
<StkLoc>0</StkLoc>
|
||||
<TrcWin>0</TrcWin>
|
||||
<newCpu>0</newCpu>
|
||||
<uProt>0</uProt>
|
||||
</DebugFlag>
|
||||
<LintExecutable></LintExecutable>
|
||||
<LintConfigFile></LintConfigFile>
|
||||
<bLintAuto>0</bLintAuto>
|
||||
<bAutoGenD>0</bAutoGenD>
|
||||
<LntExFlags>0</LntExFlags>
|
||||
<pMisraName></pMisraName>
|
||||
<pszMrule></pszMrule>
|
||||
<pSingCmds></pSingCmds>
|
||||
<pMultCmds></pMultCmds>
|
||||
<pMisraNamep></pMisraNamep>
|
||||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
<Group>
|
||||
<GroupName>AD5940Lib</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>1</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\ADICUP3029Port.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ADICUP3029Port.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>1</GroupNumber>
|
||||
<FileNumber>2</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\AD5940Lib\ad5940.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ad5940.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Application</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\AD5940Main.c</PathWithFileName>
|
||||
<FilenameWithoutPath>AD5940Main.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\BodyImpedance.c</PathWithFileName>
|
||||
<FilenameWithoutPath>BodyImpedance.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>6</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\Electrocardiograph.c</PathWithFileName>
|
||||
<FilenameWithoutPath>Electrocardiograph.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\ElectrodermalActivity.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ElectrodermalActivity.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\UARTCmd.c</PathWithFileName>
|
||||
<FilenameWithoutPath>UARTCmd.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
</Group>
|
||||
|
||||
</ProjectOpt>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue