1 /* 2 * 3 * Copyright 2001-2011 Texas Instruments, Inc. - http://www.ti.com/ 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.ti.fm; 19 20 public interface IFmConstants { 21 22 /* 23 * By setting this flag true, FM APIS can be used in blocking mode. else FM 24 * APIS will be non blocking 25 */ 26 public static final boolean MAKE_FM_APIS_BLOCKING = false; 27 28 /* 29 * By setting this flag true, FM RDS data(PS and RDS Text) can be sent to 30 * the application as bytearray. else FM RDS data(PS and RDS Text) will be 31 * sent to the application as String 32 */ 33 34 public static final boolean FM_SEND_RDS_IN_BYTEARRAY = false; 35 36 public static final int FM_SEEK_IN_PROGRESS = 0xFF; 37 38 public static final int FM_BAND_EUROPE_US = 0; 39 40 public static final int FM_BAND_JAPAN = 1; 41 42 /* Europe / US band limits */ 43 public static final int FM_FIRST_FREQ_US_EUROPE_KHZ = 87500; 44 45 public static final int FM_LAST_FREQ_US_EUROPE_KHZ = 108000; 46 47 /* Japan band limits */ 48 public static final int FM_FIRST_FREQ_JAPAN_KHZ = 76000; 49 50 public static final int FM_LAST_FREQ_JAPAN_KHZ = 90000; 51 52 public static final int DEF_VOL = 1; 53 54 public static final int FM_MAX_VOLUME = 16383; //32767,//65535; 55 56 /* volume states */ 57 58 public static final boolean VOL_REQ_STATE_IDLE = true; 59 60 public static final boolean VOL_REQ_STATE_PENDING = false; 61 62 public static final int FM_CHANNEL_SPACE = 2; 63 64 public static final int FM_NOT_MUTE = 1; 65 66 public static final int FM_RF_DEP_MUTE_OFF = 0; 67 68 public static final int FM_RSSI_THRESHHOLD = 7; 69 70 /* Mute constants */ 71 72 public static final int FM_MUTE = 0; 73 74 public static final int FM_UNMUTE = 1; 75 76 public static final int FM_ATT = 2; 77 78 /* Fm Radio State */ 79 public static final int STATE_ENABLED = 0; 80 81 public static final int STATE_DISABLED = 1; 82 83 public static final int STATE_ENABLING = 2; 84 85 public static final int STATE_DISABLING = 3; 86 87 public static final int STATE_PAUSE = 4; 88 89 public static final int STATE_RESUME = 5; 90 91 public static final int STATE_DEFAULT = 6; 92 93 // public static final int FM_SUCCESS = 0 ; 94 /* FM Error Returns */ 95 public static final int FM_FAILED = 0xFFF; 96 97 public static final int FM_UNDEFINED_FREQ = 0xFFFFFFFF; 98 99 public static final int FM_COMPLETE_SCAN_IS_NOT_IN_PROGRESS = 115; 100 101 public static final int FM_COMPLETE_SCAN_STOPPED = 116; 102 103 /* Recovery Params */ 104 // must be a long time to account for turning off stale btipsd + turning on 105 // new one 106 public static final long FM_RADIO_ON_TIMEOUT_MSEC = 20 * 1000; 107 108 public static final long FM_RADIO_OFF_TIMEOUT_MSEC = 10 * 1000; 109 110 /*********************************************************************************************** 111 * Look up tables for RDS data conversion 112 ***********************************************************************************************/ 113 public static char[][] lookUpTable_G0 = { 114 /* 0 */{ 115 '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', 116 '\u0008', '\u0009', '\u0000', '\u000b', '\u000c', '\u0000', '\u000e', '\u000f' 117 }, 118 /* 1 */{ 119 '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', 120 '\u0018', '\u0019', '\u001a', '\u001b', '\u001c', '\u001d', '\u001e', '\u001f' 121 }, 122 /* 2 */{ 123 '\u0020', '\u0021', '\u0022', '\u0023', '\u00A4', '\u0025', '\u0026', '\u0000', 124 '\u0028', '\u0029', '\u002a', '\u002b', '\u002c', '\u002d', '\u002e', '\u2044' 125 }, 126 /* 3 */{ 127 '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', 128 '\u0038', '\u0039', '\u003a', '\u003b', '\u003c', '\u003d', '\u003e', '\u003f' 129 }, 130 /* 4 */{ 131 '\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047', 132 '\u0048', '\u0049', '\u004a', '\u004b', '\u004c', '\u004d', '\u004e', '\u004f' 133 }, 134 /* 5 */{ 135 '\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057', 136 '\u0058', '\u0059', '\u005a', '\u005b', '\u0000', '\u005d', '\u005e', '\u005f' 137 }, 138 /* 6 */{ 139 '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067', 140 '\u0068', '\u0069', '\u006a', '\u006b', '\u006c', '\u006d', '\u006e', '\u006f' 141 }, 142 /* 7 */{ 143 '\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077', 144 '\u0078', '\u0079', '\u007a', '\u007b', '\u007c', '\u007d', '\u0020', '\u0020' 145 }, 146 /* 8 */{ 147 '\u00E1', '\u00E0', '\u00E9', '\u00E8', '\u00ED', '\u00EC', '\u00F3', '\u00F2', 148 '\u00FA', '\u00F9', '\u00D1', '\u00C7', '\u015E', '\u03B2', '\u03AF', '\u0132' 149 }, 150 /* 9 */{ 151 '\u00E2', '\u00E4', '\u00EA', '\u00EB', '\u00EE', '\u00EF', '\u00F4', '\u00F6', 152 '\u00FB', '\u00FC', '\u00F1', '\u00E7', '\u015F', '\u0020', '\u00B9', '\u0133' 153 }, 154 /* a */{ 155 '\u00AA', '\u03B1', '\u00A9', '\u2030', '\u011E', '\u0115', '\u0148', '\u0151', 156 '\u03C0', '\u0020', '\u00A3', '\u0024', '\u2190', '\u2191', '\u2192', '\u2193' 157 }, 158 /* b */{ 159 '\u00b0', '\u00B9', '\u00B2', '\u00B3', '\u00B1', '\u0130', '\u0144', '\u0171', 160 '\u00B5', '\u00BF', '\u00F7', '\u00B0', '\u00BC', '\u00BD', '\u00BE', '\u00A7' 161 }, 162 /* c */{ 163 '\u00C1', '\u00C0', '\u00C9', '\u00C8', '\u00CD', '\u00CC', '\u00D3', '\u00D2', 164 '\u00DA', '\u00D9', '\u0158', '\u010C', '\u0160', '\u017D', '\u0110', '\u013F' 165 }, 166 /* d */{ 167 '\u00C2', '\u00C4', '\u00CA', '\u00CB', '\u00CE', '\u00CF', '\u00D4', '\u00D6', 168 '\u00DB', '\u00DC', '\u0159', '\u010D', '\u0161', '\u017E', '\u0111', '\u0140' 169 }, 170 /* e */{ 171 '\u00C3', '\u00C5', '\u01FC', '\u0152', '\u0177', '\u00DD', '\u00D5', '\u00D8', 172 '\u00FE', '\u014A', '\u0154', '\u0106', '\u015A', '\u0179', '\u0166', '\u00F0' 173 }, 174 /* f */{ 175 '\u00E3', '\u00E5', '\u01FD', '\u0153', '\u0175', '\u00FD', '\u00F5', '\u00F8', 176 '\u00DE', '\u014B', '\u0155', '\u0107', '\u015B', '\u017A', '\u0167', '\u0020' 177 } 178 }; 179 180 public static char[][] lookUpTable_G1 = { 181 /* 0 */{ 182 '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', 183 '\u0008', '\u0009', '\u0000', '\u000b', '\u000c', '\u0000', '\u000e', '\u000f' 184 }, 185 /* 1 */{ 186 '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', 187 '\u0018', '\u0019', '\u001a', '\u001b', '\u001c', '\u001d', '\u001e', '\u001f' 188 }, 189 /* 2 */{ 190 '\u0020', '\u0021', '\u0022', '\u0023', '\u00A4', '\u0025', '\u0026', '\u0000', 191 '\u0028', '\u0029', '\u002a', '\u002b', '\u002c', '\u002d', '\u002e', '\u2044' 192 }, 193 /* 3 */{ 194 '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', 195 '\u0038', '\u0039', '\u003a', '\u003b', '\u003c', '\u003d', '\u003e', '\u003f' 196 }, 197 /* 4 */{ 198 '\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047', 199 '\u0048', '\u0049', '\u004a', '\u004b', '\u004c', '\u004d', '\u004e', '\u004f' 200 }, 201 /* 5 */{ 202 '\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057', 203 '\u0058', '\u0059', '\u005a', '\u005b', '\u0000', '\u005d', '\u005e', '\u005f' 204 }, 205 /* 6 */{ 206 '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067', 207 '\u0068', '\u0069', '\u006a', '\u006b', '\u006c', '\u006d', '\u006e', '\u006f' 208 }, 209 /* 7 */{ 210 '\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077', 211 '\u0078', '\u0079', '\u007a', '\u007b', '\u007c', '\u007d', '\u0020', '\u0020' 212 }, 213 /* 8 */{ 214 '\u00E1', '\u00E0', '\u00E9', '\u00E8', '\u00ED', '\u00EC', '\u00F3', '\u00F2', 215 '\u00FA', '\u00F9', '\u00D1', '\u00C7', '\u015E', '\u03B2', '\u03AF', '\u0132' 216 }, 217 /* 9 */{ 218 '\u00E2', '\u00E4', '\u00EA', '\u00EB', '\u00EE', '\u00EF', '\u00D4', '\u00D6', 219 '\u00FB', '\u00FC', '\u00F1', '\u00E7', '\u015F', '\u0020', '\u00B9', '\u0133' 220 }, 221 /* a */{ 222 '\u00AA', '\u00a1', '\u00A9', '\u2030', '\u01CE', '\u0115', '\u0148', '\u0151', 223 '\u0165', '\u0020', '\u00A3', '\u0024', '\u2190', '\u2191', '\u2192', '\u2193' 224 }, 225 /* b */{ 226 '\u00BA', '\u00B9', '\u00B2', '\u00B3', '\u00B1', '\u0130', '\u0144', '\u0171', 227 '\u0163', '\u00BF', '\u00F7', '\u00B0', '\u00BC', '\u00BD', '\u00BE', '\u00A7' 228 }, 229 /* c */{ 230 '\u0404', '\u042F', '\u0020', '\u0427', '\u0414', '\u042D', '\u0444', '\u0403', 231 '\u00c8', '\u0418', '\u0436', '\u045C', '\u041B', '\u045B', '\u0452', '\u044B' 232 }, 233 /* d */{ 234 '\u00FD', '\u0459', '\u00d2', '\u0448', '\u0446', '\u042E', '\u0449', '\u040A', 235 '\u040F', '\u0419', '\u0417', '\u010D', '\u0161', '\u017E', '\u00de', '\u00df' 236 }, 237 /* e */{ 238 '\u03A0', '\u03B1', '\u00e2', '\u00e3', '\u03B4', '\u03B5', '\u03C6', '\u03B3', 239 '\u00e8', '\u03B9', '\u2140', '\u03F0', '\u03BB', '\u03BC', '\u03B3', '\u03C9' 240 }, 241 /* f */{ 242 '\u03C0', '\u03A9', '\u037B', '\u00f3', '\u03C4', '\u03BE', '\u0398', '\u0393', 243 '\u039E', '\u03C5', '\u03B6', '\u03DB', '\u039B', '\u03A8', '\u0394', '\u0020' 244 } 245 }; 246 247 public static char[][] lookUpTable_G2 = { 248 /* 0 */{ 249 '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', 250 '\u0008', '\u0009', '\u0000', '\u000b', '\u000c', '\u0000', '\u000e', '\u000f' 251 }, 252 /* 1 */{ 253 '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', 254 '\u0018', '\u0019', '\u001a', '\u001b', '\u001c', '\u001d', '\u001e', '\u001f' 255 }, 256 /* 2 */{ 257 '\u0020', '\u0021', '\u0022', '\u0023', '\u00A4', '\u0025', '\u0026', '\u0000', 258 '\u0028', '\u0029', '\u002a', '\u002b', '\u002c', '\u002d', '\u002e', '\u2044' 259 }, 260 /* 3 */{ 261 '\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037', 262 '\u0038', '\u0039', '\u003a', '\u003b', '\u003c', '\u003d', '\u003e', '\u003f' 263 }, 264 /* 4 */{ 265 '\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047', 266 '\u0048', '\u0049', '\u004a', '\u004b', '\u004c', '\u004d', '\u004e', '\u004f' 267 }, 268 /* 5 */{ 269 '\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057', 270 '\u0058', '\u0059', '\u005a', '\u005b', '\u0000', '\u005d', '\u005e', '\u005f' 271 }, 272 /* 6 */{ 273 '\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067', 274 '\u0068', '\u0069', '\u006a', '\u006b', '\u006c', '\u006d', '\u006e', '\u006f' 275 }, 276 /* 7 */{ 277 '\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077', 278 '\u0078', '\u0079', '\u007a', '\u007b', '\u007c', '\u007d', '\u0020', '\u0020' 279 }, 280 /* 8 */{ 281 '\uEE92', '\uEE98', '\u0629', '\uEE9C', '\uFEA0', '\uFEA4', '\ufea8', '\u062f', 282 '\u0630', '\ufe8d', '\ufe83', '\ufeb3', '\ufeb7', '\ufebb', '\ufebf', '\ufec1' 283 }, 284 /* 9 */{ 285 '\ufec5', '\ufecb', '\ufecf', '\ufed3', '\ufed7', '\ufedb', '\ufedd', '\ufee3', 286 '\ufee7', '\ufeeb', '\ufeed', '\ufef3', '\u2190', '\u2191', '\u2192', '\u2193' 287 }, 288 /* a */{ 289 '\u05d0', '\u05d1', '\u05d2', '\u05d3', '\u05d4', '\u05d5', '\u05d6', '\u05d7', 290 '\u05d8', '\u05d9', '\u05db', '\u05da', '\u05dc', '\u05de', '\u05dd', '\u05e0' 291 }, 292 /* b */{ 293 '\u05df', '\u05e1', '\u05e2', '\u05e4', '\u05e3', '\u05e6', '\u05e5', '\u05e7', 294 '\u05e8', '\u05e9', '\u05ea', '\u00B0', '\u00BC', '\u00BD', '\u00BE', '\u00A7' 295 }, 296 /* c */{ 297 '\u0404', '\u042F', '\u0020', '\u0427', '\u0414', '\u042D', '\u0444', '\u0403', 298 '\u00c8', '\u0418', '\u0436', '\u045C', '\u041B', '\u045B', '\u0452', '\u044B' 299 }, 300 /* d */{ 301 '\u00FD', '\u0459', '\u00d2', '\u0448', '\u0446', '\u042E', '\u0449', '\u040A', 302 '\u040F', '\u0419', '\u0417', '\u010D', '\u0161', '\u017E', '\u00de', '\u00df' 303 }, 304 /* e */{ 305 '\u03A0', '\u00C5', '\u01FC', '\u0152', '\u0177', '\u00DD', '\u00D5', '\u00D8', 306 '\u00FE', '\u014A', '\u03A3', '\u0106', '\u03BB', '\u03BC', '\u03B3', '\u03C9' 307 }, 308 /* f */{ 309 '\u03C0', '\u03A9', '\u037B', '\u00f3', '\u03C4', '\u03BE', '\u0398', '\u0393', 310 '\u039E', '\u03C5', '\u03B6', '\u03DB', '\u039B', '\u03A8', '\u0394', '\u0020' 311 } 312 }; 313 314 /********* FM TX *************/ 315 316 public static final int FM_AF_CODE_NO_AF_AVAILABLE = 224; 317 318 public static final int FM_RDS_PTY_CODE_NO_PROGRAM_UNDEFINED = 0; 319 320 public static final int FM_RDS_PTY_CODE_MAX_VALUE = 31; 321 322 public static final int FM_RDS_SCROLL_SPEED_DEFUALT = 3; 323 } 324