Uplink: Use TPU window driven model

This means we can even send and receive in the same TDMA frame,
provided we keep the usual 3 timeslot distance between DL and UL.
This commit is contained in:
Harald Welte 2010-02-23 01:34:47 +01:00
parent 5f446da36d
commit 330fe01d80
2 changed files with 16 additions and 3 deletions

View File

@ -245,6 +245,9 @@ void twl3025_downlink(int on, int16_t at)
}
}
/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */
#define UPLINK_DELAY (3 * TSP_DELAY + BULCAL_DURATION + BULON_TO_BULCAL + 35)
void twl3025_uplink(int on, int16_t at)
{
int16_t bul_ena = at - TSP_DELAY - 6;
@ -252,12 +255,19 @@ void twl3025_uplink(int on, int16_t at)
if (bul_ena < 0)
printf("BULENA time negative (%d)\n", bul_ena);
if (on) {
/* FIXME: calibration should be done just before BULENA */
/* calibration should be done just before BULENA */
tpu_enq_at(bul_ena - UPLINK_DELAY);
/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */
twl3025_tsp_write(BULON);
/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL */
tpu_enq_wait(BULON_TO_BULCAL - TSP_DELAY);
/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY */
twl3025_tsp_write(BULON | BULCAL);
/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION */
tpu_enq_wait(BULCAL_DURATION - TSP_DELAY);
/* bdl_ena - 35 - TSP_DELAY */
twl3025_tsp_write(BULON);
/* bdl_ena - 35 */
tpu_enq_wait(35); /* minimum time required to bring the ramp up (really needed?) */
tpu_enq_at(bul_ena);
twl3025_tsp_write(BULON | BULENA);

View File

@ -101,7 +101,9 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
/* uplink is three TS after downlink ( "+ 32" gives a TA of 1) */
uint16_t offset = (L1_BURST_LENGTH_Q * 3) + 28;
/* FIXME: window open for TRF6151 and RFFE */
/* window open for TRF6151 and RFFE */
rffe_mode(gsm_arfcn2band(arfcn), 1);
trf6151_tx_window(offset, arfcn);
/* Window open for ABB */
twl3025_uplink(1, offset);
@ -109,7 +111,8 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
/* Window close for ABB */
twl3025_uplink(0, tx_burst_duration[wtype] + offset + 2); // TODO: "+ 2"
/* FIXME: window close for TRF6151 and RFFE */
/* window close for TRF6151 and RFFE */
trf6151_set_mode(TRF6151_IDLE);
}
void tpu_end_scenario(void)