Thread-safe AT25040B EEPROM façade (BaseSpi + optional /WP GPIO).
More...
#include <At25040Handler.h>
|
| | At25040Handler (BaseSpi &spi, BaseGpio *wp=nullptr) noexcept |
| |
| ProbeResult | Probe () noexcept |
| | SPI probe; does not parse product identity.
|
| |
| uint8_t | LastRdsr () const noexcept |
| |
| bool | Read (uint16_t addr, uint8_t *dst, uint16_t len) noexcept |
| | Read len bytes starting at addr.
|
| |
| bool | Write (uint16_t addr, const uint8_t *src, uint16_t len) noexcept |
| | Page-loop write. Caller owns identity / calibration policy.
|
| |
| void | ReleaseWriteProtect () noexcept |
| | Drive /WP inactive so page writes can proceed.
|
| |
| void | ParkWriteProtect () noexcept |
| | Drive /WP active (protect) after a write burst.
|
| |
Thread-safe AT25040B EEPROM façade (BaseSpi + optional /WP GPIO).
◆ ProbeResult
Result of a non-destructive presence probe.
| Enumerator |
|---|
| NotBound | SPI not attached / constructor-only state.
|
| Absent | Bus answered with no device.
|
| Present | RDSR / identity bytes look like AT25040.
|
◆ At25040Handler()
| At25040Handler::At25040Handler |
( |
BaseSpi & |
spi, |
|
|
BaseGpio * |
wp = nullptr |
|
) |
| |
|
inlineexplicitnoexcept |
- Parameters
-
| spi | Host SPI (CS already bound on the BaseSpi instance). |
| wp | Optional write-protect GPIO; nullptr if /WP is hard-wired. |
◆ LastRdsr()
| uint8_t At25040Handler::LastRdsr |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Last RDSR byte captured by the driver.
◆ ParkWriteProtect()
| void At25040Handler::ParkWriteProtect |
( |
| ) |
|
|
noexcept |
Drive /WP active (protect) after a write burst.
◆ Probe()
SPI probe; does not parse product identity.
◆ Read()
| bool At25040Handler::Read |
( |
uint16_t |
addr, |
|
|
uint8_t * |
dst, |
|
|
uint16_t |
len |
|
) |
| |
|
noexcept |
Read len bytes starting at addr.
- Parameters
-
| addr | EEPROM address. |
| dst | Destination buffer (must hold len bytes). |
| len | Byte count. |
- Returns
- true on a complete read.
◆ ReleaseWriteProtect()
| void At25040Handler::ReleaseWriteProtect |
( |
| ) |
|
|
noexcept |
Drive /WP inactive so page writes can proceed.
◆ Write()
| bool At25040Handler::Write |
( |
uint16_t |
addr, |
|
|
const uint8_t * |
src, |
|
|
uint16_t |
len |
|
) |
| |
|
noexcept |
Page-loop write. Caller owns identity / calibration policy.
- Parameters
-
| addr | EEPROM address. |
| src | Source buffer. |
| len | Byte count. |
- Returns
- true when every page was written and its write cycle ended (the driver waits up to 10 ms per page);
/WP is parked again on every path.
◆ adapter_
◆ device_
◆ mutex_
| RtosMutex At25040Handler::mutex_ {} |
|
mutableprivate |
◆ wp_
| BaseGpio* At25040Handler::wp_ {nullptr} |
|
private |
The documentation for this class was generated from the following files: