diff options
author | px4dev <px4@purgatory.org> | 2013-09-12 23:56:53 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-09-12 23:56:53 -0700 |
commit | 19fdaf2009d41885923b586432cb2506a24ca5b3 (patch) | |
tree | e8abf0ea4859b1adf70d007bacb3a6a612d86e53 /src/drivers/device/spi.h | |
parent | 379623596715d0dce47192329ae9aceabb9ded11 (diff) | |
download | px4-firmware-19fdaf2009d41885923b586432cb2506a24ca5b3.tar.gz px4-firmware-19fdaf2009d41885923b586432cb2506a24ca5b3.tar.bz2 px4-firmware-19fdaf2009d41885923b586432cb2506a24ca5b3.zip |
Use the generic device::SPI locking strategy.
Diffstat (limited to 'src/drivers/device/spi.h')
-rw-r--r-- | src/drivers/device/spi.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/device/spi.h b/src/drivers/device/spi.h index e0122372a..9103dca2e 100644 --- a/src/drivers/device/spi.h +++ b/src/drivers/device/spi.h @@ -101,6 +101,17 @@ protected: */ int transfer(uint8_t *send, uint8_t *recv, unsigned len); + /** + * Locking modes supported by the driver. + */ + enum LockMode { + LOCK_PREEMPTION, /**< the default; lock against all forms of preemption. */ + LOCK_THREADS, /**< lock only against other threads, using SPI_LOCK */ + LOCK_NONE /**< perform no locking, only safe if the bus is entirely private */ + }; + + LockMode locking_mode; /**< selected locking mode */ + private: int _bus; enum spi_dev_e _device; |