[riot-notifications] [RIOT-OS/RIOT] cpu/stm32: make backup SRAM available (#16870)

benpicco notifications at github.com
Thu Sep 23 14:38:31 CEST 2021


@benpicco commented on this pull request.



> +void backup_ram_init(void)
+{
+    /* see reference manual 4.1.5 "Battery backup domain" */
+    periph_clk_en(APB1, RCC_APB1ENR_PWREN);
+    stmclk_dbp_unlock();
+    periph_clk_en(AHB1, RCC_AHB1ENR_BKPSRAMEN);
+}
+
+bool backup_ram_regulator_is_on(void)
+{
+    stmclk_dbp_unlock();
+    return (PWR_BRE_REG & BKPRAM_CONFIG) == BKPRAM_CONFIG;
+}
+
+void backup_ram_regulator_on(void)
+{

We probably want a 

```C
   if (!IS_USED(MODULE_PERIPH_BACKUP_RAM)) {
        return;
    }
```

here so we don't increase standby current if backup ram is *not* used

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16870#pullrequestreview-761958763
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210923/b2484e6a/attachment.htm>


More information about the notifications mailing list