Subversion Repositories NaviCtrl

Rev

Rev 833 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
833 holgerb 1
#ifndef _M_MENU_H
2
#define _M_MENU_H
3
 
4
#include "printf_P.h"
857 holgerb 5
 
833 holgerb 6
#define MOBILE_COMPATIBLITY     1
7
 
8
#define MOBILE_LABLE    0  // Name of the Menu 
9
#define MOBILE_MENU             1
10
#define MOBILE_INFO             2
11
 
12
#define M_DISPLAYBUFFSIZE (5*21)
13
 
857 holgerb 14
#define MOBILE_MAX_MENU 5
833 holgerb 15
 
16
#define KEY1    0x01
17
#define KEY2    0x02
18
#define KEY3    0x04
19
#define KEY4    0x08
20
#define KEY5    0x10
21
#define COPY    0x80
22
 
23
extern u8 MobileDispPtr;
24
void Mobile_Putchar(char c);
25
void Mobile_Putchar_BLINK(char c);
26
void Mobile_Putchar_INV(char c);
27
void Mobile_Clear(void);
28
void MobileMenuUpdate(u8 item, u8 Keys, s16 Value);
29
 
30
#define Mobile_printfxy(x,y,format, args...)  { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar, format , ## args);}
31
#define Mobile_printf(format, args...)        {  _printf_P(&Mobile_Putchar, format , ## args);}
32
#define Mobile_printfxy_INV(x,y,format, args...)        { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar_INV, format , ## args);}
33
#define Mobile_printfxy_BLINK(x,y,format, args...)      { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar_BLINK, format , ## args);}
34
 
35
// MobileLabel.LayoutOptions
36
#define ML_SEND                         0x0001 // show sendbutton
37
#define ML_SLIDER                       0x0002
38
#define ML_WHEEL                        0x0004
39
#define ML_EDIT                         0x0008
40
 
41
 
42
typedef struct // MOBILE_LABLE - answer from NC to PC 
43
{
44
 char                   MenuLabel[21];
45
 s16                    Min;
46
 s16                    Max;
47
 s16                    Default;
48
 unsigned char          Decimals;
49
 char                   ValueLabel[16];
50
 char                   ButtonLabel[5][6];  //  "\0" ==> nicht anzeigen 5 Button mit 6 Zeichen
51
 unsigned char          Layout;
52
 u16                            LayoutOptions;          //  Bitcodiert
53
} __attribute__((packed)) MobileLabel_t;
54
 
55
typedef struct // MOBILE_MENU - from PC to NC
56
{
57
 unsigned char          MenuItem;                       // PC wants this Menu 
58
 u16                    Value;                          // the s16 Value for use in Menu
59
 unsigned char          Event;               // bit coded [0x01 .. 0x10] - Buttons,   [0x80] = Write Value
60
} __attribute__((packed)) MobileDataRequest_t;
61
 
62
 
63
typedef struct// MOBILE_INFO - answer from NC to PC 
64
{
65
 unsigned char         Count;
66
 u16                               CheckSumLable;
67
 unsigned char         Compatibel;
68
} __attribute__((packed)) MobileDataInfo_t;
69
 
70
 
71
typedef struct  // MOBILE_MENU - answer from NC to PC 
72
{
73
 u8     Index;
74
 char   DisplayBuff[M_DISPLAYBUFFSIZE];
75
 s16    ReturnValue;
76
} __attribute__((packed)) Mobile_t ;
77
 
78
 
79
extern MobileDataRequest_t MobileDataRequest;
80
extern MobileDataInfo_t MobileDataInfo;
81
extern Mobile_t Mobile;
82
extern MobileLabel_t MobileLabel[MOBILE_MAX_MENU];
83
 
84
#endif // M_MENU_H
85