43 #include "../CDev.hpp" 49 #include <sys/ioctl.h> 50 #include <linux/types.h> 51 #include <linux/spi/spidev.h> 70 SPI(
const SPI &) =
delete;
71 SPI &operator=(
const SPI &) =
delete;
73 SPI &operator=(SPI &&) =
delete;
98 virtual int init()
override;
103 virtual int probe() {
return PX4_OK; }
124 int transfer(uint8_t *
send, uint8_t *recv,
unsigned len);
145 int transferhword(uint16_t *
send, uint16_t *recv,
unsigned len);
156 void set_frequency(uint32_t frequency) { _frequency = frequency; }
157 uint32_t get_frequency() {
return _frequency; }
167 void set_lockmode(
enum LockMode
mode) { _locking_mode =
mode; }
175 LockMode _locking_mode{LOCK_THREADS};
178 int _transfer(uint8_t *
send, uint8_t *recv,
unsigned len);
180 int _transferhword(uint16_t *
send, uint16_t *recv,
unsigned len);
182 virtual bool external()
const override {
return px4_spi_bus_external(get_device_bus()); }
188 #endif // __PX4_LINUX
Namespace encapsulating all device framework classes, functions and data.
void init()
Activates/configures the hardware registers.