Viking Skull Lamp  V1.0.1
Loading...
Searching...
No Matches
menu.hpp File Reference
#include "Arduino.h"
#include "oled.hpp"
#include <avr/pgmspace.h>

Go to the source code of this file.

Classes

class  menuItem
 Menu Item Class. More...
 
class  menu
 Menu Controller Class. More...
 

Enumerations

enum  lightMode_t {
  LIGHT_MODE_RAINBOW , LIGHT_MODE_CANDLE , LIGHT_MODE_PULSE , LIGHT_MODE_MUSIC ,
  LIGHT_MODE_KOMODO , LIGHT_MODE_COLOR
}
 Lost of the different lighting effects. More...
 

Functions

void menuInit ()
 Initialize the menu system. More...
 
void brightnessSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for brightness selection. More...
 
void brightnessSelectDrawFunction (ssd1306 *oled)
 Draw override for brightness selection. More...
 
void buzzerMenuSelectedFunction (enum menuItem::encoderState_t state)
 Behaviour override for buzzer menu. More...
 
void clapMenuSelectedFunction (enum menuItem::encoderState_t state)
 Behaviour override for clap menu. More...
 
void fogTimerSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for fog timer setting menu. More...
 
void fogTimerSelectDrawFunction (ssd1306 *oled)
 Draw override for fog timer setting. More...
 
void rainbowMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for rainbow menu select. More...
 
void candleMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for candle menu select. More...
 
void pulseMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for pulse menu select. More...
 
void musicMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for music menu select. More...
 
void komodoMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for komodo menu select. More...
 
void colorMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for color mode menu. More...
 
void colorSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for color select menu. More...
 
void colorSelectDrawFunction (ssd1306 *oled)
 Draw override for color select menu. More...
 

Variables

enum lightMode_t lightMode
 It will store the user selected light mode. More...
 
uint8_t selectedColor
 It will store the user selected color. More...
 
uint8_t lightBrightness
 It will store the user selected brightness. More...
 
bool buzzerEnabled
 It will store the user selected state of the buzzer. More...
 
bool clapSwitchEnabled
 It will store the user selected state of the clap switch. More...
 
bool fogMachineEnabled
 It will store the user selected state of the fog machine. More...
 
uint8_t fogTimer
 It will store the user selected humidification period. More...
 
menuItem mainMenuItem
 Main Menu text item. More...
 
menuItem lightMenuItem
 Light Menu item. More...
 
menuItem brightnessMenuItem
 Brightness Menu item. More...
 
menuItem brightnessSelectItem
 Brightness Select item. More...
 
menuItem buzzerMenuItem
 Buzzer Menu item. More...
 
menuItem clapMenuItem
 Clap Menu item. More...
 
menuItem fogEnableMenuItem
 Fog Enable Menu item. More...
 
menuItem fogTimerMenuItem
 Fog Timer Menu item. More...
 
menuItem fogTimerSelectMenuItem
 Brightness Timer Select item. More...
 
menuItem lightModeMenuItem
 Light Mode Menu item. More...
 
menuItem rainbowModeMenuItem
 Rainbow Mode Menu item. More...
 
menuItem candleModeMenuItem
 Candle Mode Menu item. More...
 
menuItem pulseModeMenuItem
 Pulse Mode Menu item. More...
 
menuItem musicModeMenuItem
 Music Mode Menu item. More...
 
menuItem komodoModeMenuItem
 Komodo Mode Menu item. More...
 
menuItem colorModeMenuItem
 Color Mode Menu item. More...
 
menuItem colorSelectMenuItem
 Color Select item. More...
 

Enumeration Type Documentation

◆ lightMode_t

Lost of the different lighting effects.

Enumerator
LIGHT_MODE_RAINBOW 
LIGHT_MODE_CANDLE 
LIGHT_MODE_PULSE 
LIGHT_MODE_MUSIC 
LIGHT_MODE_KOMODO 
LIGHT_MODE_COLOR 

Definition at line 157 of file menu.hpp.

Function Documentation

◆ brightnessSelectDrawFunction()

void brightnessSelectDrawFunction ( ssd1306 oled)

Draw override for brightness selection.

This function will be called by the brightnessSelectItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 405 of file menu.cpp.

Here is the caller graph for this function:

◆ brightnessSelectFunction()

void brightnessSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for brightness selection.

This function will be called by the brightnessSelectItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 375 of file menu.cpp.

Here is the caller graph for this function:

◆ buzzerMenuSelectedFunction()

void buzzerMenuSelectedFunction ( enum menuItem::encoderState_t  state)

Behaviour override for buzzer menu.

This function will be called by the buzzerMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 615 of file menu.cpp.

Here is the caller graph for this function:

◆ candleMenuSelectFunction()

void candleMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for candle menu select.

This function will be called by the candleModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 460 of file menu.cpp.

Here is the caller graph for this function:

◆ clapMenuSelectedFunction()

void clapMenuSelectedFunction ( enum menuItem::encoderState_t  state)

Behaviour override for clap menu.

This function will be called by the clapMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 640 of file menu.cpp.

Here is the caller graph for this function:

