Skip to content

Commit

Permalink
drivers/periph/spi: added locking mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Jan 13, 2015
1 parent 293996a commit dc1ac66
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drivers/include/periph/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,28 @@ int spi_init_slave(spi_t dev, spi_conf_t conf, char (*cb)(char data));
*/
int spi_conf_pins(spi_t dev);

/**
* @brief Get mutual access to the given SPI bus
*
* In case the SPI device is busy, this function will block until the bus is free again.
*
* @param[in] dev SPI device to access
*
* @return 0 on success
* @return -1 on error
*/
int spi_acquire(spi_t dev);

/**
* @brief Release the given SPI device to be used by others
*
* @param[in] dev SPI device to release
*
* @return 0 on success
* @return -1 on error
*/
int spi_release(spi_t dev);

/**
* @brief Transfer one byte on the given SPI bus
*
Expand Down

0 comments on commit dc1ac66

Please sign in to comment.