diff options
Diffstat (limited to 'software/hhd70dongle/c1101lib.c')
-rw-r--r-- | software/hhd70dongle/c1101lib.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c index 690d148..b7ea1c7 100644 --- a/software/hhd70dongle/c1101lib.c +++ b/software/hhd70dongle/c1101lib.c @@ -213,6 +213,12 @@ int c1101_spi_write_txfifo(char *buffer, int len) /**** External Functions ****/ +uint16_t c1101_setFSKDeviationFromCarrier(int8_t m, int8_t e) +{ + c1101_spi_write_register(SPIC1101_ADDR_DEVIATN, (m & 0x7) | ((e & 0x7) << 4)); + return (1983u * (8u+((uint32_t)m)) * (1u << ((uint32_t)e))) / 100; //return +- deviation in 10Hz Steps +} + void c1101_init(void) { //reset C1101 @@ -251,7 +257,7 @@ void c1101_init(void) 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); + c1101_spi_write_register(SPIC1101_ADDR_DEVIATN, 0x11); //0x11 equals deviation of 3.5kHz; 0x27 equals deviation of 11.9kHz // MCSM0 Main Radio Control State Machine Configuration c1101_spi_write_register(SPIC1101_ADDR_MCSM0, 0x18); c1101_spi_write_register(SPIC1101_ADDR_MCSM1, 0b00111100); // State RX after recieving packet-> stay in RX; State TX after sending packet -> IDLE |