ptt-fhss
Bare-metal PTT firmware for nRF52840 with FHSS
Loading...
Searching...
No Matches
Functions
power.h File Reference

Power management: DC/DC regulator, GPIOTE wakeup, WFI sleep. More...

#include <stdbool.h>

Go to the source code of this file.

Functions

void power_init (void)
 Enable the DC/DC converter, configure GPIO input and GPIOTE wakeup on the PTT button.
 
void power_sleep_until_button (void)
 Enter SYSTEM_ON low-power sleep and return on the next GPIOTE event.
 
bool power_button_pressed (void)
 Return the current state of the PTT button.
 

Detailed Description

Power management: DC/DC regulator, GPIOTE wakeup, WFI sleep.

Function Documentation

◆ power_button_pressed()

bool power_button_pressed ( void  )

Return the current state of the PTT button.

Returns
true when the button is pressed.

◆ power_init()

void power_init ( void  )

Enable the DC/DC converter, configure GPIO input and GPIOTE wakeup on the PTT button.

◆ power_sleep_until_button()

void power_sleep_until_button ( void  )

Enter SYSTEM_ON low-power sleep and return on the next GPIOTE event.

Sets TASKS_LOWPWR then executes WFI. The CPU wakes when the GPIOTE interrupt fires (button press) and resumes from here.