44 #if (PARTNO == AT25XE512C) || \ 45 (PARTNO == AT25XE011) || \ 46 (PARTNO == AT25XE021A) || \ 47 (PARTNO == AT25XE041B) || \ 48 (PARTNO == AT25DN256) || \ 49 (PARTNO == AT25DN512C) || \ 50 (PARTNO == AT25DN011) || \ 51 (PARTNO == AT25DF256) || \ 52 (PARTNO == AT25DF512C) || \ 53 (PARTNO == AT25DF011) || \ 54 (PARTNO == AT25DF021A) || \ 55 (PARTNO == AT25DF041B) || \ 56 (PARTNO == AT25XV021A) || \ 57 (PARTNO == AT25XV041B) || \ 60 static bool DISPLAY_OUTPUT = 0;
62 static void debugOn() {DISPLAY_OUTPUT = 1;};
63 static void debugOff() {DISPLAY_OUTPUT = 0;};
154 uint32_t totalBytes = txNumBytes + 4;
156 for(uint32_t j = 0; j < txNumBytes; j++)
271 #if (PARTNO == AT25XE021A) || \ 272 (PARTNO == AT25XE041B) || \ 273 (PARTNO == AT25DF021A) || \ 274 (PARTNO == AT25DF041B) || \ 275 (PARTNO == AT25XV021A) || \ 276 (PARTNO == AT25XV041B) || \ 293 uint32_t totalBytes = txNumBytes + 4;
295 for(uint32_t j = 0; j < txNumBytes; j++)
void fusionUDPDMode()
OPCODE: 0x79 Sends the device into Ultra Deep Power Down Mode. Exit UDPD Mode by toggling CS with c...
void SPI_JEDECReset()
Performs a JEDEC reset on the SPI device.
void fusionWriteEnable()
OPCODE: 0x06 Sends opcode to enable writing.
void fusionReadSectorProtectionRegisters(uint32_t address, uint8_t *rxBuffer)
OPCODE: 0x3C Reads the sector protection register at address 'address.' 0x00 -> Sector is unprotect...
void fusionReset()
OPCODE: 0xF0 Resets the flash device for immediately, regardless of what current operation is being...
void printSPIExchange(uint8_t *txBuffer, uint32_t txNumBytes, uint8_t *rxBuffer, uint32_t rxNumBytes)
Prints the byte array in hexadecimal with a formatted output. Indicates what bytes were sent...
#define CMD_FUSION_BLOCK_ERASE_4K
void fusionReadMID(uint8_t *rxBuffer)
OPCODE: 0x9F Reads the manufacturer ID and stores the data in rxBuffer.
#define CMD_FUSION_WRITE_SRB1
void fusionResumeFromDeepPowerDown()
OPCODE: 0xAB Wakes the device up from Deep Power Down mode (fusionDeepPowerDown()).
Declarations of Fusion functions.
void fusionHardwareReset()
Performs a hardware (JEDEC) reset on the device.
void fusionWriteSRB1(uint8_t data)
OPCODE: 0x01 Writes the value in data to status register byte 1.
#define CMD_FUSION_DUAL_INPUT_PROGRAM
void fusionDeepPowerDown()
OPCODE: 0xB9 Enters the device into Deep Power Down mode. fusionResumeFromDeepPowerDown() will wake...
void fusionChipErase()
OPCODE: 0x60 Erases the entire chip by setting all bits.
#define CMD_FUSION_READ_SR
#define CMD_FUSION_DEEP_POWER_DOWN
void fusionGlobalUnprotect()
Unprotects all sectors by issuing a WE, then write of 0x00 to status register byte 1...
#define CMD_FUSION_WRITE_SRB2
void fusionWaitOnReady()
: Wait while Read/Busy Status bit in SRB is 1 (device is busy).
#define CMD_FUSION_CHIP_ERASE
#define CMD_FUSION_RESUME_FROM_DPD
void fusionWriteDisable()
OPCODE: 0x04 Sends opcode to disable writing.
void load4BytesToTxBuffer(uint8_t *txBuffer, uint8_t opcode, uint32_t address)
Loads 1 byte of opcode followed by 3 address bytes into the txBuffer. The data is stored at the first...
#define CMD_FUSION_UNPROTECT_SECTOR
void fusionBlockErase4K(uint32_t address)
OPCODE: 0x20 Erases a block of data (4 KBytes) starting from page address 'address.'.
#define CMD_FUSION_UDPD_MODE
#define CMD_FUSION_RESET_CONFIRMATION
Fusion Devices and Opcodes AT25XE512C AT25XE011 AT25XE021A AT25XE041B AT25DN256 AT25DN512C AT25DN011 ...
#define CMD_FUSION_READ_ARRAY
void fusionDualInputProgram(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0xA2 Programs 'txNumBytes' bytes of data in Dual Input Mode starting at 'address' using bot...
void SPI_DualExchange(uint8_t standardSPINumBytes, uint8_t *txBuffer, uint32_t txNumBytes, uint8_t *rxBuffer, uint32_t rxNumBytes, uint32_t dummyNumBytes)
Sends and receives bytes based on the function parameters. MOSI is used for the opcode and address...
#define CMD_FUSION_PROTECT_SECTOR
#define CMD_FUSION_WRITE_ENABLE
void fusionGlobalProtect()
Protects all sectors by issuing a WE, then write of 0x7F to status register byte 1. These 2 write are accomplished with fusionWriteEnable() and fusionWriteSRB1().
#define CMD_FUSION_PAGE_ERASE
#define CMD_FUSION_READ_ARRAY_LF
#define CMD_FUSION_READ_MID
void fusionSequentialProgramMode(uint8_t txBuffer)
OPCODE: 0xAD Sends the byte in txBuffer to the flash device for programming. This command should on...
void SPI_Delay(uint32_t delayTime)
Performs a delayTime number of NOPs.
uint8_t txFusionInternalBuffer[MAXIMUM_TX_BYTES]
void fusionReadArray(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x0B Reads rxNumBytes starting from location 'address' and stores the data in the byte arra...
void fusionReadArrayLF(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x03 Reads rxNumBytes starting from location 'address' and stores the data in the byte arra...
void fusionProtectSector(uint32_t address)
OPCODE: 0x36 Sends opcode to disable writing.
#define CMD_FUSION_WRITE_DISABLE
void fusionDualOutputRead(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x3B Reads 'txNumBytes' bytes of data in Dual Output Mode starting at 'address' using both ...
void fusionPageErase(uint32_t address)
OPCODE: 0x81 Erases a page of data (256 Bytes) starting from page address 'address.'.
void fusionSequentialProgramModeEnable(uint32_t address, uint8_t txBuffer)
OPCODE: 0xAD Enables sequential program mode and loads the starting address into the device...
void fusionWriteSRB2(uint8_t data)
OPCODE: 0x31 Writes the value in data to status register byte 2.
#define CMD_FUSION_PROGRAM_ARRAY
void fusionUnprotectSector(uint32_t address)
OPCODE: 0x39 Sends opcode to enable writing.
void fusionReadSR(uint8_t *rxBuffer)
OPCODE: 0x05 Reads the value in the status register (bytes 1 and 2).
#define CMD_FUSION_DUAL_OUTPUT_READ
#define CMD_FUSION_PROTECTION_REGISTER
#define CMD_FUSION_SQNTL_PROGRAM_MODE
void SPI_Exchange(uint8_t *txBuffer, uint32_t txNumBytes, uint8_t *rxBuffer, uint32_t rxNumBytes, uint32_t dummyNumBytes)
Sends and receives bytes based on the function parameters. MISO and MOSI fill their standard SPI role...
void fusionProgramArray(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0x02 Programs 'txNumBytes' bytes of data starting at the address indicated by address...