Skip to content

SPI NOR flash platform

Struct SolidSyslogSpiNorFlashBus

ClassList > SolidSyslogSpiNorFlashBus

  • #include <SolidSyslogSpiNorFlashBus.h>
struct SolidSyslogSpiNorFlashBus
{
    void (*Select)(struct SolidSyslogSpiNorFlashBus* base);
    void (*Deselect)(struct SolidSyslogSpiNorFlashBus* base);
    bool (*Write)(struct SolidSyslogSpiNorFlashBus* base, const void* buffer, size_t count);
    bool (*Read)(struct SolidSyslogSpiNorFlashBus* base, void* buffer, size_t count);
    uint32_t (*Milliseconds)(struct SolidSyslogSpiNorFlashBus* base);
};

Detailed Description

The bus under a SolidSyslogSpiNorFlash: an integrator fills this table and embeds it as the first member of its own struct, so_ base _downcasts back to that struct.

Every member is filled; there is no optional one.

The bus is ready before the flash is created: its pins, its mode and its rate are the integrator's, and so is anything another device on the same wires needs before it will stay off them. SPI mode 0, most significant bit first.

The flash frames each command with Select and Deselect, and sends and receives only between them. The part acts on a command as its select rises, so Deselect returns with the select high.

Every call returns in bounded time. A bus that waits on a transfer gives up after a time of its own and answers false; the flash then fails the operation it was carrying out. The flash bounds the time it waits for the part, by Milliseconds, and cannot bound a bus call that never returns.

Access is single-threaded, as the flash above is. A bus shared with another device takes whatever lock that needs, held from Select to Deselect; the library holds none.

Public Attributes Documentation

Deselect

Drive the part's select high.

void(* SolidSyslogSpiNorFlashBus::Deselect) (struct SolidSyslogSpiNorFlashBus *base);


Milliseconds

A count of milliseconds that wraps at 2^32, for timing the part.

uint32_t(* SolidSyslogSpiNorFlashBus::Milliseconds) (struct SolidSyslogSpiNorFlashBus *base);

Only differences between two readings are used.


Read

Clock count bytes intobuffer .

bool(* SolidSyslogSpiNorFlashBus::Read) (struct SolidSyslogSpiNorFlashBus *base, void *buffer, size_t count);

What is clocked out meanwhile is the bus's choice: the part ignores it. A bus with no part on it reads 0xFF, and that is a true.

Return value:

  • false the bus did not clock them all in; buffer is undefined.

Select

Drive the part's select low.

void(* SolidSyslogSpiNorFlashBus::Select) (struct SolidSyslogSpiNorFlashBus *base);


Write

Clock count bytes out ofbuffer , discarding what is clocked in.

bool(* SolidSyslogSpiNorFlashBus::Write) (struct SolidSyslogSpiNorFlashBus *base, const void *buffer, size_t count);

Return value:

  • false the bus did not send them all.


The documentation for this class was generated from the following file Platform/SpiNorFlash/Interface/SolidSyslogSpiNorFlashBus.h