summaryrefslogtreecommitdiff
path: root/software/avr.lib
diff options
context:
space:
mode:
Diffstat (limited to 'software/avr.lib')
-rw-r--r--software/avr.lib/cc1101.c7
-rw-r--r--software/avr.lib/cc1101.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/software/avr.lib/cc1101.c b/software/avr.lib/cc1101.c
index 9053417..833adff 100644
--- a/software/avr.lib/cc1101.c
+++ b/software/avr.lib/cc1101.c
@@ -99,6 +99,7 @@ static void cc1101_spi_write_register(uint8_t addr, uint8_t data)
void cc1101_init(cc1101_driver_conf_t conf)
{
drv = conf;
+ cc1101_soft_reset();
}
void cc1101_reg_init(void)
@@ -111,11 +112,17 @@ void cc1101_soft_reset(void)
cc1101_spi_strobe_command(CC1101_CMD_SRES);
}
+
void cc1101_powerdown(void)
{
cc1101_spi_strobe_command(CC1101_CMD_SPWD);
}
+void cc1101_idle(void)
+{
+ cc1101_spi_strobe_command(CC1101_CMD_SIDLE);
+}
+
void cc1101_set_freq_hz(uint32_t hz)
{
uint32_t freq = (uint32_t)((float)hz / drv.freq_corr);
diff --git a/software/avr.lib/cc1101.h b/software/avr.lib/cc1101.h
index 2ac92bb..6e9e657 100644
--- a/software/avr.lib/cc1101.h
+++ b/software/avr.lib/cc1101.h
@@ -38,7 +38,9 @@ typedef struct {
void cc1101_init(cc1101_driver_conf_t conf);
void cc1101_reg_init(void);
void cc1101_soft_reset(void);
+
void cc1101_powerdown(void);
+void cc1101_idle(void);
void cc1101_set_freq_hz(uint32_t hz);
uint32_t cc1101_get_freq_hz(void);