24 #if HAL_USE_SPI == TRUE 31 struct spi_dev_s *
dev;
41 uint8_t _device, ioline_t _pal_line,
42 uint16_t _mode, uint32_t _lowspeed, uint32_t _highspeed)
43 :
name(_name),
bus(_bus), device(_device),
44 pal_line(_pal_line), mode(_mode),
45 lowspeed(_lowspeed), highspeed(_highspeed)
69 void do_transfer(
const uint8_t *send, uint8_t *recv, uint32_t len);
72 bool transfer(
const uint8_t *send, uint32_t send_len,
73 uint8_t *recv, uint32_t recv_len)
override;
76 bool transfer_fullduplex(
const uint8_t *send, uint8_t *recv,
77 uint32_t len)
override;
83 bool clock_pulse(uint32_t len)
override;
90 uint32_t period_usec, AP_HAL::Device::PeriodicCb)
override;
95 bool set_chip_select(
bool set)
override;
97 bool acquire_bus(
bool acquire,
bool skip_cs);
99 SPIDriver * get_driver();
101 #ifdef HAL_SPI_CHECK_CLOCK_FREQ 103 static void test_clock_freq(
void);
115 static void *spi_thread(
void *arg);
116 uint16_t derive_freq_flag(uint32_t _frequency);
136 #endif // HAL_USE_SPI
void dma_deallocate(Shared_DMA *ctx)
static SPIDeviceManager * from(AP_HAL::SPIDeviceManager *spi_mgr)
AP_HAL::OwnPtr< AP_HAL::Device > get_device(const char *name)
void dma_allocate(Shared_DMA *ctx)
SPIDesc(const char *_name, uint8_t _bus, uint8_t _device, ioline_t _pal_line, uint16_t _mode, uint32_t _lowspeed, uint32_t _highspeed)
AP_HAL::Device::PeriodicHandle register_periodic_callback(uint32_t period_usec, AP_HAL::Device::PeriodicCb, AP_HAL::Device *hal_device)