15template <
typename FunctionType>
17 std::is_invocable_v<FunctionType, void*, int32_t>;
23template <
typename FunctionType>
25 std::is_invocable_v<FunctionType, volatile void*, int32_t>;
32template <
typename FunctionType>
36 function(addr, dsize);
39template <
typename FunctionType>
40requires(!DCacheFunctionAcceptsVoidPtr<FunctionType> &&
41 DCacheFunctionAcceptsVolatileVoidPtr<FunctionType>)
44 function(
reinterpret_cast<volatile void*
>(addr), dsize);
47template <
typename FunctionType>
48requires(!DCacheFunctionAcceptsVoidPtr<FunctionType> &&
49 !DCacheFunctionAcceptsVolatileVoidPtr<FunctionType>)
52 function(
reinterpret_cast<uint32_t*
>(addr), dsize);
61#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
62 auto* raw =
const_cast<void*
>(addr);
63 const auto dsize =
static_cast<int32_t
>(size);
77#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
78 auto* raw =
const_cast<void*
>(addr);
79 const auto dsize =
static_cast<int32_t
>(size);
D-Cache API accepts void*
D-Cache API accepts volatile void*
void STM32_InvalidateDCacheByAddr(const void *addr, size_t size)
Invalidates D-Cache lines covering the specified memory range.
void STM32_CallDCacheByAddr(FunctionType function, void *addr, int32_t dsize)
Calls the CMSIS D-Cache helper with the pointer type accepted by the current toolchain.
void STM32_CleanDCacheByAddr(const void *addr, size_t size)
Cleans D-Cache lines covering the specified memory range.