From 8719e33f5e210380c2df60ab02c129d152609b57 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Mon, 7 Jan 2019 23:18:56 +0100 Subject: [PATCH] Add cc1101_enter_wake_on_radio() To Be Tested --- extdrv/cc1101.c | 11 +++++++++++ include/extdrv/cc1101.h | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/extdrv/cc1101.c b/extdrv/cc1101.c index 6ed1831..9b275cd 100644 --- a/extdrv/cc1101.c +++ b/extdrv/cc1101.c @@ -437,6 +437,17 @@ void cc1101_power_down(void) cc1101_send_cmd(CC1101_CMD(state_power_down)); } +/* Enter Wake on Radio (WOR) mode + * Wake on Radio mode will be exited upon radio activity or by setting the + * chip select pin low (any access to the CC1101 will do so) + */ +void cc1101_enter_wake_on_radio(void) +{ + cc1101_send_cmd(CC1101_CMD(state_idle)); + msleep(1); + cc1101_send_cmd(CC1101_CMD(state_wake_on_radio)); +} + /* Change a configuration byte. * This function places the CC1101 chip in idle state. */ diff --git a/include/extdrv/cc1101.h b/include/extdrv/cc1101.h index b9fd283..b366f9a 100644 --- a/include/extdrv/cc1101.h +++ b/include/extdrv/cc1101.h @@ -274,6 +274,12 @@ void cc1101_set_channel(uint8_t chan); */ void cc1101_power_down(void); +/* Enter Wake on Radio (WOR) mode + * Wake on Radio mode will be exited upon radio activity or by setting the + * chip select pin low (any access to the CC1101 will do so) + */ +void cc1101_enter_wake_on_radio(void); + /* Change a configuration byte. * This function places the CC1101 chip in idle state. */ -- 2.43.0