blob: 1c441d6d5a031b56a7e3f2d8262dcfaa44f1ea59 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#include "lpc_handler.hpp"
2
3#include <cstdint>
Patrick Venture8c535332018-11-08 15:58:00 -08004#include <cstring>
Patrick Venture1cde5f92018-11-07 08:26:47 -08005#include <vector>
6
7namespace blobs
8{
9
Patrick Venture0d2a8132018-11-09 11:34:21 -080010bool 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 Venture0fbabf22018-11-09 11:54:12 -080018bool LpcDataHandler::close()
19{
20 /* TODO: implement ioctl call to close window. */
21 return false;
22}
23
Patrick Venture1cde5f92018-11-07 08:26:47 -080024std::vector<std::uint8_t> LpcDataHandler::copyFrom(std::uint32_t length)
25{
26 /* TODO: implement this. */
27 return {};
28}
29
Patrick Venture8c535332018-11-08 15:58:00 -080030bool 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
47std::vector<std::uint8_t> LpcDataHandler::read()
48{
49 return {};
50}
51
Patrick Venture1cde5f92018-11-07 08:26:47 -080052} // namespace blobs