summaryrefslogtreecommitdiff
path: root/software/hhd70dongle/spi.c
diff options
context:
space:
mode:
authorBernhard Tittelbach <xro@realraum.at>2012-05-19 20:12:42 +0000
committerBernhard Tittelbach <xro@realraum.at>2012-05-19 20:12:42 +0000
commita72fc32daf434dc7ad59e4065c18332ddd7f67b0 (patch)
treed6189b31a46fc68f1ff52f2bb75c82867ff428e2 /software/hhd70dongle/spi.c
parentenable/disable PA and LNA (diff)
first attempt at RX/TX w/ 2 dongles
git-svn-id: https://svn.spreadspace.org/mur.sat@440 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/hhd70dongle/spi.c')
-rw-r--r--software/hhd70dongle/spi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/software/hhd70dongle/spi.c b/software/hhd70dongle/spi.c
index 426684a..ec0397b 100644
--- a/software/hhd70dongle/spi.c
+++ b/software/hhd70dongle/spi.c
@@ -37,7 +37,7 @@ void spi_init(void)
{
//configure Direction of SS / PB0 , MOSI and SCLK as Output to drive CS of CC1101
SPI_PORT = (1<<CS);
- SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS);
+ SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<RE)|(1<<TE);
SPCR = (1<<SPE)|(1<<MSTR); // | (0<<DORD) //select MSB first: DORD == 0
// SPSR = (0<<SPI2X) // f_osc/4
// SPSR = (1<<SPI2X) // f_osc/2
@@ -107,4 +107,9 @@ void hhd70_lna_enable(void)
void hhd70_lna_disable(void)
{
SPI_PORT &= ~(1<<RE);
+}
+
+int8_t hhd70_rx_data_available(void)
+{
+ return SPI_PINB_REG & (1 << GDO2);
} \ No newline at end of file