mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/driver-w25qxxx.git
synced 2025-09-28 16:37:33 +00:00
Added search functionality using binary search
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <sta/bus/spi/device.hpp>
|
||||
#include <sta/drivers/w25qxx_defs.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
@@ -53,8 +55,21 @@ namespace sta
|
||||
*/
|
||||
W25Qxx(SPIDevice * device, DelayUsFunc delay, AddressMode addrMode = AddressMode::_24BIT);
|
||||
|
||||
/**
|
||||
* @brief Initialize the flash chip.
|
||||
*
|
||||
* @return uint8_t Returns 1 if successful, 0 otherwise.
|
||||
*/
|
||||
uint8_t init();
|
||||
|
||||
/**
|
||||
* @brief Find the last page satisfying the given criterion. Uses a binary search to find this page.
|
||||
*
|
||||
* @param criterion A function evaluating the criterion on a page.
|
||||
* @return uint32_t The last address such that the criterion is satisfied.
|
||||
*/
|
||||
uint32_t findLastPage(std::function<bool(uint8_t*)> criterion);
|
||||
|
||||
/**
|
||||
* @brief Set the Address Mode object
|
||||
*
|
||||
@@ -173,8 +188,6 @@ namespace sta
|
||||
* @return uint8_t
|
||||
*/
|
||||
uint8_t pageProgram(uint32_t address, uint8_t * buffer, size_t length);
|
||||
|
||||
|
||||
public:
|
||||
/*
|
||||
* Erase operations
|
||||
|
Reference in New Issue
Block a user