/*
Warning: PLEASE DO NOT REMOVE THIS COMMENT WHEN REDISTRIBUTING!
This is the second official release of the Phi-prompt TUI (text user interface), library version 20110523
Released for Phi-1 and Phi-2 shields for Arduino
User is encouraged to obtain a Phi shield or is solely responsible for converting it to work on other shields or configurations.

Programmed by Dr. John Liu
Revision: 05/23/2011
Free software for educational and personal uses.
No warrantee!
Commercial use without authorization is prohibited.

Obtain the documentation or find details of the phi_prompt TUI library, Phi-1 shield, Phi-2 shield, and Phi-prompt or contact Dr. Liu at
http://liudr.wordpress.com/phi-1-shield/
http://liudr.wordpress.com/phi-2-shield/
http://liudr.wordpress.com/phi_prompt/
All rights reserved.

Summary:
This is part of the 523 release of phi_prompt for phi-2 shields. Please refer to the ducomentation at http://liudr.wordpress.com/phi_prompt.
*/

#ifndef defs_h
#define defs_h
#include <phi_buttons.h>

#ifdef phi_1_shield
//Phi-1 shield definitions

//Phi-1 shield buttons and channel pin assignments
#define buzzer 16
#define ch1 16
#define ch1_analog 2
#define led 17
#define ch2 17
#define ch2_analog 3
#define btn_u 5
#define btn_d 10
#define btn_l 11
#define btn_r 3
#define btn_b 14
#define btn_a 15

//Phi-1 shield LCD pin setting
#define LCD_RS 8
#define LCD_EN 9
#define LCD_D4 7
#define LCD_D5 6
#define LCD_D6 2
#define LCD_D7 4

#endif

#ifdef phi_2_shield
//Phi-2 shield definitions

//Phi-2 shield buttons and channel pin assignments
#define buzzer 16
#define btn_u 5
#define btn_d 10
#define btn_l 11
#define btn_r 4
#define btn_b 14
#define btn_a 15

//Phi-2 shield LCD pin setting
#define LCD_RS 8
#define LCD_EN 9
#define LCD_D4 7
#define LCD_D5 6
#define LCD_D6 2
#define LCD_D7 3

#endif

#ifdef proto_sheild
//Phi-2 shield definitions

//proto shield buttons and channel pin assignments
#define buzzer 47
#define btn_u 40
#define btn_d 41
#define btn_l 38
#define btn_r 39
#define btn_b 43
#define btn_a 42

//proto shield LCD pin setting
#define LCD_RS 26
#define LCD_EN 27
#define LCD_D4 22
#define LCD_D5 23
#define LCD_D6 24
#define LCD_D7 25

#define lcd_rows 4
#define lcd_columns 16

#define use_6_btn

#endif

#ifdef panel_sheild
//Phi-2 shield definitions

//proto shield buttons and channel pin assignments
#define buzzer 47
#define btn_u 40
#define btn_d 39
#define btn_l 38
#define btn_r 42
#define btn_b 43
#define btn_a 41

//proto shield LCD pin setting
#define LCD_RS 28
#define LCD_EN 29
#define LCD_D4 44
#define LCD_D5 45
#define LCD_D6 46
#define LCD_D7 47

#define lcd_rows 4
#define lcd_columns 20

#define use_6_btn

#endif

//Maximal bytes on your Phi-1 shield eeprom, depending on the chip you use. I'm using 24LC256, with 256KiloBits so 32KiloBytes=32768 bytes.
#define EEPROM_size 32768UL 

//#define setRTC // Uncomment this to set the clock time.

//Phi-menu definitions
#define phi_menu_style_classic 0
#define phi_menu_style_2X2 1
#define phi_menu_style_index 2

//Program specific definitions should be stored in FUNCTIONS.pde
/*
These are initializations of the buttons.
There are many scenarios you can use. A user can operate the menu and input with as many as 6 buttons for convenience or as few as one button to save Arduino I/O pins. Just enable the respective define. Right now the 6-button scenario is used.
use_6_btn: all 6 buttons are defined for maximal convenience to the operator. Operator may jog in text input.
use_5_btn: all but the “left” are defined for convenience to the operator but there is no way to jog on text input.
use_4_btn: all but “left” and “right” are defined for medium convenience to the operator. This works best when all you do is entering numbers of choosing from a list and don't use text input.
use_3_btn: only “up”, “right” and “confirm” are defined to save Arduino pins offering less convenience to the operator. This works alright if input options are limited such as month or password numbers.
use_2_btn: only “up” and “right” are defined to save Arduino pins. The operator will still be able to operate everything but entering text will be a pain.
use_1_btn: This enables auto button on “up” and only defines “right”. This way saves most Arduino pins since only one button is used but the operator is only expected to enter limited information.
*/
//#define use_6_btn
//#define use_5_btn
//#define use_4_btn
//#define use_3_btn
//#define use_2_btn
//#define use_2_btn
//#define use_1_btn

#ifdef use_1_btn
phi_buttons btn_1(btn_auto, LOW);
phi_buttons btn_2(btn_null, LOW);
phi_buttons btn_3(btn_null, LOW);
phi_buttons btn_4(btn_r, LOW);
phi_buttons btn_5(btn_null, LOW);
phi_buttons btn_6(btn_null, LOW);
#endif

#ifdef use_2_btn
phi_buttons btn_1(btn_u, LOW);
phi_buttons btn_2(btn_null, LOW);
phi_buttons btn_3(btn_null, LOW);
phi_buttons btn_4(btn_r, LOW);
phi_buttons btn_5(btn_null, LOW);
phi_buttons btn_6(btn_null, LOW);
#endif

#ifdef use_3_btn
phi_buttons btn_1(btn_u, LOW);
phi_buttons btn_2(btn_null, LOW);
phi_buttons btn_3(btn_null, LOW);
phi_buttons btn_4(btn_r, LOW);
phi_buttons btn_5(btn_b, LOW);
phi_buttons btn_6(btn_null, LOW);
#endif

#ifdef use_4_btn
phi_buttons btn_1(btn_u, LOW);
phi_buttons btn_2(btn_d, LOW);
phi_buttons btn_3(btn_null, LOW);
phi_buttons btn_4(btn_null, LOW);
phi_buttons btn_5(btn_b, LOW);
phi_buttons btn_6(btn_a, LOW);
#endif

#ifdef use_5_btn
phi_buttons btn_1(btn_u, LOW);
phi_buttons btn_2(btn_d, LOW);
phi_buttons btn_3(btn_null, LOW);
phi_buttons btn_4(btn_r, LOW);
phi_buttons btn_5(btn_b, LOW);
phi_buttons btn_6(btn_a, LOW);
#endif

#ifdef use_6_btn
phi_buttons btn_1(btn_u, LOW);
phi_buttons btn_2(btn_d, LOW);
phi_buttons btn_3(btn_l, LOW);
phi_buttons btn_4(btn_r, LOW);
phi_buttons btn_5(btn_b, LOW);
phi_buttons btn_6(btn_a, LOW);
#endif

#endif
