add Chapter11

This commit is contained in:
Amar Mahmutbegovic
2024-09-22 16:52:43 +02:00
parent 7203d7ab66
commit f10d0ef610
205 changed files with 302793 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include <cstdint>
#include <stm32f0xx_hal.h>
namespace hal
{
inline void init()
{
HAL_Init();
}
inline std::uint32_t get_pc()
{
std::uint32_t pc;
__asm volatile ("mov %0, pc" : "=r" (pc) );
return pc;
}
struct time
{
static std::uint32_t get_ms()
{
return HAL_GetTick();
}
static void delay_ms(uint32_t delay)
{
HAL_Delay(delay);
}
};
}; // namespace hal