| #include "libhoth_spi.hpp" |
| |
| #include <fcntl.h> |
| #include <linux/spi/spidev.h> |
| #include <linux/types.h> |
| #include <stdbool.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <sys/ioctl.h> |
| #include <unistd.h> |
| |
| namespace google |
| { |
| namespace hoth |
| { |
| |
| int LibHothSpiDevImpl::open(const option* opt, device** dev) |
| { |
| return ::libhoth_spi_open(opt, dev); |
| } |
| |
| int LibHothSpiDevImpl::send(device* dev, const void* request, size_t size) |
| { |
| return dev->send(dev, request, size); |
| } |
| |
| int LibHothSpiDevImpl::recv(device* dev, void* response, size_t response_size, |
| size_t* actual_size, int timeout_ms) |
| { |
| return dev->receive(dev, response, response_size, actual_size, timeout_ms); |
| } |
| |
| int LibHothSpiDevImpl::close(device* dev) |
| { |
| return dev->close(dev); |
| } |
| |
| int LibHothSpiDevImpl::claim(device* dev) |
| { |
| return dev->claim(dev); |
| } |
| |
| int LibHothSpiDevImpl::release(device* dev) |
| { |
| return dev->release(dev); |
| } |
| |
| LibHothSpiDevImpl libhoth_spidev; |
| } // namespace hoth |
| |
| } // namespace google |