aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib/spi/spi_lock.cpp
blob: b37daa7388046ab7683efdf54ea5c98873fa5514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "mpm/spi/spi_lock.hpp"

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);
}