2012-08-20 15:38:09 -03:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_ARDUINO_SPI_DRIVER_H__
|
|
|
|
#define __AP_HAL_ARDUINO_SPI_DRIVER_H__
|
|
|
|
|
|
|
|
#include <AP_HAL.h>
|
2012-08-22 21:31:52 -03:00
|
|
|
#include "AP_HAL_AVR_Namespace.h"
|
2012-08-20 15:38:09 -03:00
|
|
|
|
2012-08-21 18:11:24 -03:00
|
|
|
class AP_HAL_AVR::ArduinoSPIDriver : public AP_HAL::SPIDriver {
|
2012-08-20 15:38:09 -03:00
|
|
|
public:
|
2012-08-30 20:25:35 -03:00
|
|
|
ArduinoSPIDriver() {}
|
|
|
|
void init(void* machtnichts);
|
|
|
|
void set_freq(uint32_t freq_hz);
|
|
|
|
uint8_t transfer(uint8_t data);
|
2012-08-20 15:38:09 -03:00
|
|
|
private:
|
2012-08-30 20:25:35 -03:00
|
|
|
uint8_t _divider_bits(uint8_t divider);
|
|
|
|
void _set_clock_divider_bits(uint8_t b);
|
2012-08-20 15:38:09 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_ARDUINO_SPI_DRIVER_H__
|
|
|
|
|