diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2013-01-16 23:02:29 +0100 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2014-06-15 19:30:52 +0200 |
commit | b8e53aa772874b787f5cbe020351a46dac2d97fe (patch) | |
tree | 5b189d1671844674d2fc659027c32cbdf94d6bc2 | |
parent | e8b46e15e5b42ab2d5e362c45438bf1900d6819d (diff) |
fw/l1: Add 'TRX' internal interface
This is a generic interface to submit and retrieve bursts to be
transmitted. By default it has a dummy implementation that does
nothing and it's up to the 'application' to provide a correct
implementation.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | src/target/firmware/include/layer1/trx.h | 45 | ||||
-rw-r--r-- | src/target/firmware/layer1/Makefile | 5 | ||||
-rw-r--r-- | src/target/firmware/layer1/trx_dummy.c | 42 |
3 files changed, 90 insertions, 2 deletions
diff --git a/src/target/firmware/include/layer1/trx.h b/src/target/firmware/include/layer1/trx.h new file mode 100644 index 00000000..83c7a71f --- /dev/null +++ b/src/target/firmware/include/layer1/trx.h @@ -0,0 +1,45 @@ +/* TRX interface for BTS primitive of Layer 1 */ + +/* (C) 2012 by Sylvain Munaut <tnt@246tNt.com> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef __L1_TRX_H__ +#define __L1_TRX_H__ + + +#include <stdint.h> + + +/* Burst types */ +#define BURST_FB 0 +#define BURST_SB 1 +#define BURST_DUMMY 2 +#define BURST_NB 3 +#define BURST_AB 4 + +/* Init */ +void trx_init(void); + +/* Interface to retrieve / submit bursts */ +extern int trx_get_burst(uint32_t fn, uint8_t tn, uint8_t *data); +extern int trx_put_burst(uint32_t fn, uint8_t tn, uint8_t type, uint8_t *data); + + +#endif /* __L1_TRX_H__ */ diff --git a/src/target/firmware/layer1/Makefile b/src/target/firmware/layer1/Makefile index 0c710a5d..8e655b67 100644 --- a/src/target/firmware/layer1/Makefile +++ b/src/target/firmware/layer1/Makefile @@ -2,8 +2,9 @@ LIBRARIES+=layer1 LIB_layer1_DIR=layer1 LIB_layer1_SRCS=avg.c agc.c afc.c toa.c sync.c tdma_sched.c tpu_window.c init.c \ - l23_api.c mframe_sched.c sched_gsmtime.c async.c rfch.c apc.c + l23_api.c mframe_sched.c sched_gsmtime.c async.c rfch.c apc.c \ + trx_dummy.c LIB_layer1_SRCS += prim_pm.c prim_rach.c prim_tx_nb.c prim_rx_nb.c prim_fbsb.c \ - prim_freq.c prim_utils.c prim_tch.c + prim_freq.c prim_utils.c prim_tch.c prim_bts.c diff --git a/src/target/firmware/layer1/trx_dummy.c b/src/target/firmware/layer1/trx_dummy.c new file mode 100644 index 00000000..44ca4f17 --- /dev/null +++ b/src/target/firmware/layer1/trx_dummy.c @@ -0,0 +1,42 @@ +/* Dummy TRX interface for BTS primitive of Layer 1 */ + +/* Note: In theory, it's the APP responsability to provide an + * implementation. Here we have weak dummy funcs in case the app + * doesn't require a functional BTS mode + */ + +/* (C) 2012 by Sylvain Munaut <tnt@246tNt.com> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include <stdint.h> + +#include <layer1/trx.h> + +int __attribute__((weak)) +trx_get_burst(uint32_t fn, uint8_t tn, uint8_t *data) +{ + return 0; +} + +int __attribute__((weak)) +trx_put_burst(uint32_t fn, uint8_t tn, uint8_t type, uint8_t *data) +{ + return 0; +} |