14 #define debug(fmt, args ...) do {hal.console->printf("[SPIUARTDriver]: %s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## args); } while(0) 15 #define error(fmt, args ...) do {fprintf(stderr,"%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## args); } while(0) 17 #define debug(fmt, args ...) 18 #define error(fmt, args ...) 21 using namespace Linux;
72 debug(
"Set higher SPI-frequency");
75 debug(
"Set lower SPI-frequency");
80 debug(
"Set lower SPI-frequency");
81 debug(
"%s: wrong baudrate (%u) for SPI-driven device. setting default speed", __func__, b);
116 static uint8_t ff_stub[100] = {0xff};
void begin(uint32_t b, uint16_t rxS, uint16_t txS)
AP_HAL::OwnPtr< AP_HAL::SPIDevice > _dev
AP_HAL::UARTDriver * console
#define debug(fmt, args ...)
uint32_t _last_update_timestamp
int _read_fd(uint8_t *buf, uint16_t n)
virtual void printf(const char *,...) FMT_PRINTF(2
virtual bool take_nonblocking() WARN_IF_UNUSED=0
virtual OwnPtr< SPIDevice > get_device(const char *name)
virtual Semaphore * get_semaphore() override=0
virtual void _timer_tick(void) override
bool set_size(uint32_t size)
virtual bool transfer_fullduplex(const uint8_t *send, uint8_t *recv, uint32_t len)=0
volatile bool _initialised
AP_HAL::SPIDeviceManager * spi
virtual int _write_fd(const uint8_t *buf, uint16_t n)
uint32_t write(const uint8_t *data, uint32_t len)
virtual int _read_fd(uint8_t *buf, uint16_t n)
int _write_fd(const uint8_t *buf, uint16_t n)
virtual bool set_speed(Device::Speed speed) override=0
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
void panic(const char *errormsg,...) FMT_PRINTF(1