From: Nathael Pajani Date: Mon, 7 Jan 2019 22:18:56 +0000 (+0100) Subject: Add cc1101_enter_wake_on_radio() To Be Tested X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=8719e33f5e210380c2df60ab02c129d152609b57;p=soft%2Flpc122x%2Fcore Add cc1101_enter_wake_on_radio() To Be Tested --- 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. */