◆ colorMenuSelectFunction()

void colorMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for color mode menu.

This function will be called by the colorModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 540 of file menu.cpp.

Here is the caller graph for this function:

◆ colorSelectDrawFunction()

void colorSelectDrawFunction ( ssd1306 oled)

Draw override for color select menu.

This function will be called by the colorSelectMenuItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 590 of file menu.cpp.

Here is the caller graph for this function:

◆ colorSelectFunction()

void colorSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for color select menu.

This function will be called by the colorSelectMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 560 of file menu.cpp.

Here is the caller graph for this function:

◆ fogTimerSelectDrawFunction()

void fogTimerSelectDrawFunction ( ssd1306 oled)

Draw override for fog timer setting.

This function will be called by the fogTimerSelectMenuItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 721 of file menu.cpp.

Here is the caller graph for this function:

◆ fogTimerSelectFunction()

void fogTimerSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for fog timer setting menu.

This function will be called by the fogTimerSelectMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 691 of file menu.cpp.

Here is the caller graph for this function:

◆ komodoMenuSelectFunction()

void komodoMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for komodo menu select.

This function will be called by the komodoModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 520 of file menu.cpp.

Here is the caller graph for this function:

◆ menuInit()

void menuInit ( )

Initialize the menu system.

Todo:
Maybe a menu map can visualize the behaviour of the ton of settings. It's a huge graph, yED could do that I think.

Definition at line 807 of file menu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ musicMenuSelectFunction()

void musicMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for music menu select.

This function will be called by the musicModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 500 of file menu.cpp.

Here is the caller graph for this function:

◆ pulseMenuSelectFunction()

void pulseMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for pulse menu select.

This function will be called by the pulseModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 480 of file menu.cpp.

Here is the caller graph for this function:

◆ rainbowMenuSelectFunction()

void rainbowMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for rainbow menu select.

This function will be called by the rainbowModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 440 of file menu.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ brightnessMenuItem

menuItem brightnessMenuItem
extern

Brightness Menu item.

◆ brightnessSelectItem

menuItem brightnessSelectItem
extern

Brightness Select item.

◆ buzzerEnabled

bool buzzerEnabled
extern

It will store the user selected state of the buzzer.

Definition at line 50 of file menu.cpp.

◆ buzzerMenuItem

menuItem buzzerMenuItem
extern

Buzzer Menu item.

◆ candleModeMenuItem

menuItem candleModeMenuItem
extern

Candle Mode Menu item.

◆ clapMenuItem

menuItem clapMenuItem
extern

Clap Menu item.

◆ clapSwitchEnabled

bool clapSwitchEnabled
extern

It will store the user selected state of the clap switch.

Definition at line 52 of file menu.cpp.

◆ colorModeMenuItem

menuItem colorModeMenuItem
extern

Color Mode Menu item.

◆ colorSelectMenuItem

menuItem colorSelectMenuItem
extern

Color Select item.

◆ fogEnableMenuItem

menuItem fogEnableMenuItem
extern

Fog Enable Menu item.

◆ fogMachineEnabled

bool fogMachineEnabled
extern

It will store the user selected state of the fog machine.

Definition at line 54 of file menu.cpp.

◆ fogTimer

uint8_t fogTimer
extern

It will store the user selected humidification period.

  • 0 -> 15 min
  • 1 -> 30 min
  • 2 -> 45 min
  • 3 -> 1 hour
  • 4 -> 1 hour 30 min
  • 5 -> 2 hour
  • 6 -> 3 hour
  • 7 -> 5 hour
  • 8 -> 8 hour
  • 9 -> 12 hour
  • 10 -> 24 hour
    Todo:
    It looks like I haven't added this to the configuration yet. Maybe I should?

Definition at line 56 of file menu.cpp.

◆ fogTimerMenuItem

menuItem fogTimerMenuItem
extern

Fog Timer Menu item.

◆ fogTimerSelectMenuItem

menuItem fogTimerSelectMenuItem
extern

Brightness Timer Select item.

◆ komodoModeMenuItem

menuItem komodoModeMenuItem
extern

Komodo Mode Menu item.

◆ lightBrightness

uint8_t lightBrightness
extern

It will store the user selected brightness.

Definition at line 48 of file menu.cpp.

◆ lightMenuItem

menuItem lightMenuItem
extern

Light Menu item.

◆ lightMode

enum lightMode_t lightMode
extern

It will store the user selected light mode.

Definition at line 44 of file menu.cpp.

◆ lightModeMenuItem

menuItem lightModeMenuItem
extern

Light Mode Menu item.

◆ mainMenuItem

menuItem mainMenuItem
extern

Main Menu text item.

◆ musicModeMenuItem

menuItem musicModeMenuItem
extern

Music Mode Menu item.

◆ pulseModeMenuItem

menuItem pulseModeMenuItem
extern

Pulse Mode Menu item.

◆ rainbowModeMenuItem

menuItem rainbowModeMenuItem
extern

Rainbow Mode Menu item.

◆ selectedColor

uint8_t selectedColor
extern

It will store the user selected color.

Definition at line 46 of file menu.cpp.