0001
0002
0003
0004
0005
0006
0007 #ifndef INPUT_YEALINK_H
0008 #define INPUT_YEALINK_H
0009
0010
0011
0012
0013
0014 struct yld_ctl_packet {
0015 u8 cmd;
0016 u8 size;
0017 __be16 offset;
0018 u8 data[11];
0019 s8 sum;
0020 } __attribute__ ((packed));
0021
0022 #define USB_PKT_LEN sizeof(struct yld_ctl_packet)
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #define CMD_INIT 0x8e
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #define CMD_KEYPRESS 0x80
0044
0045
0046
0047
0048
0049
0050
0051
0052 #define CMD_SCANCODE 0x81
0053
0054
0055
0056
0057
0058
0059
0060
0061 #define CMD_LCD 0x04
0062
0063
0064
0065
0066
0067
0068
0069
0070 #define CMD_LED 0x05
0071
0072
0073
0074
0075
0076
0077
0078
0079 #define CMD_RING_VOLUME 0x11
0080
0081
0082
0083
0084
0085
0086
0087
0088 #define CMD_RING_NOTE 0x02
0089
0090
0091
0092
0093
0094
0095
0096
0097 #define CMD_RINGTONE 0x03
0098
0099
0100
0101
0102
0103
0104
0105
0106 #define CMD_DIALTONE 0x09
0107
0108 #endif
0109
0110
0111 #if defined(_SEG) && defined(_PIC)
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134 #define LCD_LINE1_OFFSET 0
0135 #define LCD_LINE1_SIZE 17
0136
0137
0138
0139 _SEG('1', 0,0 , 22,2 , 22,2 , 0,0 , 0,0 , 0,0 , 0,0 ),
0140 _SEG('8', 20,1 , 20,2 , 20,4 , 20,8 , 21,4 , 21,2 , 21,1 ),
0141 _PIC('.', 22,1 , "M" ),
0142 _SEG('e', 18,1 , 18,2 , 18,4 , 18,1 , 19,2 , 18,1 , 19,1 ),
0143 _SEG('8', 16,1 , 16,2 , 16,4 , 16,8 , 17,4 , 17,2 , 17,1 ),
0144 _PIC('.', 15,8 , "D" ),
0145 _SEG('M', 14,1 , 14,2 , 14,4 , 14,1 , 15,4 , 15,2 , 15,1 ),
0146 _SEG('8', 12,1 , 12,2 , 12,4 , 12,8 , 13,4 , 13,2 , 13,1 ),
0147 _PIC('.', 11,8 , ":" ),
0148 _SEG('8', 10,1 , 10,2 , 10,4 , 10,8 , 11,4 , 11,2 , 11,1 ),
0149 _SEG('8', 8,1 , 8,2 , 8,4 , 8,8 , 9,4 , 9,2 , 9,1 ),
0150 _PIC('.', 7,1 , "IN" ),
0151 _PIC('.', 7,2 , "OUT" ),
0152 _PIC('.', 7,4 , "STORE" ),
0153 _SEG('1', 0,0 , 5,1 , 5,1 , 0,0 , 0,0 , 0,0 , 0,0 ),
0154 _SEG('8', 4,1 , 4,2 , 4,4 , 4,8 , 5,8 , 5,4 , 5,2 ),
0155 _SEG('8', 2,1 , 2,2 , 2,4 , 2,8 , 3,4 , 3,2 , 3,1 ),
0156
0157
0158
0159
0160
0161 #define LCD_LINE2_OFFSET LCD_LINE1_OFFSET + LCD_LINE1_SIZE
0162 #define LCD_LINE2_SIZE 9
0163
0164 _PIC('.', 23,2 , "NEW" ),
0165 _PIC('.', 23,4 , "REP" ),
0166 _PIC('.', 1,8 , "SU" ),
0167 _PIC('.', 1,4 , "MO" ),
0168 _PIC('.', 1,2 , "TU" ),
0169 _PIC('.', 1,1 , "WE" ),
0170 _PIC('.', 0,1 , "TH" ),
0171 _PIC('.', 0,2 , "FR" ),
0172 _PIC('.', 0,4 , "SA" ),
0173
0174
0175
0176
0177 #define LCD_LINE3_OFFSET LCD_LINE2_OFFSET + LCD_LINE2_SIZE
0178 #define LCD_LINE3_SIZE 12
0179
0180 _SEG('8', 22,16, 22,32, 22,64, 22,128, 23,128, 23,64, 23,32 ),
0181 _SEG('8', 20,16, 20,32, 20,64, 20,128, 21,128, 21,64, 21,32 ),
0182 _SEG('8', 18,16, 18,32, 18,64, 18,128, 19,128, 19,64, 19,32 ),
0183 _SEG('8', 16,16, 16,32, 16,64, 16,128, 17,128, 17,64, 17,32 ),
0184 _SEG('8', 14,16, 14,32, 14,64, 14,128, 15,128, 15,64, 15,32 ),
0185 _SEG('8', 12,16, 12,32, 12,64, 12,128, 13,128, 13,64, 13,32 ),
0186 _SEG('8', 10,16, 10,32, 10,64, 10,128, 11,128, 11,64, 11,32 ),
0187 _SEG('8', 8,16, 8,32, 8,64, 8,128, 9,128, 9,64, 9,32 ),
0188 _SEG('8', 6,16, 6,32, 6,64, 6,128, 7,128, 7,64, 7,32 ),
0189 _SEG('8', 4,16, 4,32, 4,64, 4,128, 5,128, 5,64, 5,32 ),
0190 _SEG('8', 2,16, 2,32, 2,64, 2,128, 3,128, 3,64, 3,32 ),
0191 _SEG('8', 0,16, 0,32, 0,64, 0,128, 1,128, 1,64, 1,32 ),
0192
0193
0194
0195
0196
0197
0198 #define LCD_LINE4_OFFSET LCD_LINE3_OFFSET + LCD_LINE3_SIZE
0199
0200 _PIC('.', offsetof(struct yld_status, led) , 0x01, "LED" ),
0201 _PIC('.', offsetof(struct yld_status, dialtone) , 0x01, "DIALTONE" ),
0202 _PIC('.', offsetof(struct yld_status, ringtone) , 0x24, "RINGTONE" ),
0203
0204 #undef _SEG
0205 #undef _PIC
0206 #endif