summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte2010-02-21 11:28:21 +0100
committerHarald Welte2010-03-01 23:48:44 +0100
commit81cd75e38c04268befe128fe5f7c1b19553261ec (patch)
tree484fb050c18dd2f787c52eecc5655cbc758d27e0 /src
parentlayer1/tpu_window.c support for Uplink/Tx (diff)
downloadosmocom-81cd75e38c04268befe128fe5f7c1b19553261ec.tar.gz
osmocom-81cd75e38c04268befe128fe5f7c1b19553261ec.tar.xz
osmocom-81cd75e38c04268befe128fe5f7c1b19553261ec.zip
move macros to where they belong
Diffstat (limited to 'src')
-rw-r--r--src/target/firmware/calypso/dsp.c11
-rw-r--r--src/target/firmware/include/abb/twl3025.h3
-rw-r--r--src/target/firmware/include/calypso/dsp_api.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c
index f135a8b..b857f7e 100644
--- a/src/target/firmware/calypso/dsp.c
+++ b/src/target/firmware/calypso/dsp.c
@@ -197,15 +197,6 @@ void dsp_api_memset(uint16_t *ptr, int octets)
*ptr++ = 0;
}
-/* How an ABB register + value is expressed in the API RAM */
-#define ABB_VAL(reg, val) ( (((reg) & 0x1F) << 1) | (((val) & 0x3FF) << 6) )
-
-/* How an ABB register + value | TRUE is expressed in the API RAM */
-#define ABB_VAL_T(reg, val) (ABB_VAL(reg, val) | 1)
-
-/* How a RAMP value is encoded */
-#define RAMP_VAL(up, down) ( ((down & 0x1F) << 5) | (up & 0x1F) )
-
static void dsp_ndb_init(void)
{
T_NDB_MCU_DSP *ndb = dsp_api.ndb;
@@ -217,7 +208,7 @@ static void dsp_ndb_init(void)
/* load APC ramp: set to "no ramp" so that there will be no output if
* not properly initialised at some other place. */
for (i = 0; i < 16; i++)
- dsp_api.ndb->a_ramp[i] = ABB_VAL(APCRAM, RAMP_VAL(0, 0));
+ dsp_api.ndb->a_ramp[i] = ABB_VAL(APCRAM, ABB_RAMP_VAL(0, 0));
/* Iota registers values will be programmed at 1st DSP communication interrupt */
diff --git a/src/target/firmware/include/abb/twl3025.h b/src/target/firmware/include/abb/twl3025.h
index d171db8..8ccbf19 100644
--- a/src/target/firmware/include/abb/twl3025.h
+++ b/src/target/firmware/include/abb/twl3025.h
@@ -79,6 +79,9 @@ enum togbr2_bits {
TOGBR2_IAPCPTR = (1 << 6), /* Initialize pointer of APC RAM */
};
+/* How a RAMP value is encoded */
+#define ABB_RAMP_VAL(up, down) ( ((down & 0x1F) << 5) | (up & 0x1F) )
+
enum twl3025_unit {
TWL3025_UNIT_AFC,
TWL3025_UNIT_MAD,
diff --git a/src/target/firmware/include/calypso/dsp_api.h b/src/target/firmware/include/calypso/dsp_api.h
index 5444ec1..f9751f3 100644
--- a/src/target/firmware/include/calypso/dsp_api.h
+++ b/src/target/firmware/include/calypso/dsp_api.h
@@ -1551,4 +1551,10 @@ enum dsp_error {
DSP_ERR_STACK_OV = 0x0800,
};
+/* How an ABB register + value is expressed in the API RAM */
+#define ABB_VAL(reg, val) ( (((reg) & 0x1F) << 1) | (((val) & 0x3FF) << 6) )
+
+/* How an ABB register + value | TRUE is expressed in the API RAM */
+#define ABB_VAL_T(reg, val) (ABB_VAL(reg, val) | 1)
+
#endif /* _CAL_DSP_API_H */