summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-20 04:15:28 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-20 04:15:28 +0000
commit39592c9cfe2544ae8cb2ca8c7b9e5cbcb23d1f42 (patch)
tree105a16aebf3cebd4929cb16cfc9f50d584782b4c
parentswitch from IDLE _and_ RX to TX (diff)
sync word and wait for TX to finish
git-svn-id: https://svn.spreadspace.org/mur.sat@457 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r--software/hhd70dongle/c1101lib.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c
index 7c309cd..d19f8d4 100644
--- a/software/hhd70dongle/c1101lib.c
+++ b/software/hhd70dongle/c1101lib.c
@@ -223,8 +223,11 @@ void c1101_init(void)
// MDMCFGn Modem Configuration
c1101_spi_write_register(SPIC1101_ADDR_MDMCFG4, 0xF8);
c1101_spi_write_register(SPIC1101_ADDR_MDMCFG3, 0x83);
- c1101_spi_write_register(SPIC1101_ADDR_MDMCFG2, 0x13);
+ c1101_spi_write_register(SPIC1101_ADDR_MDMCFG2, 0x12); //gfsk, 15/16 sync word
c1101_spi_write_register(SPIC1101_ADDR_MDMCFG1, 0x00);
+ //Sync Word
+ c1101_spi_write_register(SPIC1101_ADDR_SYNC1, 0x21);
+ c1101_spi_write_register(SPIC1101_ADDR_SYNC0, 0x42);
// DEVIATN Modem Deviation Setting
c1101_spi_write_register(SPIC1101_ADDR_DEVIATN, 0x07);
// MCSM0 Main Radio Control State Machine Configuration
@@ -416,6 +419,14 @@ void c1101_transmitData(char *buffer, unsigned int len)
} while (len > 0);
//disable Power Amplifier
+ //FIXME, instead use PTT function of GPO0 -> interrupt handler -> toggle rx/tx
+ //wait until RX finished
+ do
+ {
+ c1101_state = c1101_getMARCState();
+ _delay_ms(1);
+ }
+ while (c1101_state == 19 || c1101_state == 20);
hhd70_palna_rxmode();
}