diff options
Diffstat (limited to 'software/hhd70dongle/hhd70.c')
-rw-r--r-- | software/hhd70dongle/hhd70.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/software/hhd70dongle/hhd70.c b/software/hhd70dongle/hhd70.c index 9b79797..0abe61d 100644 --- a/software/hhd70dongle/hhd70.c +++ b/software/hhd70dongle/hhd70.c @@ -36,8 +36,8 @@ void hhd70_init(void) { //configure Direction of SS / PB0 , MOSI and SCLK as Output to drive CS of CC1101 - SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<RE)|(1<<TE); - SPI_PORT = (1<<CS) | (1<<RE) | (1<<TE) | (1<<GDO2); + SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<TE)|(1<<BIAS_PWM); + SPI_PORT = (1<<CS) | (1<<GDO2) | (1<<BIAS_PWM); SPCR = (1<<SPE)|(1<<MSTR); // | (0<<DORD) //select MSB first: DORD == 0 // SPSR = (0<<SPI2X) // f_osc/4 // SPSR = (1<<SPI2X) // f_osc/2 @@ -90,23 +90,21 @@ char hhd70_spi_read_byte(void) void hhd70_palna_txmode(void) { - SPI_PORT |= (1<<RE); - SPI_PORT &= ~(1<<TE); + SPI_PORT |= (1<<TE); } void hhd70_palna_rxmode(void) { - SPI_PORT |= (1<<TE); - SPI_PORT &= ~(1<<RE); + SPI_PORT &= ~(1<<TE); } void hhd70_palna_off(void) { - SPI_PORT |= (1<<RE) | (1<<TE); + SPI_PORT |= (1<<TE); } int8_t hhd70_rx_data_available(void) { //check if GDO2 pin has been pulled low by c1101 return (SPI_PINB_REG & (1 << GDO2)) == 0; -}
\ No newline at end of file +} |