Eric Laurent | 4e09069 | 2015-03-05 15:12:40 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_HARDWARE_RADIO_REGIONS_H |
| 18 | #define ANDROID_HARDWARE_RADIO_REGIONS_H |
| 19 | |
| 20 | namespace android { |
| 21 | |
| 22 | #define RADIO_BAND_LOWER_FM_ITU1 87500 |
| 23 | #define RADIO_BAND_UPPER_FM_ITU1 108000 |
| 24 | #define RADIO_BAND_SPACING_FM_ITU1 100 |
| 25 | |
| 26 | #define RADIO_BAND_LOWER_FM_ITU2 87900 |
| 27 | #define RADIO_BAND_UPPER_FM_ITU2 107900 |
| 28 | #define RADIO_BAND_SPACING_FM_ITU2 200 |
| 29 | |
| 30 | #define RADIO_BAND_LOWER_FM_JAPAN 76000 |
| 31 | #define RADIO_BAND_UPPER_FM_JAPAN 90000 |
| 32 | #define RADIO_BAND_SPACING_FM_JAPAN 100 |
| 33 | |
| 34 | #define RADIO_BAND_LOWER_FM_OIRT 65800 |
| 35 | #define RADIO_BAND_UPPER_FM_OIRT 74000 |
| 36 | #define RADIO_BAND_SPACING_FM_OIRT 10 |
| 37 | |
| 38 | #define RADIO_BAND_LOWER_LW 153 |
| 39 | #define RADIO_BAND_UPPER_LW 279 |
| 40 | #define RADIO_BAND_SPACING_LW 9 |
| 41 | |
| 42 | #define RADIO_BAND_LOWER_MW_IUT1 531 |
| 43 | #define RADIO_BAND_UPPER_MW_ITU1 1611 |
| 44 | #define RADIO_BAND_SPACING_MW_ITU1 9 |
| 45 | |
| 46 | #define RADIO_BAND_LOWER_MW_IUT2 540 |
| 47 | #define RADIO_BAND_UPPER_MW_ITU2 1610 |
| 48 | #define RADIO_BAND_SPACING_MW_ITU2 10 |
| 49 | |
| 50 | #define RADIO_BAND_LOWER_SW 2300 |
| 51 | #define RADIO_BAND_UPPER_SW 26100 |
| 52 | #define RADIO_BAND_SPACING_SW 5 |
| 53 | |
| 54 | |
| 55 | #ifndef ARRAY_SIZE |
| 56 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) |
| 57 | #endif |
| 58 | |
| 59 | const radio_band_config_t sKnownRegionConfigs[] = { |
| 60 | { // FM ITU 1 |
| 61 | RADIO_REGION_ITU_1, |
| 62 | { |
| 63 | RADIO_BAND_FM, |
| 64 | false, |
| 65 | RADIO_BAND_LOWER_FM_ITU1, |
| 66 | RADIO_BAND_UPPER_FM_ITU1, |
| 67 | 1, |
| 68 | {RADIO_BAND_SPACING_FM_ITU1}, |
| 69 | { |
| 70 | RADIO_DEEMPHASIS_50, |
| 71 | true, |
| 72 | RADIO_RDS_WORLD, |
| 73 | true, |
| 74 | true, |
| 75 | } |
| 76 | } |
| 77 | }, |
| 78 | { // FM Americas |
| 79 | RADIO_REGION_ITU_2, |
| 80 | { |
| 81 | RADIO_BAND_FM, |
| 82 | false, |
| 83 | RADIO_BAND_LOWER_FM_ITU2, |
| 84 | RADIO_BAND_UPPER_FM_ITU2, |
| 85 | 1, |
| 86 | {RADIO_BAND_SPACING_FM_ITU2}, |
| 87 | { |
| 88 | RADIO_DEEMPHASIS_75, |
| 89 | true, |
| 90 | RADIO_RDS_US, |
| 91 | true, |
| 92 | true, |
| 93 | } |
| 94 | } |
| 95 | }, |
| 96 | { // FM Japan |
| 97 | RADIO_REGION_JAPAN, |
| 98 | { |
| 99 | RADIO_BAND_FM, |
| 100 | false, |
| 101 | RADIO_BAND_LOWER_FM_JAPAN, |
| 102 | RADIO_BAND_UPPER_FM_JAPAN, |
| 103 | 1, |
| 104 | {RADIO_BAND_SPACING_FM_JAPAN}, |
| 105 | { |
| 106 | RADIO_DEEMPHASIS_50, |
| 107 | true, |
| 108 | RADIO_RDS_WORLD, |
| 109 | true, |
| 110 | true, |
| 111 | } |
| 112 | } |
| 113 | }, |
| 114 | { // FM Korea |
| 115 | RADIO_REGION_KOREA, |
| 116 | { |
| 117 | RADIO_BAND_FM, |
| 118 | false, |
| 119 | RADIO_BAND_LOWER_FM_ITU1, |
| 120 | RADIO_BAND_UPPER_FM_ITU1, |
| 121 | 1, |
| 122 | {RADIO_BAND_SPACING_FM_ITU1}, |
| 123 | { |
| 124 | RADIO_DEEMPHASIS_75, |
| 125 | true, |
| 126 | RADIO_RDS_WORLD, |
| 127 | true, |
| 128 | true, |
| 129 | } |
| 130 | } |
| 131 | }, |
| 132 | { // FM OIRT |
| 133 | RADIO_REGION_OIRT, |
| 134 | { |
| 135 | RADIO_BAND_FM, |
| 136 | false, |
| 137 | RADIO_BAND_LOWER_FM_OIRT, |
| 138 | RADIO_BAND_UPPER_FM_OIRT, |
| 139 | 1, |
| 140 | {RADIO_BAND_SPACING_FM_OIRT}, |
| 141 | { |
| 142 | RADIO_DEEMPHASIS_50, |
| 143 | true, |
| 144 | RADIO_RDS_WORLD, |
| 145 | true, |
| 146 | true, |
| 147 | } |
| 148 | } |
| 149 | }, |
| 150 | { // FM US HD radio |
| 151 | RADIO_REGION_ITU_2, |
| 152 | { |
| 153 | RADIO_BAND_FM_HD, |
| 154 | false, |
| 155 | RADIO_BAND_LOWER_FM_ITU2, |
| 156 | RADIO_BAND_UPPER_FM_ITU2, |
| 157 | 1, |
| 158 | {RADIO_BAND_SPACING_FM_ITU2}, |
| 159 | { |
| 160 | RADIO_DEEMPHASIS_75, |
| 161 | true, |
| 162 | RADIO_RDS_US, |
| 163 | true, |
| 164 | true, |
| 165 | } |
| 166 | } |
| 167 | }, |
| 168 | { // AM LW |
| 169 | RADIO_REGION_ITU_1, |
| 170 | { |
| 171 | RADIO_BAND_AM, |
| 172 | false, |
| 173 | RADIO_BAND_LOWER_LW, |
| 174 | RADIO_BAND_UPPER_LW, |
| 175 | 1, |
| 176 | {RADIO_BAND_SPACING_LW}, |
| 177 | { |
| 178 | } |
| 179 | } |
| 180 | }, |
| 181 | { // AM SW |
| 182 | RADIO_REGION_ITU_1, |
| 183 | { |
| 184 | RADIO_BAND_AM, |
| 185 | false, |
| 186 | RADIO_BAND_LOWER_SW, |
| 187 | RADIO_BAND_UPPER_SW, |
| 188 | 1, |
| 189 | {RADIO_BAND_SPACING_SW}, |
| 190 | { |
| 191 | } |
| 192 | } |
| 193 | }, |
| 194 | { // AM MW ITU1 |
| 195 | RADIO_REGION_ITU_1, |
| 196 | { |
| 197 | RADIO_BAND_AM, |
| 198 | false, |
| 199 | RADIO_BAND_LOWER_MW_IUT1, |
| 200 | RADIO_BAND_UPPER_MW_ITU1, |
| 201 | 1, |
| 202 | {RADIO_BAND_SPACING_MW_ITU1}, |
| 203 | { |
| 204 | } |
| 205 | } |
| 206 | }, |
| 207 | { // AM MW ITU2 |
| 208 | RADIO_REGION_ITU_2, |
| 209 | { |
| 210 | RADIO_BAND_AM, |
| 211 | false, |
| 212 | RADIO_BAND_LOWER_MW_IUT2, |
| 213 | RADIO_BAND_UPPER_MW_ITU2, |
| 214 | 1, |
| 215 | {RADIO_BAND_SPACING_MW_ITU2}, |
| 216 | { |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | }; |
| 221 | |
| 222 | |
| 223 | } // namespace android |
| 224 | |
| 225 | #endif // ANDROID_HARDWARE_RADIO_REGIONS_H |