These are commands that are not (yet) explicitly exposed in the C# and C++ library (they are constants define / enum: SPI_Command in te_api.h).
SPI Flash command | Description |
---|---|
#define SPI_WREN 0x06 | Set Write Enable Latch |
#define SPI_WRDI 0x04 | Reset Write Enable Latch |
#define SPI_RDSR1 0x05 | Read Status Register 1 |
#define SPI_RDSR2 0x35 | Read Status Register 2 |
#define SPI_WRSR 0x01 | Write Status Register |
#define SPI_READ 0x03 | Read data from memory |
#define SPI_FAST_READ 0x0b | Similar to the READ command, but possibly uses a faster clock |
#define SPI_WRITE 0x02 | Write data to memory array |
#define SPI_SE 0xD8 | Erase one sector in memory |
#define SPI_BE 0xC7 | Erase all memory |
#define SPI_DP 0xb9 | Write Enable Command |
#define SPI_RES 0xab | Read Electonic Signature |
#define SPI_RDID 0x9F | reads the ID of the SPI Flash |
The SPI Command can be dispatched through
In particular, SPI Flash Commands could be used:
First case example (reads the ID of the SPI Flash) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SW host computer: reads the ID of the SPI Flash This is pseudocode close to the real one.
| ||||||||||||||
FW running on USB FX2 microcontroller This is a piece of real code (FW running on USB FX2 microcontroller) te_api.c, lines 207-211 EP1INBUF: read Reply[] from USB FX2 microcontroller to host computer EP1OUTBUF: write Command[] from host computer to USB FX2 microcontroller
| ||||||||||||||
FW running on USB FX2 microcontroller This is a piece of real code spi.c, lines 63-89
|