2024-01-24 14:38:15 +01:00

33 lines
762 B
C++

/*
* flash.hpp
*
* Created on: Jan 24, 2024
* Author: Lars Wilko Sentse
*/
#ifndef STA_CORE_FLASH_HPP
#define STA_CORE_FLASH_HPP
#include <limits>
// Only enable module on STM32 platform w/ HAL GPIO module enabled
#include <sta/config.hpp>
#ifdef STA_PLATFORM_STM32
# include <sta/devices/stm32/hal.hpp>
#endif // STA_PLATFORM_STM32
#include <sta/debug/debug.hpp>
namespace sta
{
class Flash{
public:
Flash() = delete;
static uint32_t flash_write_word(uint32_t address, uint32_t data, bool erase_sector);
static uint32_t flash_read_word(uint32_t address);
static uint32_t flash_erase_sectors(uint32_t sector, uint32_t num_sectors);
static uint32_t flash_get_sector(uint32_t address);
};
}//namespace sta
#endif //STA_CORE_FLASH_HPP