thermferm/panel.h

Sat, 09 Aug 2014 21:42:28 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 09 Aug 2014 21:42:28 +0200
changeset 200
a215ddaabbe2
parent 199
3f5d277a69e3
child 204
9a14d6b2de7f
permissions
-rw-r--r--

Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.

#ifndef	_PANEL_H
#define	_PANEL_H


#ifdef HAVE_WIRINGPI_H

/*
 * GPIO pins for the frontpanel LED and push buttons.
 */
#define	PANEL_LED	2
#define	PANEL_ENTER	4
#define	PANEL_DOWN	5
#define	PANEL_UP	6

/*
 * 10 Milliseconds counts for a key to be short or long pressed.
 */
#define	PRESS_NORMAL	5
#define	PRESS_LONG	200

/*
 * LCD timeout in seconds
 */
#define	LCD_SLEEP	120

/*
 * Menu timeout in seconds
 */
#define	MENU_TIMEOUT	60

/*
 * Key names
 */
#define	KEY_NONE	0
#define	KEY_UP		1
#define	KEY_DOWN	2
#define	KEY_UPDOWN	3
#define	KEY_ENTER	4
#define	KEY_CONFIRM	5	/* Long Enter */
#define	KEY_ALL		99


int keycheck(void);

PI_THREAD (my_panel_loop);


#endif

#endif

mercurial