Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 1 | #include "lpc_handler.hpp" |
| 2 | |
| 3 | #include <cstdint> |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 4 | #include <cstring> |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 5 | #include <vector> |
| 6 | |
| 7 | namespace blobs |
| 8 | { |
| 9 | |
Patrick Venture | 0d2a813 | 2018-11-09 11:34:21 -0800 | [diff] [blame] | 10 | bool LpcDataHandler::open() |
| 11 | { |
| 12 | /* For the ASPEED LPC CTRL driver, the ioctl is required to set up the |
| 13 | * window, with information from write() below. |
| 14 | */ |
| 15 | return true; |
| 16 | } |
| 17 | |
Patrick Venture | 0fbabf2 | 2018-11-09 11:54:12 -0800 | [diff] [blame] | 18 | bool LpcDataHandler::close() |
| 19 | { |
| 20 | /* TODO: implement ioctl call to close window. */ |
| 21 | return false; |
| 22 | } |
| 23 | |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 24 | std::vector<std::uint8_t> LpcDataHandler::copyFrom(std::uint32_t length) |
| 25 | { |
| 26 | /* TODO: implement this. */ |
| 27 | return {}; |
| 28 | } |
| 29 | |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 30 | bool LpcDataHandler::write(const std::vector<std::uint8_t>& configuration) |
| 31 | { |
| 32 | struct LpcRegion lpcRequest; |
| 33 | |
| 34 | if (configuration.size() != sizeof(lpcRequest)) |
| 35 | { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | std::memcpy(&lpcRequest, configuration.data(), configuration.size()); |
| 40 | /* TODO: Implement the call to the driver or aspeed lpc ctrl library to send |
| 41 | * ioctl. |
| 42 | */ |
| 43 | |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | std::vector<std::uint8_t> LpcDataHandler::read() |
| 48 | { |
| 49 | return {}; |
| 50 | } |
| 51 | |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 52 | } // namespace blobs |