mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/driver-w25qxxx.git
synced 2025-09-29 00:37:33 +00:00
Added mutex and more doxygen
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#define STA_SENSORS_W25Q128_HPP
|
||||
|
||||
#include <sta/bus/spi/device.hpp>
|
||||
#include <sta/mutex.hpp>
|
||||
|
||||
#include <sta/drivers/w25qxx_defs.hpp>
|
||||
|
||||
#include <functional>
|
||||
@@ -60,12 +62,14 @@ namespace sta
|
||||
using DelayUsFunc = void (*)(uint32_t);
|
||||
|
||||
/**
|
||||
* @brief Construct a new W25Qxx object
|
||||
* @brief Driver class for the W25QXX flash storage series.
|
||||
*
|
||||
* @param device
|
||||
* @param addrMode
|
||||
* @param device A SPI device handle from sta-core.
|
||||
* @param delay A microsecond delay function.
|
||||
* @param addrMode Choose between 24 Bit and 32 Bit addressing.
|
||||
* @param mutex A mutex for thread safety if the flash chip is used by multiple threads. Defaults to a always free mutex.
|
||||
*/
|
||||
W25Qxx(SPIDevice * device, DelayUsFunc delay, AddressMode addrMode = AddressMode::_24BIT);
|
||||
W25Qxx(SPIDevice * device, DelayUsFunc delay, AddressMode addrMode = AddressMode::_24BIT, Mutex * mutex = Mutex::ALWAYS_FREE);
|
||||
|
||||
/**
|
||||
* @brief Initialize the flash chip.
|
||||
@@ -318,6 +322,7 @@ namespace sta
|
||||
private:
|
||||
SPIDevice * device_;
|
||||
DelayUsFunc delay_;
|
||||
Mutex * mutex_;
|
||||
ChipState state_;
|
||||
AddressMode addrMode_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user