blob: 91b70629401434e1fd8775b0db764075b1860112 [file] [log] [blame]
Patrick Venturee7728422018-11-14 20:16:33 -08001#pragma once
2
Patrick Venture8b588562018-11-18 08:44:33 -08003#include "internal/sys.hpp"
Patrick Venture5251da92019-01-17 11:25:26 -08004#include "window_hw_interface.hpp"
Patrick Venturee7728422018-11-14 20:16:33 -08005
Patrick Venture92973f12018-11-16 21:00:44 -08006#include <memory>
Patrick Venture517710d2019-01-17 11:37:40 -08007#include <vector>
Patrick Venture92973f12018-11-16 21:00:44 -08008
Patrick Venturee7728422018-11-14 20:16:33 -08009namespace blobs
10{
11
Patrick Venture5251da92019-01-17 11:25:26 -080012class LpcMapperNuvoton : public HardwareMapperInterface
Patrick Venturee7728422018-11-14 20:16:33 -080013{
14 public:
Patrick Venture5251da92019-01-17 11:25:26 -080015 static std::unique_ptr<HardwareMapperInterface> createNuvotonMapper();
Patrick Venturee7728422018-11-14 20:16:33 -080016
Patrick Venture8b588562018-11-18 08:44:33 -080017 /**
18 * Create an LpcMapper for Nuvoton.
19 *
20 * @param[in] a sys call interface pointer.
21 * @todo Needs reserved memory region's physical address and size.
22 */
Patrick Venturefa9d0c92018-12-13 16:38:27 -080023 explicit LpcMapperNuvoton(const internal::Sys* sys = &internal::sys_impl) :
Patrick Venture8b588562018-11-18 08:44:33 -080024 sys(sys){};
Patrick Venturee7728422018-11-14 20:16:33 -080025
26 std::pair<std::uint32_t, std::uint32_t>
27 mapWindow(std::uint32_t address, std::uint32_t length) override;
Patrick Venture8b588562018-11-18 08:44:33 -080028
Patrick Venture517710d2019-01-17 11:37:40 -080029 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
30
Patrick Venture8b588562018-11-18 08:44:33 -080031 private:
Patrick Venturefa9d0c92018-12-13 16:38:27 -080032 const internal::Sys* sys;
Patrick Venturee7728422018-11-14 20:16:33 -080033};
34
35} // namespace blobs