/**
  ********************************************************************************
  * @file menu.h
  * @brief This file provides the menu function prototype.
  * @author STMicroelectronics - MCD Application Team
  * @version V1.1.0
  * @date    09/14/2009
  ******************************************************************************
  *
  */

// Define to prevent recursive inclusion -------------------------------------
#ifndef __MENU_H
#define __MENU_H

// Includes ------------------------------------------------------------------
#include "stm8l10x.h"
#include "joystick_button.h"
#include "mono_lcd.h"
#include "demo_help.h"
#include "demo_about.h"
#include "demo_pwm.h"
#include "demo_beeper.h"
#include "demo_microsd.h"


// Exported types ------------------------------------------------------------
/** State ID
  * @note Table element must not be equal to 0 as this element is
  * used to detect the end of table.
 */
typedef enum {
    // Level 1 
    HELP = 1,
    PWM_DEMO,
    MICROSD_DEMO,
    BEEPER_DEMO,
    GAMES_DEMO,
    SYSTEM_DEMO,
    ABOUT,
    // Execution 
    EXE_HELP,
    EXE_PWM_DEMO,
    EXE_MICROSD_DEMO,
    EXE_BEEPER_DEMO,
    EXE_GAMES,
    EXE_SYSTEM,
    EXE_ABOUT
} STATE_ID_T;

 // Menu NextState 
typedef struct
{
    STATE_ID_T State;
    JOYSTICK_ID_T Key;
    STATE_ID_T NextState;
}
MENU_NEXTSTATE_T;

 // Menu state 
typedef struct
{
    STATE_ID_T State;
    char* pText;
    void (*pFunc)(void);
}
MENU_STATE_T;

// Exported constants --------------------------------------------------------
// Exported macro ------------------------------------------------------------
// Exported variables --------------------------------------------------------
extern STATE_ID_T State;

// Exported functions --------------------------------------------------------
void MenuInit(void);
void MenuUpdate(JOYSTICK_ID_T ujoystick);
void MenuDisplay(void);

#endif /* __MENU_H */

