_NUM_L1_TXWIN
};
-void l1s_rx_win_ctrl(uint16_t arfcn, enum l1_rxwin_type wtype);
-void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr);
+void l1s_rx_win_ctrl(uint16_t arfcn, enum l1_rxwin_type wtype, uint8_t tn);
+void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr, uint8_t tn);
void tpu_end_scenario(void);
dsp_end_scenario();
/* Program TPU */
- l1s_rx_win_ctrl(rf_arfcn, L1_RXWIN_SB);
+ l1s_rx_win_ctrl(rf_arfcn, L1_RXWIN_SB, 0);
tpu_end_scenario();
return 0;
dsp_end_scenario();
/* Program TPU */
- l1s_rx_win_ctrl(fbs.req.band_arfcn, L1_RXWIN_FB);
+ l1s_rx_win_ctrl(fbs.req.band_arfcn, L1_RXWIN_FB, 0);
tpu_end_scenario();
return 0;
#include <abb/twl3025.h>
#include <rf/trf6151.h>
+#include <layer1/sync.h>
#include <layer1/tpu_window.h>
/* all units in GSM quarter-bits (923.1ns) */
[L1_TXWIN_AB] = L1_TX_AB_DURATION_Q,
};
-void l1s_rx_win_ctrl(uint16_t arfcn, enum l1_rxwin_type wtype)
+void l1s_rx_win_ctrl(uint16_t arfcn, enum l1_rxwin_type wtype, uint8_t tn)
{
int16_t start = DSP_SETUP_TIME;
int16_t stop = start + rx_burst_duration[wtype] - 1;
/* FIXME: AGC */
/* FIXME: RF PLL */
+ /* Alignement */
+ tpu_enq_offset( (5000 + l1s.tpu_offset + (L1_BURST_LENGTH_Q * tn)) % 5000 );
+ tpu_enq_at(5000 - 1000 - (L1_BURST_LENGTH_Q * tn));
+
/* window open for TRF6151 */
/* FIXME: why do we need the magic value 100 ? */
rffe_mode(gsm_arfcn2band(arfcn), 0);
trf6151_set_mode(TRF6151_IDLE);
}
-void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
+void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr, uint8_t tn)
{
/* uplink is three TS after downlink ( "+ 32" gives a TA of 1) */
uint16_t offset = (L1_BURST_LENGTH_Q * 3) + 28;
- /* this is needed to cause a delay of one more TDMA frame,
- * otherwise we have an off-by-one error and send the bursts
- * at the wrong point in time, resulting in only 3 out of 4
- * bursts arriving at the BTS */
- tpu_enq_at(5000 - 10); /* TPU_CLOCK_RANGE - EPSILON_SYNC */
+ /* Alignement */
+ tpu_enq_offset( (5000 + l1s.tpu_offset + (L1_BURST_LENGTH_Q * tn)) % 5000 );
+ tpu_enq_at(5000 - 10 - (L1_BURST_LENGTH_Q * tn));
#ifdef CONFIG_TX_ENABLE
/* window open for TRF6151 and RFFE */