2020-05-16 21:00:55 +02:00
|
|
|
/* Reflow Oven Controller
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
|
|
|
*
|
|
|
|
* This file is part of the Reflow Oven Controller Project.
|
|
|
|
*
|
|
|
|
* The reflow oven controller is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with the reflow oven controller project.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-07-06 21:12:18 +02:00
|
|
|
/**
|
|
|
|
* @addtogroup safety-adc
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2020-05-16 21:00:55 +02:00
|
|
|
#ifndef __SAFETY_ADC_H__
|
|
|
|
#define __SAFETY_ADC_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
enum safety_adc_meas_channel {SAFETY_ADC_MEAS_VREF, SAFETY_ADC_MEAS_TEMP};
|
2020-06-14 23:22:35 +02:00
|
|
|
|
2020-05-16 21:00:55 +02:00
|
|
|
void safety_adc_init();
|
|
|
|
|
|
|
|
void safety_adc_deinit();
|
|
|
|
|
|
|
|
void safety_adc_trigger_meas(enum safety_adc_meas_channel measurement);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Poll ADC result.
|
|
|
|
* @param results adc results
|
|
|
|
* @return 1 if measurement successful, 0 if not ready, -1 if ADC aborted or not started
|
|
|
|
*/
|
|
|
|
int safety_adc_poll_result(uint16_t *adc_result);
|
|
|
|
|
|
|
|
enum safety_adc_check_result handle_safety_adc();
|
|
|
|
|
2020-07-09 22:31:42 +02:00
|
|
|
float safety_adc_convert_channel(enum safety_adc_meas_channel channel, uint16_t analog_value);
|
2020-05-16 21:00:55 +02:00
|
|
|
|
|
|
|
#endif /* __SAFETY_ADC_H__ */
|
2020-07-06 21:12:18 +02:00
|
|
|
|
|
|
|
/** @} */
|