/**
  ********************************************************************************
  * @file joystick_button.h
  * @brief This file contains functions prototypes for the joystick button.
  * @author STMicroelectronics - MCD Application Team
  * @version V1.1.0
  * @date    09/14/2009
  ******************************************************************************
  *
  */

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

// Includes ------------------------------------------------------------------
#include "stm8l10x.h"

// Exported types ------------------------------------------------------------
/** Joystick ID
  * @note Table element must not be equal to 0 as this element is
  * used to detect the menu end of table.
 */
typedef enum {
    J_NONE = 1,
    J_RELEASED,
    UP,
    DOWN,
    LEFT,
    RIGHT,
    SEL
} JOYSTICK_ID_T;

 // Button ID
typedef enum {
    B_NONE = 1,
    B_RELEASED,
    B_PRESSED
} BUTTON_ID_T;

// Exported constants --------------------------------------------------------
// Button Status - bit definition 
#define BUTTON_STATUS_JOYSTICK_DEBOUNCE_ENABLE    0
#define BUTTON_STATUS_BUTTON_DEBOUNCE_ENABLE      1

// Exported macro ------------------------------------------------------------
// Exported variables --------------------------------------------------------
extern uint8_t ButtonStatus;

// Exported functions --------------------------------------------------------
JOYSTICK_ID_T ReadJoystick(void);
BUTTON_ID_T ReadButton(void);

#endif /*__JOYSTICK_BUTTON_H */


