summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/spi.c
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/hhd70dongle/spi.c
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/hhd70dongle/spi.c')
-rw-r--r--software/hhd70dongle/spi.c32
1 files changed, 20 insertions, 12 deletions
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