0,0 → 1,85 |
#ifndef _M_MENU_H |
#define _M_MENU_H |
|
#include "printf_P.h" |
|
#define MOBILE_COMPATIBLITY 1 |
|
#define MOBILE_LABLE 0 // Name of the Menu |
#define MOBILE_MENU 1 |
#define MOBILE_INFO 2 |
|
#define M_DISPLAYBUFFSIZE (5*21) |
|
#define MOBILE_MAX_MENU 5 |
|
#define KEY1 0x01 |
#define KEY2 0x02 |
#define KEY3 0x04 |
#define KEY4 0x08 |
#define KEY5 0x10 |
#define COPY 0x80 |
|
extern u8 MobileDispPtr; |
void Mobile_Putchar(char c); |
void Mobile_Putchar_BLINK(char c); |
void Mobile_Putchar_INV(char c); |
void Mobile_Clear(void); |
void MobileMenuUpdate(u8 item, u8 Keys, s16 Value); |
|
#define Mobile_printfxy(x,y,format, args...) { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar, format , ## args);} |
#define Mobile_printf(format, args...) { _printf_P(&Mobile_Putchar, format , ## args);} |
#define Mobile_printfxy_INV(x,y,format, args...) { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar_INV, format , ## args);} |
#define Mobile_printfxy_BLINK(x,y,format, args...) { MobileDispPtr = (y) * 21 + (x); _printf_P(&Mobile_Putchar_BLINK, format , ## args);} |
|
// MobileLabel.LayoutOptions |
#define ML_SEND 0x0001 // show sendbutton |
#define ML_SLIDER 0x0002 |
#define ML_WHEEL 0x0004 |
#define ML_EDIT 0x0008 |
|
|
typedef struct // MOBILE_LABLE - answer from NC to PC |
{ |
char MenuLabel[21]; |
s16 Min; |
s16 Max; |
s16 Default; |
unsigned char Decimals; |
char ValueLabel[16]; |
char ButtonLabel[5][6]; // "\0" ==> nicht anzeigen 5 Button mit 6 Zeichen |
unsigned char Layout; |
u16 LayoutOptions; // Bitcodiert |
} __attribute__((packed)) MobileLabel_t; |
|
typedef struct // MOBILE_MENU - from PC to NC |
{ |
unsigned char MenuItem; // PC wants this Menu |
u16 Value; // the s16 Value for use in Menu |
unsigned char Event; // bit coded [0x01 .. 0x10] - Buttons, [0x80] = Write Value |
} __attribute__((packed)) MobileDataRequest_t; |
|
|
typedef struct// MOBILE_INFO - answer from NC to PC |
{ |
unsigned char Count; |
u16 CheckSumLable; |
unsigned char Compatibel; |
} __attribute__((packed)) MobileDataInfo_t; |
|
|
typedef struct // MOBILE_MENU - answer from NC to PC |
{ |
u8 Index; |
char DisplayBuff[M_DISPLAYBUFFSIZE]; |
s16 ReturnValue; |
} __attribute__((packed)) Mobile_t ; |
|
|
extern MobileDataRequest_t MobileDataRequest; |
extern MobileDataInfo_t MobileDataInfo; |
extern Mobile_t Mobile; |
extern MobileLabel_t MobileLabel[MOBILE_MAX_MENU]; |
|
#endif // M_MENU_H |
|