File tree Expand file tree Collapse file tree
ref_app/src/mcal/r7fa4m1ab Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66//
77
88#include < mcal_cpu.h>
9- #include < mcal_gpt.h>
109#include < mcal_osc.h>
1110#include < mcal_port.h>
11+ #include < mcal_reg.h>
1212#include < mcal_wdg.h>
1313
1414auto mcal::cpu::post_init () noexcept -> void
@@ -17,6 +17,12 @@ auto mcal::cpu::post_init() noexcept -> void
1717
1818auto mcal::cpu::init () -> void
1919{
20+ // Initialize the fpu: Enable cp10 and cp11.
21+ mcal::reg::reg_access_static<std::uint32_t ,
22+ std::uint32_t ,
23+ mcal::reg::scb_cpacr,
24+ static_cast <std::uint32_t >(UINT32_C (0x00F00000 ))>::reg_or ();
25+
2026 mcal::wdg::init (nullptr );
2127 mcal::port::init (nullptr );
2228 mcal::osc::init (nullptr );
Original file line number Diff line number Diff line change 1414 {
1515 namespace reg
1616 {
17- // Register bases.
17+ // Global base addresses.
18+ constexpr std::uint32_t scs_base { UINT32_C (0xE000E000 ) };
19+
20+ // Individual unit base addresses.
21+ constexpr std::uint32_t scb_base { scs_base + UINT32_C (0x00000D00 ) };
1822 constexpr std::uint32_t system_base { UINT32_C (0x4001E000 ) };
1923 constexpr std::uint32_t unknown_hococr2 { UINT32_C (0x4001E037 ) };
2024 constexpr std::uint32_t pfs_base { UINT32_C (0x40040800 ) };
2125 constexpr std::uint32_t pmisc_base { UINT32_C (0x40040D00 ) };
2226
23- // System registers.
27+ // Core system registers.
28+ constexpr std::uint32_t scb_cpacr { scb_base + UINT32_C (0x00000088 ) };
29+
30+ static_assert (scb_cpacr == UINT32_C(0xE000ED88 ), " Error: wrong scb_cpacr register address)" );
31+
32+ // System (system struct) registers.
2433 constexpr std::uint32_t system_sckdivcr { system_base + UINT32_C (0x00000020 ) };
2534 constexpr std::uint32_t system_sckscr { system_base + UINT32_C (0x00000026 ) };
2635 constexpr std::uint32_t system_memwait { system_base + UINT32_C (0x00000031 ) };
You can’t perform that action at this time.
0 commit comments