Microchip® Advanced Software Framework

oven_ui.h File Reference

Class B Oven User Interface.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>

Functions

bool oven_ui_back_button_is_pressed (void)
 Report whether the back button has been pressed and released. More...
 
void oven_ui_draw_axis (void)
 Draw vertical and horizontal axis. More...
 
void oven_ui_draw_plot_step (const uint8_t y1, const uint8_t y2)
 Plot a simulation time-step of the cooking plate and pot contents. More...
 
bool oven_ui_power_button_is_pressed (void)
 Report whether the power button has been pressed and released. More...
 
void oven_ui_set_status_leds (enum status_led s)
 Set the status LED to specified color. More...
 
void oven_ui_update_graphics (enum pot_t potstate, uint8_t wattage, bool power)
 Update user interface elements. More...
 

bool oven_ui_back_button_is_pressed ( void  )

Report whether the back button has been pressed and released.

Returns
true if the back button has been pressed and released

References gpio_pin_is_high, and gpio_pin_is_low.

Referenced by main().

void oven_ui_draw_axis ( void  )

Draw vertical and horizontal axis.

References gfx_mono_generic_draw_line(), and GFX_PIXEL_SET.

Referenced by main(), and oven_ui_draw_plot_step().

void oven_ui_draw_plot_step ( const uint8_t  y1,
const uint8_t  y2 
)

Plot a simulation time-step of the cooking plate and pot contents.

The input values must be between 0 and 32 to fit inside the display.

Parameters
y1Temperature of pot
y2Temperature of plate

References gfx_mono_draw_filled_rect, gfx_mono_generic_draw_line(), GFX_PIXEL_CLR, GFX_PIXEL_SET, OVEN_DISP_MAX_Y, OVEN_PLOT_MAX_X, OVEN_PLOT_MAX_Y, OVEN_PLOT_MIN_Y, OVEN_PLOT_OFFSET_X, oven_ui_draw_axis(), and temp.

Referenced by main_execute_simulation_step().

bool oven_ui_power_button_is_pressed ( void  )

Report whether the power button has been pressed and released.

Returns
true if the power button has been pressed and released

References gpio_pin_is_high, and gpio_pin_is_low.

Referenced by main().

void oven_ui_set_status_leds ( enum status_led  s)

Set the status LED to specified color.

Referenced by main(), and oven_classb_run_tests().

void oven_ui_update_graphics ( enum pot_t  potstate,
uint8_t  wattage,
bool  power 
)

Update user interface elements.

Draw bitmap representing state of Q-Touch button as a pot on a plate, and a vertical bar representing the selected power level and whether the plate element is being actuated.

Parameters
potstateWhether a pot is detected
wattagePower level
powerWhether power is applied

References bitmap_pot_off, bitmap_pot_on, gfx_mono_draw_filled_rect, gfx_mono_put_bitmap, GFX_PIXEL_CLR, GFX_PIXEL_SET, max, MAX_WATTAGE, min, and POT_ON.

Referenced by main().