Subversion Repositories NaviCtrl

Rev

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