comparison gsm-fw/L1/tpudrv/tpudrv12.c @ 580:df12004ac8ee

tpudrv12.c: l1dmacro_tx_{up,down} done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 15 Aug 2014 01:05:44 +0000
parents df71726fa4e1
children bbb1e73782e6
comparison
equal deleted inserted replaced
579:df71726fa4e1 580:df12004ac8ee
571 TSP_TO_ABB(0x80); 571 TSP_TO_ABB(0x80);
572 *TP_Ptr++ = TPU_FAT(0x1384); 572 *TP_Ptr++ = TPU_FAT(0x1384);
573 TSP_TO_ABB(0xA0); 573 TSP_TO_ABB(0xA0);
574 *TP_Ptr++ = TPU_FAT(16); 574 *TP_Ptr++ = TPU_FAT(16);
575 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_up | 0x01); 575 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_up | 0x01);
576 576 *TP_Ptr++ = TPU_FAT(21);
577 577 *TP_Ptr++ = TPU_MOVE(TSP_ACTX, 0x0F);
578 } 578 }
579 579
580 /*-------------------------------------------*/ 580 /*-------------------------------------------*/
581 /* l1dmacro_tx_down */ 581 /* l1dmacro_tx_down */
582 /*-------------------------------------------*/ 582 /*-------------------------------------------*/
583 /* Close transmission window for normal burst*/ 583 /* Close transmission window for normal burst*/
584 /*-------------------------------------------*/ 584 /*-------------------------------------------*/
585 #if (L1_RF_KBD_FIX == 1) 585 /* Rita version differs from LoCosto, */
586 void l1dmacro_tx_down (WORD32 t, BOOL tx_flag, UWORD8 adc_active, UWORD8 kbd_config) 586 /* reconstructing from disassembly. */
587 { 587 /*-------------------------------------------*/
588 UWORD8 kbd_tspact_config =0;
589
590 if (kbd_config == KBD_DISABLED)
591 kbd_tspact_config = KBD_DIS_TSPACT;
592
593
594 if (adc_active == ACTIVE) {
595 // 36qbits = (10qbits for TPU programming) + (26qbits duration to convert the first ADC channel (= Battery))
596 if ((t)<(TRF_T8+2-TRF_T9)) //Done to enable RACH Burst Support
597 {
598 l1dmacro_adc_read_tx (TRF_T8+10, rf_path[rf_index].tx_up);
599 }
600 else
601 {
602 l1dmacro_adc_read_tx (t + TRF_T9, rf_path[rf_index].tx_up);
603 }
604 }
605
606
607
608 // t10: disable APC
609 *TP_Ptr++ = TPU_FAT (t + TRF_T10);
610 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, kbd_tspact_config | LDO_EN | APC_EN | TX_START );
611
612 // t11: disable PA
613 *TP_Ptr++ = TPU_FAT (t + TRF_T11);
614 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U, rf_path[rf_index].tx_down);
615 // disable Tx_Start
616 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, kbd_tspact_config | LDO_EN | APC_EN );
617
618 // t12: power off Locosto: IDLE SCRIPT
619 *TP_Ptr++ = TPU_FAT (t + TRF_T12);
620 MOVE_REG_TSP_TO_RF(START_SCRIPT(DRP_IDLE), ((UWORD16)( ((UWORD32)(&drp_regs->SCRIPT_STARTL))&0xFFFF)));
621
622 // t13: Switch off APC
623 *TP_Ptr++ = TPU_FAT (t + TRF_T13);
624 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, 0);
625
626 }
627 #endif /*(L1_RF_KBD_FIX == 1)*/
628
629
630
631 #if (L1_RF_KBD_FIX == 0)
632 void l1dmacro_tx_down (WORD32 t, BOOL tx_flag, UWORD8 adc_active) 588 void l1dmacro_tx_down (WORD32 t, BOOL tx_flag, UWORD8 adc_active)
633 { 589 {
634 590 if (adc_active == ACTIVE)
635 if (adc_active == ACTIVE) { 591 l1dmacro_adc_read_tx(t - 44);
636 // 36qbits = (10qbits for TPU programming) + (26qbits duration to convert the first ADC channel (= Battery)) 592 *TP_Ptr++ = TPU_FAT(t - 4);
637 l1dmacro_adc_read_tx (t + TRF_T9, rf_path[rf_index].tx_up); 593 TSP_TO_ABB(0x80);
638 } 594 *TP_Ptr++ = TPU_FAT(t + 22);
639 595 *TP_Ptr++ = TPU_MOVE(TSP_ACTX, 0x00);
640 // t10: disable APC 596 *TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_down | 0x01);
641 *TP_Ptr++ = TPU_FAT (t + TRF_T10); 597 *TP_Ptr++ = TPU_FAT(t + 25);
642 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, kbd_tspact_config | LDO_EN | APC_EN | TX_START ); 598 TSP_TO_RF(0x003A);
643 599 *TP_Ptr++ = TPU_FAT(t + 31);
644 // t11: disable PA 600 TSP_TO_ABB(0x00);
645 *TP_Ptr++ = TPU_FAT (t + TRF_T11); 601 }
646 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_U, rf_path[rf_index].tx_down);
647 // disable Tx_Start
648 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, kbd_tspact_config | LDO_EN | APC_EN );
649
650 // t12: power off Locosto: IDLE SCRIPT
651 *TP_Ptr++ = TPU_FAT (t + TRF_T12);
652 MOVE_REG_TSP_TO_RF(START_SCRIPT(DRP_IDLE), (UWORD16)(&drp_regs->SCRIPT_STARTL));
653
654 // t13: Switch off APC
655 *TP_Ptr++ = TPU_FAT (t + TRF_T13);
656 *TP_Ptr++ = TPU_MOVE(REG_SPI_ACT_L, 0);
657
658 }
659
660
661 #endif/*(L1_RF_KBD_FIX == 0)*/
662 602
663 /* 603 /*
664 * l1dmacro_rx_nb 604 * l1dmacro_rx_nb
665 * 605 *
666 * Receive Normal burst 606 * Receive Normal burst