stm32/powerctrl: Support changing frequency on WB MCUs.

This allows changing the frequency to: 100kHz, 200kHz, 400kHz, 800kHz,
1MHz, 2MHz, 4MHz, 8MHz, 16MHz, 32MHz, 64MHz.  For frequencies 2MHz and
below, low power run (LPR) mode is enabled automatically.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2021-07-22 15:29:14 +10:00
parent 3b32b3d1b3
commit f834fef6bb
4 changed files with 100 additions and 5 deletions

View File

@@ -28,7 +28,7 @@
#include "irq.h"
#include "powerctrl.h"
static inline void powerctrl_config_systick(void) {
void powerctrl_config_systick(void) {
// Configure SYSTICK to run at 1kHz (1ms interval)
SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK;
SysTick_Config(HAL_RCC_GetHCLKFreq() / 1000);