diff options
Diffstat (limited to 'software/hhd70dongle/spi.c')
-rw-r--r-- | software/hhd70dongle/spi.c | 32 |
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 |