Class B Oven controller.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
Functions | |
void | ovenctl_execute_control_step (uint32_t time, uint8_t *wattage, bool *power, enum pot_t potstate) |
Execute oven control step. More... | |
uint16_t | ovenctl_get_plate_temperature (void) |
Reads a 16-bit analog value on ADC channel 0 and returns it. More... | |
void ovenctl_execute_control_step | ( | uint32_t | time, |
uint8_t * | wattage, | ||
bool * | power, | ||
enum pot_t | potstate | ||
) |
Execute oven control step.
This function takes information from the user interface, temperature sensor and plate (QTouch) sensing and controls the output to the induction elements via a frequency signal.
The oven has three states:
time | Current system time in milliseconds. |
*wattage | Pointer to the variable representing the desired effect |
*power | Pointer to the variable controlling whether the induction coils should be actuated. |
potstate | A variable representing the latest information on whether anything is present on the plate (QTouch sensor) |
References ON_ACTUATING, ON_NO_POT, ovenctl_actuate_induction_element(), ovenctl_turn_off_plate(), ovenctl_turn_on_plate(), POT_OFF, POT_ON, POWER_OFF, and rtc_get_time().
Referenced by main().
uint16_t ovenctl_get_plate_temperature | ( | void | ) |
Reads a 16-bit analog value on ADC channel 0 and returns it.
In this application CH0 is set up to read the analog voltage from a simulated thermometer.
References ADC_CH0, adc_get_unsigned_result(), adc_start_conversion(), and adc_wait_for_interrupt_flag().
Referenced by main_execute_simulation_step(), and ovenctl_periodic_temperature_sanity_check().