COSA
An Object-Oriented Platform for Arduino Programming
Menu.hh File Reference
#include "Cosa/LCD.hh"
#include "Cosa/IOStream.hh"
#include <Rotary.h>
#include "Cosa/Button.hh"
#include "Cosa/Keypad.hh"
Include dependency graph for Menu.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Menu
 
struct  Menu::item_t
 
struct  Menu::item_list_t
 
struct  Menu::one_of_t
 
struct  Menu::bcd_range_t
 
struct  Menu::int_range_t
 
class  Menu::Action
 
struct  Menu::action_t
 
class  Menu::Walker
 
class  Menu::KeypadController
 
class  Menu::RotaryController
 

Macros

#define MENU_BEGIN(var, name)
 
#define MENU_ITEM(var)   &var.item,
 
#define MENU_END(var)
 
#define MENU_SYMB(var, name)
 
#define MENU_ENUM_BEGIN(var)   const Menu::item_P var ## _list[] __PROGMEM = {
 
#define MENU_ENUM_ITEM(var)   &var,
 
#define MENU_ENUM_END(var)
 
#define MENU_ONE_OF(type, var, name, value)
 
#define MENU_ZERO_OR_MANY(type, var, name, value)
 
#define MENU_INT_RANGE(var, name, low, high, value)
 
#define MENU_ACTION(var, name, obj)
 

Detailed Description

Version
1.0

License

Copyright (C) 2014-2015, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Version
1.0

License

Copyright (C) 2013-2015, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Definition in file Menu.hh.

Macro Definition Documentation

#define MENU_ACTION (   var,
  name,
  obj 
)
Value:
const char var ## _name[] __PROGMEM = name; \
const Menu::action_t var __PROGMEM = { \
{ \
(str_P) var ## _name \
}, \
&obj \
};
#define __PROGMEM
Definition: Types.h:183
Menu action.
Definition: Menu.hh:45
const class prog_str * str_P
Definition: Types.h:187

Support macro to define a menu action in program memory.

Parameters
[in]varmenu action item to create.
[in]namestring of menu item.
[in]objpointer to menu action handler.

Definition at line 461 of file Menu.hh.

#define MENU_BEGIN (   var,
  name 
)
Value:
const char var ## _name[] __PROGMEM = name; \
const Menu::item_P var ## _list[] __PROGMEM = {
#define __PROGMEM
Definition: Types.h:183

Support macro to start the definition of a menu in program memory. Used in the form: MENU_BEGIN(var,name) MENU_ITEM(item-1) ... MENU_ITEM(item-n) MENU_END(var)

Parameters
[in]varmenu to create.
[in]namestring for menu.

Definition at line 326 of file Menu.hh.

#define MENU_END (   var)
Value:
0 \
}; \
const Menu::item_list_t var __PROGMEM = { \
{ \
(str_P) var ## _name \
}, \
var ## _list \
};
#define __PROGMEM
Definition: Types.h:183
const class prog_str * str_P
Definition: Types.h:187
Menu item/enum list.
Definition: Menu.hh:40

Support macro to complete a menu in program memory.

Parameters
[in]varmenu to create.

Definition at line 343 of file Menu.hh.

#define MENU_ENUM_BEGIN (   var)    const Menu::item_P var ## _list[] __PROGMEM = {

Support macro to start the definition of an enumeration type in program memory. Used in the form: MENU_SYMB(symb-1) ... MENU_SYMB(symb-n) MENU_ENUM_BEGIN(var,name) MENU_ENUM_ITEM(symb-1) ... MENU_ENUM_ITEM(symb-n) MENU_ENUM_END(var)

Parameters
[in]varmenu enumeration variable to create.

Definition at line 380 of file Menu.hh.

#define MENU_ENUM_END (   var)
Value:
0 \
};

Support macro to complete an enumeration type in program memory.

Parameters
[in]varmenu to create.

Definition at line 395 of file Menu.hh.

#define MENU_ENUM_ITEM (   var)    &var,

Support macro to add an menu item/symbol to an enumeration type in program memory.

Parameters
[in]varmenu item/symbol.

Definition at line 388 of file Menu.hh.

#define MENU_INT_RANGE (   var,
  name,
  low,
  high,
  value 
)
Value:
const char var ## _name[] __PROGMEM = name; \
const Menu::int_range_t var __PROGMEM = { \
{ \
(str_P) var ## _name \
}, \
low, \
high, \
&value \
};
Menu integer range variable.
Definition: Menu.hh:44
#define __PROGMEM
Definition: Types.h:183
const class prog_str * str_P
Definition: Types.h:187

Support macro to define a menu integer range in program memory.

Parameters
[in]varmenu range item to create.
[in]namestring of menu item.
[in]lowrange value.
[in]highrange value.
[in]valuevariable name.

Definition at line 443 of file Menu.hh.

#define MENU_ITEM (   var)    &var.item,

Support macro to add a menu item in program memory. The item can be any of the menu item types; ITEM, ITEM_LIST, ENUM, RANGE and ACTION.

Parameters
[in]varitem reference to add.

Definition at line 336 of file Menu.hh.

#define MENU_ONE_OF (   type,
  var,
  name,
  value 
)
Value:
const char var ## _name[] __PROGMEM = name; \
const Menu::one_of_t var __PROGMEM = { \
{ \
(str_P) var ## _name \
}, \
type ## _list, \
&value \
};
#define __PROGMEM
Definition: Types.h:183
const class prog_str * str_P
Definition: Types.h:187
Menu enumeration variable (one-of).
Definition: Menu.hh:41

Support macro to define a menu one-of variable.

Parameters
[in]typeenumeration list.
[in]varmenu one-of variable to create.
[in]namestring for menu one-of variable.
[in]valuevariable with runtime value.

Definition at line 406 of file Menu.hh.

#define MENU_SYMB (   var,
  name 
)
Value:
const char var ## _name[] __PROGMEM = name; \
const Menu::item_t var __PROGMEM = { \
(str_P) var ## _name \
};
#define __PROGMEM
Definition: Types.h:183
const class prog_str * str_P
Definition: Types.h:187
Menu item/symbol.
Definition: Menu.hh:39

Support macro to define a menu symbol in program memory.

Parameters
[in]varmenu symbol to create.
[in]namestring for menu symbol.

Definition at line 359 of file Menu.hh.

#define MENU_ZERO_OR_MANY (   type,
  var,
  name,
  value 
)
Value:
const char var ## _name[] __PROGMEM = name; \
{ \
(str_P) var ## _name \
}, \
type ## _list, \
&value \
};
#define __PROGMEM
Definition: Types.h:183
const class prog_str * str_P
Definition: Types.h:187
Menu bitset variable (zero-or-many).
Definition: Menu.hh:42

Support macro to define a menu zero-or-many variable.

Parameters
[in]typeenumeration list.
[in]varmenu zero-or-many variable to create.
[in]namestring for menu zero-or-many variable.
[in]valuevariable with runtime value.

Definition at line 424 of file Menu.hh.