/* Select the mode starting the AD conversion */ void Chip_ADC_Set_StartMode(LPC_ADC_T *pADC, CHIP_ADC_START_MODE_T mode, CHIP_ADC_EDGE_CFG_T EdgeOption) { if ((mode != ADC_START_NOW) && (mode != ADC_NO_START)) { IP_ADC_EdgeStartConfig(pADC, (uint8_t) EdgeOption); } IP_ADC_SetStartMode(pADC, (uint8_t) mode); }
float fIR_sharp_GetValue(uint8_t channel) { uint32_t test; float calcul; IP_ADC_SetChannelNumber (LPC_ADC,channel,1); IP_ADC_SetStartMode (LPC_ADC, 1); while(!IP_ADC_Get_Val(LPC_ADC,channel,&test)); calcul=test; calcul=calcul/4096*3.3; calcul=calcul*0.0416666-0.0075; calcul=(1-calcul*0.42)/calcul; return calcul; }
/* Enable burst mode */ void Chip_ADC_Burst_Cmd(LPC_ADC_T *pADC, FunctionalState NewState) { IP_ADC_SetStartMode(pADC, ADC_NO_START); IP_ADC_SetBurstMode(pADC, NewState); }