diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-03-08 09:28:55 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:44 -0800 |
commit | 1a4348038d0eb57d53475074dca49e8192aeb2d7 (patch) | |
tree | 04c8e87fa9c95d2702aac410f6fb271461acb9bb /mpm/lib/spi/spi_lock.cpp | |
parent | fc8cd827f6b16b9c8c354a216889e6a9d7f37456 (diff) | |
download | uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.gz uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.tar.bz2 uhd-1a4348038d0eb57d53475074dca49e8192aeb2d7.zip |
Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration
Contributions by:
Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
Diffstat (limited to 'mpm/lib/spi/spi_lock.cpp')
-rw-r--r-- | mpm/lib/spi/spi_lock.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mpm/lib/spi/spi_lock.cpp b/mpm/lib/spi/spi_lock.cpp new file mode 100644 index 000000000..1796de46a --- /dev/null +++ b/mpm/lib/spi/spi_lock.cpp @@ -0,0 +1,26 @@ +#include "spi_lock.h" + +spi_lock::spi_lock(uint8_t spidev_index) : + spidev_index(spidev_index) +{ + +} + +uint8_t spi_lock::get_spidev() const +{ + return spidev_index; +} + +void spi_lock::lock() +{ + spi_mutex.lock(); +} +void spi_lock::unlock() +{ + spi_mutex.unlock(); +} + +spi_lock::sptr spi_lock::make(uint8_t spidev_index) +{ + return std::make_shared<spi_lock>(spidev_index); +}
\ No newline at end of file |