Add fault modes and start implementation of backup SRAM. However, this will probably never be used
This commit is contained in:
54
stm-firmware/stm-periph/backup-ram.c
Normal file
54
stm-firmware/stm-periph/backup-ram.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/* Reflow Oven Controller
|
||||
*
|
||||
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
|
||||
*
|
||||
* This file is part of the Reflow Oven Controller Project.
|
||||
*
|
||||
* The reflow oven controller is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the reflow oven controller project.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stm-periph/backup-ram.h>
|
||||
#include <stm-periph/clock-enable-manager.h>
|
||||
#include <stm32/stm32f4xx.h>
|
||||
|
||||
void backup_ram_init()
|
||||
{
|
||||
rcc_manager_enable_clock(&RCC->APB1ENR, BITMASK_TO_BITNO(RCC_APB1ENR_PWREN));
|
||||
|
||||
/* Enable access to backup RAM register set */
|
||||
PWR->CR |= PWR_CR_DBP;
|
||||
|
||||
/* Enable clock for backup ram interface */
|
||||
rcc_manager_enable_clock(&RCC->AHB1ENR, BITMASK_TO_BITNO(RCC_AHB1ENR_BKPSRAMEN));
|
||||
}
|
||||
|
||||
void backup_ram_disable()
|
||||
{
|
||||
rcc_manager_disable_clock(&RCC->APB1ENR, BITMASK_TO_BITNO(RCC_APB1ENR_PWREN));
|
||||
}
|
||||
|
||||
void backup_ram_wipe()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int backup_ram_get_data(uint32_t addr, uint32_t *data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int backup_ram_write_data(uint32_t addr, uint32_t data)
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user