Added mutex and more doxygen

This commit is contained in:
dario
2024-06-03 22:49:04 +02:00
parent 9dd2a8da9c
commit 007ed46363
3 changed files with 20 additions and 13 deletions

View File

@@ -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_;
};