Merge pull request #1257 from bkozak-scanimetrics/cc26xx_fully_turnoff_radio

CC26xx - fully shutdown the rf-core & abort rx op
This commit is contained in:
George Oikonomou 2015-11-04 15:45:05 +00:00
commit 3aa4547327
4 changed files with 29 additions and 1 deletions

View file

@ -1101,6 +1101,8 @@ off(void)
while(transmitting());
/* stopping the rx explicitly results in lower sleep-mode power usage */
rx_off();
rf_core_power_down();
/* Switch HF clock source to the RCOSC to preserve power */

View file

@ -968,6 +968,7 @@ off(void)
return RF_CORE_CMD_OK;
}
rx_off_prop();
rf_core_power_down();
/* Switch HF clock source to the RCOSC to preserve power */

View file

@ -201,6 +201,28 @@ rf_core_wait_cmd_done(void *cmd)
== RF_CORE_RADIO_OP_STATUS_DONE_OK;
}
/*---------------------------------------------------------------------------*/
static int
fs_powerdown(void)
{
rfc_CMD_FS_POWERDOWN_t cmd;
uint32_t cmd_status;
rf_core_init_radio_op((rfc_radioOp_t *)&cmd, sizeof(cmd), CMD_FS_POWERDOWN);
if(rf_core_send_cmd((uint32_t)&cmd, &cmd_status) != RF_CORE_CMD_OK) {
PRINTF("fs_powerdown: CMDSTA=0x%08lx\n", cmd_status);
return RF_CORE_CMD_ERROR;
}
if(rf_core_wait_cmd_done(&cmd) != RF_CORE_CMD_OK) {
PRINTF("fs_powerdown: CMDSTA=0x%08lx, status=0x%04x\n",
cmd_status, cmd.status);
return RF_CORE_CMD_ERROR;
}
return RF_CORE_CMD_OK;
}
/*---------------------------------------------------------------------------*/
int
rf_core_power_up()
{
@ -256,6 +278,9 @@ rf_core_power_down()
if(rf_core_is_accessible()) {
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIEN) = 0x0;
/* need to send FS_POWERDOWN or analog components will use power */
fs_powerdown();
}
/* Shut down the RFCORE clock domain in the MCU VD */

View file

@ -98,7 +98,7 @@
#define CONTIKIMAC_CONF_LISTEN_TIME_AFTER_PACKET_DETECTED (RTIMER_ARCH_SECOND / 20)
#define CONTIKIMAC_CONF_SEND_SW_ACK 1
#define CONTIKIMAC_CONF_AFTER_ACK_DETECTECT_WAIT_TIME (RTIMER_SECOND / 1000)
#define CONTIKIMAC_CONF_INTER_PACKET_INTERVAL (RTIMER_SECOND / 280)
#define CONTIKIMAC_CONF_INTER_PACKET_INTERVAL (RTIMER_SECOND / 250)
#else
#define NETSTACK_CONF_RADIO ieee_mode_driver