distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
STM32F4-FLASH.hpp
Go to the documentation of this file.
1 
12 #ifndef SOURCE_CHIP_STM32_STM32F4_INCLUDE_DISTORTOS_CHIP_STM32F4_FLASH_HPP_
13 #define SOURCE_CHIP_STM32_STM32F4_INCLUDE_DISTORTOS_CHIP_STM32F4_FLASH_HPP_
14 
16 
17 #include <cstdint>
18 
19 namespace distortos
20 {
21 
22 namespace chip
23 {
24 
25 /*---------------------------------------------------------------------------------------------------------------------+
26 | global constants
27 +---------------------------------------------------------------------------------------------------------------------*/
28 
30 #if defined(DISTORTOS_CHIP_STM32F405) || defined(DISTORTOS_CHIP_STM32F407) || defined(DISTORTOS_CHIP_STM32F415) || \
31  defined(DISTORTOS_CHIP_STM32F417)
32 constexpr uint8_t maxFlashLatency {7};
33 #else
34 constexpr uint8_t maxFlashLatency {15};
35 #endif
36 
37 /*---------------------------------------------------------------------------------------------------------------------+
38 | global functions' declarations
39 +---------------------------------------------------------------------------------------------------------------------*/
40 
50 int configureFlashLatency(uint8_t latency);
51 
58 void configureInstructionPrefetch(bool enable);
59 
64 void disableDataCache();
65 
71 
78 void enableDataCache();
79 
87 
88 } // namespace chip
89 
90 } // namespace distortos
91 
92 #endif // SOURCE_CHIP_STM32_STM32F4_INCLUDE_DISTORTOS_CHIP_STM32F4_FLASH_HPP_
void disableDataCache()
Disables data cache.
Definition: STM32F4-FLASH.cpp:43
constexpr uint8_t maxFlashLatency
maximum allowed value of flash latency
Definition: STM32F4-FLASH.hpp:32
void configureInstructionPrefetch(bool enable)
Configures instruction prefetch.
Definition: STM32F4-FLASH.cpp:38
int configureFlashLatency(uint8_t latency)
Configures flash latency.
Definition: STM32F4-FLASH.cpp:29
distortos configuration
Top-level namespace of distortos project.
Definition: buttons.hpp:33
void enableDataCache()
Enables data cache.
Definition: STM32F4-FLASH.cpp:53
void enableInstructionCache()
Enables instruction cache.
Definition: STM32F4-FLASH.cpp:61
void disableInstructionCache()
Disables instruction cache.
Definition: STM32F4-FLASH.cpp:48