43 #include "../CDev.hpp" 56 SPI &operator=(
const SPI &) =
delete;
58 SPI &operator=(
SPI &&) =
delete;
83 virtual int init()
override;
88 virtual int probe() {
return PX4_OK; }
109 int transfer(uint8_t *
send, uint8_t *recv,
unsigned len);
130 int transferhword(uint16_t *send, uint16_t *recv,
unsigned len);
163 int _transfer(uint8_t *send, uint8_t *recv,
unsigned len);
165 int _transferhword(uint16_t *send, uint16_t *recv,
unsigned len);
167 virtual bool external()
const override {
return px4_spi_bus_external(get_device_bus()); }
void set_frequency(uint32_t frequency)
Set the SPI bus frequency This is used to change frequency on the fly.
Abstract class for character device on SPI.
Namespace encapsulating all device framework classes, functions and data.
the default; lock against all forms of preemption.
virtual int probe()
Check for the presence of the device on the bus.
void init()
Activates/configures the hardware registers.
void set_lockmode(enum LockMode mode)
Set the SPI bus locking mode.
virtual bool external() const override
lock only against other threads, using SPI_LOCK
LockMode
Locking modes supported by the driver.