summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-19 20:12:39 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-19 20:12:39 +0000
commit9424c395f643ec0aece488a26b6f4ef1e44affd6 (patch)
tree64ceed1b1463e07e3f80419c51dcad5b56286a47 /software
parentled on only during send (diff)
enable/disable PA and LNA
git-svn-id: https://svn.spreadspace.org/mur.sat@439 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software')
-rw-r--r--software/hhd70dongle/c1101lib.c8
-rw-r--r--software/hhd70dongle/spi.c32
-rw-r--r--software/hhd70dongle/spi.h17
3 files changed, 45 insertions, 12 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c
index 872c211..30bb94c 100644
--- a/software/hhd70dongle/c1101lib.c
+++ b/software/hhd70dongle/c1101lib.c
@@ -391,6 +391,10 @@ void c1101_transmitData(char *buffer, unsigned int len)
//~ debug_sprint_int16hex(debug_sb, num_written);
//~ usb_rawhid_send(debug_sb,255);
+ //enable Power Amplifier
+ hhd70_lna_disable();
+ hhd70_pa_enable();
+
//keep buffer filled
uint8_t c1101_state=0;
do
@@ -418,6 +422,10 @@ void c1101_transmitData(char *buffer, unsigned int len)
//~ debug_sprint_int16hex(debug_sb, c1101_getNumBytesInTXFifo());
//~ usb_rawhid_send(debug_sb,255);
} while (len > 0);
+
+ //disable Power Amplifier
+ hhd70_pa_disable();
+
}
//max returned: 64 bytes
diff --git a/software/hhd70dongle/spi.c b/software/hhd70dongle/spi.c
index 39d3cd8..426684a 100644
--- a/software/hhd70dongle/spi.c
+++ b/software/hhd70dongle/spi.c
@@ -33,18 +33,6 @@
#include "spi.h"
-#define SPI_DDR DDRB
-#define SPI_PORT PORTB
-#define SPI_PINB_REG PINB
-#define CS DDB0
-#define SCK DDB1
-#define MOSI DDB2
-#define MISO DDB3
-#define GDO2 DDB4
-#define GDO0 DDB5
-#define RE DDB6
-#define TE DDB7
-
void spi_init(void)
{
//configure Direction of SS / PB0 , MOSI and SCLK as Output to drive CS of CC1101
@@ -99,4 +87,24 @@ char spi_read_byte(void)
{
//transmit something so SCLK runs for 8 bits, so that slave can transfer 1 byte
return spi_exchange_byte(0);
+}
+
+void hhd70_pa_enable(void)
+{
+ SPI_PORT |= ~(1<<TE);
+}
+
+void hhd70_pa_disable(void)
+{
+ SPI_PORT &= ~(1<<TE);
+}
+
+void hhd70_lna_enable(void)
+{
+ SPI_PORT |= ~(1<<RE);
+}
+
+void hhd70_lna_disable(void)
+{
+ SPI_PORT &= ~(1<<RE);
} \ No newline at end of file
diff --git a/software/hhd70dongle/spi.h b/software/hhd70dongle/spi.h
index b4e163d..e13ca7f 100644
--- a/software/hhd70dongle/spi.h
+++ b/software/hhd70dongle/spi.h
@@ -33,6 +33,19 @@
#ifndef MURSAT_spi_h_INCLUDED
#define MURSAT_spi_h_INCLUDED
+#define SPI_DDR DDRB
+#define SPI_PORT PORTB
+#define SPI_PINB_REG PINB
+#define CS DDB0
+#define SCK DDB1
+#define MOSI DDB2
+#define MISO DDB3
+#define GDO2 DDB4
+#define GDO0 DDB5
+#define RE DDB6
+#define TE DDB7
+
+
void spi_init(void);
void spi_cs_enable(void);
void spi_cs_disable(void);
@@ -40,6 +53,10 @@ void spi_c1101_wait_chip_rdy(void);
void spi_write_byte(char byte);
char spi_read_byte(void);
char spi_exchange_byte(char byte);
+void hhd70_pa_enable(void);
+void hhd70_pa_disable(void);
+void hhd70_lna_enable(void);
+void hhd70_lna_disable(void);
//~ void spi_write(char* data,unsigned int len);
//~ void spi_read(unsigned int maxlen, char *data, unsigned int *len);