4 // GPIO definitions for antenna frequency domain control (SMS8021)
5 #define SMS_ANTENNA_GPIO_0 1
6 #define SMS_ANTENNA_GPIO_1 0
12 #define BW_ISDBT_1SEG 4
13 #define BW_ISDBT_3SEG 5
15 #define MSG_HDR_FLAG_SPLIT_MSG 4
17 #define MAX_GPIO_PIN_NUMBER 31
20 #define SMS_HOST_LIB 150
21 #define DVBT_BDA_CONTROL_MSG_ID 201
23 #define SMS_MAX_PAYLOAD_SIZE 240
24 #define SMS_TUNE_TIMEOUT 500
26 #define MSG_SMS_GPIO_CONFIG_REQ 507
27 #define MSG_SMS_GPIO_CONFIG_RES 508
28 #define MSG_SMS_GPIO_SET_LEVEL_REQ 509
29 #define MSG_SMS_GPIO_SET_LEVEL_RES 510
30 #define MSG_SMS_GPIO_GET_LEVEL_REQ 511
31 #define MSG_SMS_GPIO_GET_LEVEL_RES 512
32 #define MSG_SMS_RF_TUNE_REQ 561
33 #define MSG_SMS_RF_TUNE_RES 562
34 #define MSG_SMS_INIT_DEVICE_REQ 578
35 #define MSG_SMS_INIT_DEVICE_RES 579
36 #define MSG_SMS_ADD_PID_FILTER_REQ 601
37 #define MSG_SMS_ADD_PID_FILTER_RES 602
38 #define MSG_SMS_REMOVE_PID_FILTER_REQ 603
39 #define MSG_SMS_REMOVE_PID_FILTER_RES 604
40 #define MSG_SMS_DAB_CHANNEL 607
41 #define MSG_SMS_GET_PID_FILTER_LIST_REQ 608
42 #define MSG_SMS_GET_PID_FILTER_LIST_RES 609
43 #define MSG_SMS_GET_STATISTICS_REQ 615
44 #define MSG_SMS_GET_STATISTICS_RES 616
45 #define MSG_SMS_SET_ANTENNA_CONFIG_REQ 651
46 #define MSG_SMS_SET_ANTENNA_CONFIG_RES 652
47 #define MSG_SMS_GET_STATISTICS_EX_REQ 653
48 #define MSG_SMS_GET_STATISTICS_EX_RES 654
49 #define MSG_SMS_SLEEP_RESUME_COMP_IND 655
50 #define MSG_SMS_DATA_DOWNLOAD_REQ 660
51 #define MSG_SMS_DATA_DOWNLOAD_RES 661
52 #define MSG_SMS_SWDOWNLOAD_TRIGGER_REQ 664
53 #define MSG_SMS_SWDOWNLOAD_TRIGGER_RES 665
54 #define MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ 666
55 #define MSG_SMS_SWDOWNLOAD_BACKDOOR_RES 667
56 #define MSG_SMS_GET_VERSION_EX_REQ 668
57 #define MSG_SMS_GET_VERSION_EX_RES 669
58 #define MSG_SMS_SET_CLOCK_OUTPUT_REQ 670
59 #define MSG_SMS_I2C_SET_FREQ_REQ 685
60 #define MSG_SMS_GENERIC_I2C_REQ 687
61 #define MSG_SMS_GENERIC_I2C_RES 688
62 #define MSG_SMS_DVBT_BDA_DATA 693
63 #define MSG_SW_RELOAD_REQ 697
64 #define MSG_SMS_DATA_MSG 699
65 #define MSG_SW_RELOAD_START_REQ 702
66 #define MSG_SW_RELOAD_START_RES 703
67 #define MSG_SW_RELOAD_EXEC_REQ 704
68 #define MSG_SW_RELOAD_EXEC_RES 705
69 #define MSG_SMS_SPI_INT_LINE_SET_REQ 710
70 #define MSG_SMS_ISDBT_TUNE_REQ 776
71 #define MSG_SMS_ISDBT_TUNE_RES 777
73 #define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \
74 (ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \
75 (ptr)->msgLength = len; (ptr)->msgFlags = 0; \
77 #define SMS_INIT_MSG(ptr, type, len) SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)
81 DEVICE_MODE_NONE = -1,
85 DEVICE_MODE_DAB_TDMB_DABIP,
88 DEVICE_MODE_ISDBT_BDA,
90 DEVICE_MODE_RAW_TUNER,
94 typedef unsigned char UINT8;
95 typedef unsigned short UINT16;
96 typedef unsigned int UINT32;
99 typedef struct SmsMsgHdr_S
104 UINT16 msgLength; // Length is of the entire message, including header
108 typedef struct SmsMsgData_S
110 SmsMsgHdr_ST xMsgHeader;
114 typedef struct SmsDataDownload_S
116 SmsMsgHdr_ST xMsgHeader;
118 UINT8 Payload[SMS_MAX_PAYLOAD_SIZE];
119 } SmsDataDownload_ST;
121 typedef struct SmsVersionRes_S
123 SmsMsgHdr_ST xMsgHeader;
125 UINT16 ChipModel; // e.g. 0x1102 for SMS-1102 "Nova"
126 UINT8 Step; // 0 - Step A
127 UINT8 MetalFix; // 0 - Metal 0
129 UINT8 FirmwareId; // 0xFF � ROM, otherwise the value indicated by SMSHOSTLIB_DEVICE_MODES_E
130 UINT8 SupportedProtocols; // Bitwise OR combination of supported protocols
135 UINT8 VersionFieldPatch;
137 UINT8 RomVersionMajor;
138 UINT8 RomVersionMinor;
139 UINT8 RomVersionPatch;
140 UINT8 RomVersionFieldPatch;
145 typedef struct SmsFirmware_S
153 typedef struct SMSHOSTLIB_STATISTICS_S
155 UINT32 Reserved; //!< Reserved
157 /// Common parameters
158 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
159 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
160 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
162 /// Reception quality
164 UINT32 BER; //!< Post Viterbi BER [1E-5]
165 UINT32 FIB_CRC; //!< CRC errors percentage, valid only for DAB
166 UINT32 TS_PER; //!< Transport stream PER, 0xFFFFFFFF indicate N/A, valid only for DVB-T/H
167 UINT32 MFER; //!< DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H
169 INT32 InBandPwr; //!< In band power in dBM
170 INT32 CarrierOffset; //!< Carrier Offset in bin/1024
172 /// Transmission parameters
173 UINT32 Frequency; //!< Frequency in Hz
174 UINT32 Bandwidth; //!< Bandwidth in MHz, valid only for DVB-T/H
175 UINT32 TransmissionMode; //!< Transmission Mode, for DAB modes 1-4, for DVB-T/H FFT mode carriers in Kilos
176 UINT32 ModemState; //!< from SMS_DvbModemState_ET , valid only for DVB-T/H
177 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value , valid only for DVB-T/H
178 UINT32 CodeRate; //!< Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
179 UINT32 LPCodeRate; //!< Low Priority Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H
180 UINT32 Hierarchy; //!< Hierarchy from SMS_Hierarchy_ET, valid only for DVB-T/H
181 UINT32 Constellation; //!< Constellation from SMS_Constellation_ET, valid only for DVB-T/H
183 /// Burst parameters, valid only for DVB-H
184 UINT32 BurstSize; //!< Current burst size in bytes, valid only for DVB-H
185 UINT32 BurstDuration; //!< Current burst duration in mSec, valid only for DVB-H
186 UINT32 BurstCycleTime; //!< Current burst cycle time in mSec, valid only for DVB-H
187 UINT32 CalculatedBurstCycleTime;//!< Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H
188 UINT32 NumOfRows; //!< Number of rows in MPE table, valid only for DVB-H
189 UINT32 NumOfPaddCols; //!< Number of padding columns in MPE table, valid only for DVB-H
190 UINT32 NumOfPunctCols; //!< Number of puncturing columns in MPE table, valid only for DVB-H
191 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
192 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
193 UINT32 NumOfValidMpeTlbs; //!< Number of MPE tables which do not include errors after MPE RS decoding
194 UINT32 NumOfInvalidMpeTlbs; //!< Number of MPE tables which include errors after MPE RS decoding
195 UINT32 NumOfCorrectedMpeTlbs; //!< Number of MPE tables which were corrected by MPE RS decoding
197 UINT32 BERErrorCount; //!< Number of errornous SYNC bits.
198 UINT32 BERBitCount; //!< Total number of SYNC bits.
200 /// Interface information
201 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
204 UINT32 PreBER; //!< DAB/T-DMB only: Pre Viterbi BER [1E-5]
206 /// DVB-H TPS parameters
207 UINT32 CellId; //!< TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered
209 } SMSHOSTLIB_STATISTICS_ST;
213 UINT32 RequestResult;
215 SMSHOSTLIB_STATISTICS_ST Stat;
217 // Split the calc of the SNR in DAB
218 UINT32 Signal; //!< dB
219 UINT32 Noise; //!< dB
221 } SmsMsgStatisticsInfo_ST;
223 typedef struct SMSHOSTLIB_ISDBT_LAYER_STAT_S
225 // Per-layer information
226 UINT32 CodeRate; //!< Code Rate from SMSHOSTLIB_CODE_RATE_ET, 255 means layer does not exist
227 UINT32 Constellation; //!< Constellation from SMSHOSTLIB_CONSTELLATION_ET, 255 means layer does not exist
228 UINT32 BER; //!< Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A
229 UINT32 BERErrorCount; //!< Post Viterbi Error Bits Count
230 UINT32 BERBitCount; //!< Post Viterbi Total Bits Count
231 UINT32 PreBER; //!< Pre Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A
232 UINT32 TS_PER; //!< Transport stream PER [%], 0xFFFFFFFF indicate N/A
233 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
234 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
235 UINT32 TILdepthI; //!< Time interleaver depth I parameter, 255 means layer does not exist
236 UINT32 NumberOfSegments; //!< Number of segments in layer A, 255 means layer does not exist
237 UINT32 TMCCErrors; //!< TMCC errors
238 } SMSHOSTLIB_ISDBT_LAYER_STAT_ST;
240 typedef struct SMSHOSTLIB_STATISTICS_ISDBT_S
242 UINT32 StatisticsType; //!< Enumerator identifying the type of the structure. Values are the same as SMSHOSTLIB_DEVICE_MODES_E
243 //!< This fiels MUST always first in any statistics structure
245 UINT32 FullSize; //!< Total size of the structure returned by the modem. If the size requested by
246 //!< the host is smaller than FullSize, the struct will be truncated
249 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
250 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
251 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
256 INT32 InBandPwr; //!< In band power in dBM
257 INT32 CarrierOffset; //!< Carrier Offset in Hz
259 // Transmission parameters
260 UINT32 Frequency; //!< Frequency in Hz
261 UINT32 Bandwidth; //!< Bandwidth in MHz
262 UINT32 TransmissionMode; //!< ISDB-T transmission mode
263 UINT32 ModemState; //!< 0 - Acquisition, 1 - Locked
264 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value
265 UINT32 SystemType; //!< ISDB-T system type (ISDB-T / ISDB-Tsb)
266 UINT32 PartialReception; //!< TRUE - partial reception, FALSE otherwise
267 UINT32 NumOfLayers; //!< Number of ISDB-T layers in the network
269 // Per-layer information
271 SMSHOSTLIB_ISDBT_LAYER_STAT_ST LayerInfo[3]; //!< Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST
273 // Interface information
274 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
276 } SMSHOSTLIB_STATISTICS_ISDBT_ST;
278 typedef struct SMSHOSTLIB_STATISTICS_DVB_S
280 UINT32 StatisticsType; //!< Enumerator identifying the type of the structure. Values are the same as SMSHOSTLIB_DEVICE_MODES_E
281 //!< This fiels MUST always first in any statistics structure
283 UINT32 FullSize; //!< Total size of the structure returned by the modem. If the size requested by
284 //!< the host is smaller than FullSize, the struct will be truncated
286 UINT32 IsRfLocked; //!< 0 - not locked, 1 - locked
287 UINT32 IsDemodLocked; //!< 0 - not locked, 1 - locked
288 UINT32 IsExternalLNAOn; //!< 0 - external LNA off, 1 - external LNA on
292 UINT32 BER; //!< Post Viterbi BER [1E-5]
293 UINT32 BERErrorCount; //!< Number of errornous SYNC bits.
294 UINT32 BERBitCount; //!< Total number of SYNC bits.
295 UINT32 TS_PER; //!< Transport stream PER, 0xFFFFFFFF indicate N/A
296 UINT32 MFER; //!< DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H
298 INT32 InBandPwr; //!< In band power in dBM
299 INT32 CarrierOffset; //!< Carrier Offset in bin/1024
301 // Transmission parameters
302 UINT32 Frequency; //!< Frequency in Hz
303 UINT32 Bandwidth; //!< Bandwidth in MHz
304 UINT32 ModemState; //!< from SMSHOSTLIB_DVB_MODEM_STATE_ET
305 UINT32 TransmissionMode; //!< FFT mode carriers in Kilos
306 UINT32 GuardInterval; //!< Guard Interval, 1 divided by value
307 UINT32 CodeRate; //!< Code Rate from SMSHOSTLIB_CODE_RATE_ET
308 UINT32 LPCodeRate; //!< Low Priority Code Rate from SMSHOSTLIB_CODE_RATE_ET
309 UINT32 Hierarchy; //!< Hierarchy from SMSHOSTLIB_HIERARCHY_ET
310 UINT32 Constellation; //!< Constellation from SMSHOSTLIB_CONSTELLATION_ET
312 // Burst parameters, valid only for DVB-H
313 UINT32 BurstSize; //!< Current burst size in bytes, valid only for DVB-H
314 UINT32 BurstDuration; //!< Current burst duration in mSec, valid only for DVB-H
315 UINT32 BurstCycleTime; //!< Current burst cycle time in mSec, valid only for DVB-H
316 UINT32 CalculatedBurstCycleTime;//!< Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H
317 UINT32 NumOfRows; //!< Number of rows in MPE table, valid only for DVB-H
318 UINT32 NumOfPaddCols; //!< Number of padding columns in MPE table, valid only for DVB-H
319 UINT32 NumOfPunctCols; //!< Number of puncturing columns in MPE table, valid only for DVB-H
320 UINT32 ErrorTSPackets; //!< Number of erroneous transport-stream packets
321 UINT32 TotalTSPackets; //!< Total number of transport-stream packets
322 UINT32 NumOfValidMpeTlbs; //!< Number of MPE tables which do not include errors after MPE RS decoding, valid only for DVB-H
323 UINT32 NumOfInvalidMpeTlbs; //!< Number of MPE tables which include errors after MPE RS decoding, valid only for DVB-H
324 UINT32 NumOfCorrectedMpeTlbs; //!< Number of MPE tables which were corrected by MPE RS decoding, valid only for DVB-H
325 UINT32 NumMPEReceived; //!< DVB-H, Num MPE section received
327 // DVB-H TPS parameters
328 UINT32 CellId; //!< TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered
329 UINT32 DvbhSrvIndHP; //!< DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator
330 UINT32 DvbhSrvIndLP; //!< DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator
332 // Interface information
333 UINT32 SmsToHostTxErrors; //!< Total number of transmission errors.
335 } SMSHOSTLIB_STATISTICS_DVB_ST;
337 typedef struct SMSHOSTLIB_GPIO_CONFIG_S
339 UINT8 Direction; //!< GPIO direction: Input - 0, Output - 1
340 UINT8 PullUpDown; //!< PullUp/PullDown: None - 0, PullDown - 1, PullUp - 2, Keeper - 3
341 UINT8 InputCharacteristics; //!< Input Characteristics: Normal - 0, Schmitt trigger - 1
342 UINT8 OutputSlewRate; //!< Output Slew Rate: Fast slew rate - 0, Slow slew rate - 1
343 UINT8 OutputDriving; //!< Output driving capability: 4mA - 0, 8mA - 1, 12mA - 2, 16mA - 3
344 } SMSHOSTLIB_GPIO_CONFIG_ST;
346 typedef struct SMSHOSTLIB_I2C_REQ_S
348 UINT32 DeviceAddress; // I2c device address
349 UINT32 WriteCount; // number of bytes to write
350 UINT32 ReadCount; // number of bytes to read
352 } SMSHOSTLIB_I2C_REQ_ST;
354 typedef struct SMSHOSTLIB_I2C_RES_S
356 UINT32 Status; // non-zero value in case of failure
357 UINT32 ReadCount; // number of bytes read
359 } SMSHOSTLIB_I2C_RES_ST;
361 #endif // __smstypes_h__