示例#1
0
/* Enable burst mode */
void Chip_ADC_SetBurstCmd(LPC_ADC_T *pADC, FunctionalState NewState)
{
	setStartMode(pADC, ADC_NO_START);

	if (NewState == DISABLE) {
		pADC->CR &= ~ADC_CR_BURST;
	}
	else {
		pADC->CR |= ADC_CR_BURST;
	}
}
示例#2
0
/* Select the mode starting the AD conversion */
void Chip_ADC_SetStartMode(LPC_ADC_T *pADC, ADC_START_MODE_T mode, ADC_EDGE_CFG_T EdgeOption)
{
	if ((mode != ADC_START_NOW) && (mode != ADC_NO_START)) {
		if (EdgeOption) {
			pADC->CR |= ADC_CR_EDGE;
		}
		else {
			pADC->CR &= ~ADC_CR_EDGE;
		}
	}
	setStartMode(pADC, (uint8_t) mode);
}
int ECCalibrateScreen::handleScreen()
{

	int pressed_button = myButtons.checkButtons();

	 if (pressed_button==backButton)
		{
		handleExitScreen();
		return EC_BUTTON;
		}
	if (pressed_button==resetButton)
		{
		factoryReset();
		}
	if (pressed_button==infoButton)
		{
		getInfo();
		}
	if (pressed_button==readButton)
		{
		getSingleReading();
		}
	if (pressed_button==tempReadButton)
		{
		getTempSingleReading();
		}
	if (pressed_button==startButton)
		{
		setStartMode();
		}
	if (pressed_button==stopButton)
		{
		setStopMode();
		}
	if (pressed_button==calibrateButton)
		{
		startCalibration();
		}
	 if (pressed_button==subBackButton && !factReset)
		 {
		 drawScreen();
		 }

	 factReset = false;

	return NONE;
}