- memset(&CmdFrm, 0, sizeof(AVCCmdFrm));
-
- CmdFrm.cts = AVC;
- CmdFrm.ctype = CONTROL;
- CmdFrm.sutyp = 0x5;
- CmdFrm.suid = firesat->subunit;
- CmdFrm.opcode = DSD;
-
- CmdFrm.operand[0] = 0; // source plug
- CmdFrm.operand[1] = 0xD2; // subfunction replace
- CmdFrm.operand[2] = 0x20; // system id = DVB
- CmdFrm.operand[3] = 0x00; // antenna number
- // system_specific_multiplex selection_length
- CmdFrm.operand[4] = (firesat->type == FireSAT_DVB_T)?0x0c:0x11;
- CmdFrm.operand[5] = flags.Valid_Word.ByteHi; // valid_flags [0]
- CmdFrm.operand[6] = flags.Valid_Word.ByteLo; // valid_flags [1]
-
- if(firesat->type == FireSAT_DVB_T) {
- CmdFrm.operand[7] = 0x0;
- CmdFrm.operand[8] = (params->frequency/10) >> 24;
- CmdFrm.operand[9] =
- ((params->frequency/10) >> 16) & 0xFF;
- CmdFrm.operand[10] =
- ((params->frequency/10) >> 8) & 0xFF;
- CmdFrm.operand[11] = (params->frequency/10) & 0xFF;
- switch(params->u.ofdm.bandwidth) {
- case BANDWIDTH_7_MHZ:
- CmdFrm.operand[12] = 0x20;
- break;
- case BANDWIDTH_8_MHZ:
- case BANDWIDTH_6_MHZ: // not defined by AVC spec
- case BANDWIDTH_AUTO:
- default:
- CmdFrm.operand[12] = 0x00;
- }
- switch(params->u.ofdm.constellation) {
- case QAM_16:
- CmdFrm.operand[13] = 1 << 6;
- break;
- case QAM_64:
- CmdFrm.operand[13] = 2 << 6;
- break;
- case QPSK:
- default:
- CmdFrm.operand[13] = 0x00;
- }
- switch(params->u.ofdm.hierarchy_information) {
- case HIERARCHY_1:
- CmdFrm.operand[13] |= 1 << 3;
- break;
- case HIERARCHY_2:
- CmdFrm.operand[13] |= 2 << 3;
- break;
- case HIERARCHY_4:
- CmdFrm.operand[13] |= 3 << 3;
- break;
- case HIERARCHY_AUTO:
- case HIERARCHY_NONE:
- default:
- break;
- }
- switch(params->u.ofdm.code_rate_HP) {
- case FEC_2_3:
- CmdFrm.operand[13] |= 1;
- break;
- case FEC_3_4:
- CmdFrm.operand[13] |= 2;
- break;
- case FEC_5_6:
- CmdFrm.operand[13] |= 3;
- break;
- case FEC_7_8:
- CmdFrm.operand[13] |= 4;
- break;
- case FEC_1_2:
- default:
- break;
- }
- switch(params->u.ofdm.code_rate_LP) {
- case FEC_2_3:
- CmdFrm.operand[14] = 1 << 5;
- break;
- case FEC_3_4:
- CmdFrm.operand[14] = 2 << 5;
- break;
- case FEC_5_6:
- CmdFrm.operand[14] = 3 << 5;
- break;
- case FEC_7_8:
- CmdFrm.operand[14] = 4 << 5;
- break;
- case FEC_1_2:
- default:
- CmdFrm.operand[14] = 0x00;
- break;
- }
- switch(params->u.ofdm.guard_interval) {
- case GUARD_INTERVAL_1_16:
- CmdFrm.operand[14] |= 1 << 3;
- break;
- case GUARD_INTERVAL_1_8:
- CmdFrm.operand[14] |= 2 << 3;
- break;
- case GUARD_INTERVAL_1_4:
- CmdFrm.operand[14] |= 3 << 3;
- break;
- case GUARD_INTERVAL_1_32:
- case GUARD_INTERVAL_AUTO:
- default:
- break;
- }
- switch(params->u.ofdm.transmission_mode) {
- case TRANSMISSION_MODE_8K:
- CmdFrm.operand[14] |= 1 << 1;
- break;
- case TRANSMISSION_MODE_2K:
- case TRANSMISSION_MODE_AUTO:
- default:
- break;
- }
-
- CmdFrm.operand[15] = 0x00; // network_ID[0]
- CmdFrm.operand[16] = 0x00; // network_ID[1]
- CmdFrm.operand[17] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted
-
- CmdFrm.length = 24;
- } else {
- CmdFrm.operand[7] = 0x00;
- CmdFrm.operand[8] = 0x00;
- CmdFrm.operand[9] = 0x00;
- CmdFrm.operand[10] = 0x00;
-
- CmdFrm.operand[11] =
- (((params->frequency/4000) >> 16) & 0xFF) | (2 << 6);
- CmdFrm.operand[12] =
- ((params->frequency/4000) >> 8) & 0xFF;
- CmdFrm.operand[13] = (params->frequency/4000) & 0xFF;
- CmdFrm.operand[14] =
- ((params->u.qpsk.symbol_rate/1000) >> 12) & 0xFF;
- CmdFrm.operand[15] =
- ((params->u.qpsk.symbol_rate/1000) >> 4) & 0xFF;
- CmdFrm.operand[16] =
- ((params->u.qpsk.symbol_rate/1000) << 4) & 0xF0;
- CmdFrm.operand[17] = 0x00;
- switch(params->u.qpsk.fec_inner) {
- case FEC_1_2:
- CmdFrm.operand[18] = 0x1;
- break;
- case FEC_2_3:
- CmdFrm.operand[18] = 0x2;
- break;
- case FEC_3_4:
- CmdFrm.operand[18] = 0x3;
- break;
- case FEC_5_6:
- CmdFrm.operand[18] = 0x4;
- break;
- case FEC_7_8:
- CmdFrm.operand[18] = 0x5;
- break;
- case FEC_8_9:
- CmdFrm.operand[18] = 0x6;
- break;
- case FEC_4_5:
- CmdFrm.operand[18] = 0x8;
- break;
- case FEC_AUTO:
- default:
- CmdFrm.operand[18] = 0x0;
- }
- switch(params->u.qam.modulation) {
- case QAM_16:
- CmdFrm.operand[19] = 0x08; // modulation
- break;
- case QAM_32:
- CmdFrm.operand[19] = 0x10; // modulation
- break;
- case QAM_64:
- CmdFrm.operand[19] = 0x18; // modulation
- break;
- case QAM_128:
- CmdFrm.operand[19] = 0x20; // modulation
- break;
- case QAM_256:
- CmdFrm.operand[19] = 0x28; // modulation
- break;
- case QAM_AUTO:
- default:
- CmdFrm.operand[19] = 0x00; // modulation
- }
- CmdFrm.operand[20] = 0x00;
- CmdFrm.operand[21] = 0x00;
- CmdFrm.operand[22] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted
-
- CmdFrm.length=28;
- }
- } // AVCTuner_DSD_direct