ardupilot/libraries/AP_HAL/SPIDriver.h
Pat Hickey b0d8f43111 AP_HAL_AVR: Implemented SPIDriver based on Arduino, but it doesn't work yet
* I don't have an APM2.5 board I can easily connect a logic analyzer to see
  the traffic on the bus...
2012-12-20 14:51:21 +11:00

24 lines
579 B
C++

#ifndef __AP_HAL_SPI_DRIVER_H__
#define __AP_HAL_SPI_DRIVER_H__
#include "AP_HAL_Namespace.h"
/**
* A simple SPIDriver interface directly copied from Arduino SPI driver.
* This will not be the final AP_HAL interface.
* We will need an abstraction for selecting slave devices and performing bulk
* transfers to be portable to other platforms.
*/
class AP_HAL::SPIDriver {
public:
SPIDriver() {}
virtual void init(void *) = 0;
virtual void set_freq(uint32_t freq_hz) = 0;
virtual uint8_t transfer (uint8_t data) = 0;
};
#endif // __AP_HAL_SPI_DRIVER_H__