blob: ba09d51d6a14f49344a11e270be35ed469aa08e9 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#pragma once
2
3#include "data_handler.hpp"
4
5#include <cstdint>
6#include <vector>
7
8namespace blobs
9{
10
Patrick Venture8c535332018-11-08 15:58:00 -080011/** P2A configuration response. */
12struct PciConfigResponse
13{
14 std::uint32_t address;
15} __attribute__((packed));
16
17/**
18 * Data handler for reading and writing data via the P2A bridge.
19 */
Patrick Venture1cde5f92018-11-07 08:26:47 -080020class PciDataHandler : public DataInterface
21{
Patrick Venture1cde5f92018-11-07 08:26:47 -080022 public:
23 PciDataHandler() = default;
24
Patrick Venture0d2a8132018-11-09 11:34:21 -080025 bool open() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080026 std::vector<std::uint8_t> copyFrom(std::uint32_t length) override;
Patrick Venture8c535332018-11-08 15:58:00 -080027 bool write(const std::vector<std::uint8_t>& configuration) override;
28 std::vector<std::uint8_t> read() override;
Patrick Venture1cde5f92018-11-07 08:26:47 -080029};
30
31} // namespace blobs