diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-02-21 09:38:44 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-03-01 23:48:43 +0100 |
commit | 32da71ef5ccb01d1a6f91657661637ba2a451196 (patch) | |
tree | c2fb08a0e1e60c1fc6e89b0e74ce9c16e710f048 /src/target/firmware/abb | |
parent | cc2ae91e48473cfad4e51e7070b1f8c45e27a478 (diff) |
TWL3025: Add uplink enable/disable function
Diffstat (limited to 'src/target/firmware/abb')
-rw-r--r-- | src/target/firmware/abb/twl3025.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/target/firmware/abb/twl3025.c b/src/target/firmware/abb/twl3025.c index 2e88a3fd..b9c55696 100644 --- a/src/target/firmware/abb/twl3025.c +++ b/src/target/firmware/abb/twl3025.c @@ -188,6 +188,8 @@ void twl3025_clk13m(int enable) #define BDLCAL_DURATION 66 #define BDLON_TO_BDLENA 7 #define BULON_TO_BULENA 16 +#define BULON_TO_BULCAL 17 +#define BULCAL_DURATION 143 /* really that long? */ /* bdl_ena - TSP_DELAY - BDLCAL_DURATION - TSP_DELAY - BDLON_TO_BDLCAL - TSP_DELAY */ #define DOWNLINK_DELAY (3 * TSP_DELAY + BDLCAL_DURATION + BDLON_TO_BDLCAL) @@ -223,6 +225,30 @@ void twl3025_downlink(int on, int16_t at) } } +void twl3025_uplink(int on, int16_t at) +{ + int16_t bul_ena = at - TSP_DELAY - 6; + + if (bul_ena < 0) + printf("BULENA time negative (%d)\n", bul_ena); + if (on) { + /* FIXME: calibration should be done just before BULENA */ + twl3025_tsp_write(BULON); + tpu_enq_wait(BULON_TO_BULCAL - TSP_DELAY); + twl3025_tsp_write(BULON | BULCAL); + tpu_enq_wait(BULCAL_DURATION - TSP_DELAY); + twl3025_tsp_write(BULON); + tpu_enq_wait(35); /* minimum time required to bring the ramp up (really needed?) */ + tpu_enq_at(bul_ena); + twl3025_tsp_write(BULON | BULENA); + } else { + tpu_enq_at(bul_ena); + twl3025_tsp_write(BULON); + tpu_enq_wait(35); /* minimum time required to bring the ramp down (needed!) */ + twp3025_tsp_write(0); + } +} + void twl3025_afc_set(int16_t val) { printf("twl3025_afc_set(%d)\n", val); |