#ifndef _KEYBOARD_H_
#define _KEYBOARD_H_


// кнопки не нажаты
#define KEY_EMPTY        0
// кнопки клавиатуры
#define KEY_POST1        1
#define KEY_POST2        2
#define KEY_POST3        3
#define KEY_POST4        4
#define KEY_POST5        5
#define KEY_POST6        6
#define KEY_POST7        7
#define KEY_POST8        8
#define KEY_CANSEL       9
#define KEY_START        10
#define KEY_LEFT    11
#define KEY_RIGHT   12
#define KEY_DOWN    13
#define KEY_UP      14
#define KEY_STOP    15

#if defined(BOARD_SOLARIUM_WEB)
    #define KEY_DIGIT0  16
    #define KEY_DIGIT1  17
    #define KEY_DIGIT2  18
    #define KEY_DIGIT3  19
    #define KEY_DIGIT4  20
    #define KEY_DIGIT5  21
    #define KEY_DIGIT6  22
    #define KEY_DIGIT7  23
    #define KEY_DIGIT8  24
    #define KEY_DIGIT9  25
    #define KEY_STAR    26
    #define KEY_SHARP   27
#elif defined(BOARD_SOLARIUM_VLAD)
    #define KEY_F1  16
    #define KEY_F2  17
    #define KEY_F3  18
    #define KEY_SOLAR_START1  19
    #define KEY_SOLAR_START2  20
    #define KEY_SOLAR_START3  21
    #define KEY_SOLAR_STOP1   22
    #define KEY_SOLAR_STOP2   23
    #define KEY_SOLAR_STOP3   24
#endif


#define KEY_COUNT        32


#define KEY_ACTION_EMPTY    0
#define KEY_ACTION_LEFT     1
#define KEY_ACTION_RIGHT    2
#define KEY_ACTION_DOWN     3
#define KEY_ACTION_UP       4
#define KEY_ACTION_OK       5
#define KEY_ACTION_CANSEL   6

#define LED_POST1   0
#define LED_POST2   1
#define LED_POST3   2
#define LED_POST4   3
#define LED_POST5   4
#define LED_POST6   5
#define LED_POST7   6
#define LED_POST8   7
#define LED_OK      8
#define LED_CANSEL  9


extern void InitKbrd();
extern int GetKbrdEvent(int* event);
extern void SetBacklight(CPU_INT08U led, CPU_INT08U state);
extern void SelAllLeds(CPU_INT08U state);
extern unsigned long GetKbrdState(void);
extern void KbrdPost(unsigned long key);


#endif //#ifndef _KEYBOARD_H_
