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

Power management implementation. More...

#include "power.h"
#include "regs.h"
#include <nrf52840.h>
#include <cmsis_gcc.h>

Macros

#define BUTTON_PIN   2u
 
#define BUTTON_ACTIVE_LOW   1u
 

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.
 
void GPIOTE_IRQHandler (void)
 

Detailed Description

Power management implementation.

Macro Definition Documentation

◆ BUTTON_ACTIVE_LOW

#define BUTTON_ACTIVE_LOW   1u

◆ BUTTON_PIN

#define BUTTON_PIN   2u

Function Documentation

◆ GPIOTE_IRQHandler()

void GPIOTE_IRQHandler ( void  )

◆ 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.