From 5f446da36d410bd321bbeb0ee2290491216ba502 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 23 Feb 2010 01:25:09 +0100 Subject: TRF6151: Add new trf6151_tx_window() function This function takes care of starting a Tx (Uplink) window --- src/target/firmware/include/rf/trf6151.h | 2 ++ src/target/firmware/rf/trf6151.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/target/firmware/include/rf/trf6151.h b/src/target/firmware/include/rf/trf6151.h index ea821f5b..77855d06 100644 --- a/src/target/firmware/include/rf/trf6151.h +++ b/src/target/firmware/include/rf/trf6151.h @@ -33,4 +33,6 @@ void trf6151_tx_test(uint16_t arfcn); /* prepare a Rx window with the TRF6151 finished at time 'start' (in qbits) */ void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn, uint8_t vga_dbm, int rf_gain_high); +/* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */ +void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn); #endif /* TRF6151_H */ diff --git a/src/target/firmware/rf/trf6151.c b/src/target/firmware/rf/trf6151.c index a155947c..a95fa9a0 100644 --- a/src/target/firmware/rf/trf6151.c +++ b/src/target/firmware/rf/trf6151.c @@ -442,3 +442,18 @@ void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn, uint8_t vga_dbm, int /* FIXME: power down at the right time again */ } + +/* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */ +void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn) +{ + int16_t start_pll_qbits; + + /* power up at the right time _before_ the 'start_qbits' point in time */ + start_pll_qbits = add_mod5000(start_qbits, -(TRF6151_TX_PLL_DELAY + TRF6151_RX_TPU_DELAY)); + tpu_enq_at(start_pll_qbits); + + trf6151_set_arfcn(arfcn, 1); + trf6151_set_mode(TRF6151_TX); + + /* FIXME: power down at the right time again */ +} -- cgit v1.2.3