summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/c1101lib.c
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-06-22 02:19:00 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-06-22 02:19:00 +0000
commit722202c477817732716c29f00b37f754b7abf3a6 (patch)
treeb2ba8384a2ea9a13266a55fe4aba0107ff400fdf /software/hhd70dongle/c1101lib.c
parentmoved cmd flags to own byte (diff)
rx detect works, still receiving mostly noise
git-svn-id: https://svn.spreadspace.org/mur.sat@550 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/c1101lib.c')
-rw-r--r--software/hhd70dongle/c1101lib.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c
index b0eed03..690d148 100644
--- a/software/hhd70dongle/c1101lib.c
+++ b/software/hhd70dongle/c1101lib.c
@@ -226,10 +226,11 @@ void c1101_init(void)
//enable analog temperature sensor on GDO0
c1101_spi_write_register(SPIC1101_ADDR_IOCFG0, 0x80);
//enable RX FIFO interrupt (i.e. GPO2 pulls high if >= FIFOTHR bytes are in RX FIFO)
- c1101_spi_write_register(SPIC1101_ADDR_IOCFG2, 0);
+ c1101_spi_write_register(SPIC1101_ADDR_IOCFG2, 0x41 ); //0x40, 0x42, 0x44, 0x47
// FIFOTHR RX FIFO and TX FIFO Thresholds
// pull GPO high (interrupt) if more than 12 bytes in rx buffer (or less than 53 in tx)
- c1101_spi_write_register(SPIC1101_ADDR_FIFOTHR, 2);
+ //c1101_spi_write_register(SPIC1101_ADDR_FIFOTHR, 2); //assert at 12 bytes in RX Fifo and 53 in TX Fifo
+ c1101_spi_write_register(SPIC1101_ADDR_FIFOTHR, 0); //assert at 4 bytes in RX Fifo and 61 in TX Fifo
// PKTCTRL0 Packet Automation Control
//c1101_spi_write_register(SPIC1101_ADDR_PKTCTRL0, 0b0000000010); //crc disabled; use FIFOs; infinite packet length mode
c1101_spi_write_register(SPIC1101_ADDR_PKTCTRL0, 0b0000000001); //crc disabled; use FIFOs; variable packet length mode (first TX FIFO byte must be length)
@@ -263,6 +264,9 @@ void c1101_init(void)
c1101_spi_write_register(SPIC1101_ADDR_FSCAL2, 0x2A);
c1101_spi_write_register(SPIC1101_ADDR_FSCAL1, 0x00);
c1101_spi_write_register(SPIC1101_ADDR_FSCAL0, 0x1F);
+ //FREN0 TX Power:
+ c1101_spi_write_register(SPIC1101_ADDR_FREND0, 0x10); //should be set using RF-Studio !!, for now, only use PA-Table Entry[0] no power ramping !! (FIXME: but should maybe be used)
+ c1101_spi_write_register(SPIC1101_ADDR_PATABLE_WRITE, 0xC0); //write PATABLE[0] only, rest needs to be written in Burst-Mode ! set to max power 10dBm
// note: for now: assume f_xosc to be 26 Mhz
// for ~433.125 Mhz -> freq = 1091741, freq_offset = 0
@@ -335,13 +339,6 @@ char c1101_getStatus(void)
hhd70_c1101_wait_chip_rdy();
sb = c1101_spi_write_byte_ok_get_status(SPIC1101_ADDR_SNOP);
hhd70_spi_cs_disable();
- //debug start
- char debug_sb[6];
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"c1101 status:\r\n");
- debug_sprint_int16hex(debug_sb, sb);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,debug_sb);
- CDC_Device_SendString(&VirtualSerial_CDC_Interface,"\r\n");
- //debug end
c1101_handleStatusByte(sb);
return sb;
}