mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/driver-w25qxxx.git
synced 2025-09-28 16:37:33 +00:00
Added delay function to driver
This commit is contained in:
@@ -40,13 +40,18 @@ namespace sta
|
||||
class W25Qxx
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Signature for delay msec function.
|
||||
*/
|
||||
using DelayUsFunc = void (*)(uint32_t);
|
||||
|
||||
/**
|
||||
* @brief Construct a new W25Qxx object
|
||||
*
|
||||
* @param device
|
||||
* @param addrMode
|
||||
*/
|
||||
W25Qxx(SPIDevice * device, AddressMode addrMode = AddressMode::_24BIT);
|
||||
W25Qxx(SPIDevice * device, DelayUsFunc delay, AddressMode addrMode = AddressMode::_24BIT);
|
||||
|
||||
uint8_t init();
|
||||
|
||||
@@ -251,7 +256,7 @@ namespace sta
|
||||
* @param arg_length
|
||||
* @return uint8_t
|
||||
*/
|
||||
uint8_t busWrite(uint8_t instruction, const uint8_t * data = nullptr, size_t length = 0, uint8_t * arguments = nullptr, size_t arg_length = 0);
|
||||
uint8_t busWrite(uint8_t instruction, const uint8_t * data = nullptr, size_t length = 0, uint8_t * arguments = nullptr, size_t arg_length = 0, uint32_t delayCsHigh = 0);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
@@ -280,6 +285,7 @@ namespace sta
|
||||
|
||||
private:
|
||||
SPIDevice * device_;
|
||||
DelayUsFunc delay_;
|
||||
ChipState state_;
|
||||
AddressMode addrMode_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user