Definition of Fusion functions.
Definition in file fusion.c.
#include "fusion.h"Go to the source code of this file.
Functions | |
| void | fusionWaitOnReady () |
| : Wait while Read/Busy Status bit in SRB is 1 (device is busy). More... | |
| 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(). More... | |
| void | fusionGlobalUnprotect () |
| Unprotects all sectors by issuing a WE, then write of 0x00 to status register byte 1. These 2 write are accomplished with fusionWriteEnable() and fusionWriteSRB1(). More... | |
| 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 array rxBuffer. This command can read at multiple frequencies but necessitates the use of a dummy cycle. More... | |
| 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 array rxBuffer. This command uses a low frequency read as specified in the datasheet. More... | |
| 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 SI and SO as inputs to master. More... | |
| void | fusionPageErase (uint32_t address) |
| OPCODE: 0x81 Erases a page of data (256 Bytes) starting from page address 'address.'. More... | |
| void | fusionBlockErase4K (uint32_t address) |
| OPCODE: 0x20 Erases a block of data (4 KBytes) starting from page address 'address.'. More... | |
| void | fusionChipErase () |
| OPCODE: 0x60 Erases the entire chip by setting all bits. More... | |
| 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. More... | |
| void | fusionWriteEnable () |
| OPCODE: 0x06 Sends opcode to enable writing. More... | |
| void | fusionWriteDisable () |
| OPCODE: 0x04 Sends opcode to disable writing. More... | |
| void | fusionReadSR (uint8_t *rxBuffer) |
| OPCODE: 0x05 Reads the value in the status register (bytes 1 and 2). More... | |
| void | fusionWriteSRB1 (uint8_t data) |
| OPCODE: 0x01 Writes the value in data to status register byte 1. More... | |
| void | fusionWriteSRB2 (uint8_t data) |
| OPCODE: 0x31 Writes the value in data to status register byte 2. More... | |
| void | fusionReset () |
| OPCODE: 0xF0 Resets the flash device for immediately, regardless of what current operation is being performed. More... | |
| void | fusionReadMID (uint8_t *rxBuffer) |
| OPCODE: 0x9F Reads the manufacturer ID and stores the data in rxBuffer. More... | |
| void | fusionDeepPowerDown () |
| OPCODE: 0xB9 Enters the device into Deep Power Down mode. fusionResumeFromDeepPowerDown() will wake it back up again. More... | |
| void | fusionResumeFromDeepPowerDown () |
| OPCODE: 0xAB Wakes the device up from Deep Power Down mode (fusionDeepPowerDown()). More... | |
| void | fusionUDPDMode () |
| OPCODE: 0x79 Sends the device into Ultra Deep Power Down Mode. Exit UDPD Mode by toggling CS with command ___ or using a JEDEC reset with command fusionHardwareReset(). More... | |
| void | fusionSequentialProgramMode (uint8_t txBuffer) |
| OPCODE: 0xAD Sends the byte in txBuffer to the flash device for programming. This command should only be called after fusionSequentialProgramModeEnbale(). More... | |
| 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 both SI and SO as outputs from master. More... | |
| void | fusionProtectSector (uint32_t address) |
| OPCODE: 0x36 Sends opcode to disable writing. More... | |
| void | fusionUnprotectSector (uint32_t address) |
| OPCODE: 0x39 Sends opcode to enable writing. More... | |
| void | fusionReadSectorProtectionRegisters (uint32_t address, uint8_t *rxBuffer) |
| OPCODE: 0x3C Reads the sector protection register at address 'address.' 0x00 -> Sector is unprotected. 0xFF -> Sector is protected. More... | |
| void | fusionSequentialProgramModeEnable (uint32_t address, uint8_t txBuffer) |
| OPCODE: 0xAD Enables sequential program mode and loads the starting address into the device. The first byte of data is also stored. More... | |
| void | fusionHardwareReset () |
| Performs a hardware (JEDEC) reset on the device. More... | |
Variables | |
| uint8_t | txFusionInternalBuffer [MAXIMUM_TX_BYTES] |
| void fusionBlockErase4K | ( | uint32_t | address | ) |
| void fusionChipErase | ( | ) |
| void fusionDeepPowerDown | ( | ) |
OPCODE: 0xB9
Enters the device into Deep Power Down mode. fusionResumeFromDeepPowerDown() will wake it back up again.
| void |
| 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 both SI and SO as outputs from master.
| address | The 3 bytes address indicating the first location to be written to. |
| txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
| txNumBytes | Number of non dummy bytes to be written to the device. txBuffer must have a minimum of this many elements. |
| void |
| 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 SI and SO as inputs to master.
| address | Address starting from which the data in memory will be read. |
| rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
| rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
| void |
| 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().
| void |
| void fusionGlobalUnprotect | ( | ) |
Unprotects all sectors by issuing a WE, then write of 0x00 to status register byte 1. These 2 write are accomplished with fusionWriteEnable() and fusionWriteSRB1().
| void |
| void fusionHardwareReset | ( | ) |
| void fusionPageErase | ( | uint32_t | address | ) |
| 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.
| address | The 3 bytes address indicating the first location to be written to. |
| txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
| txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements. |
| void |
| void fusionProtectSector | ( | uint32_t | address | ) |
| 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 array rxBuffer. This command can read at multiple frequencies but necessitates the use of a dummy cycle.
| address | Address starting from which the data in memory will be read. |
| rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
| rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
| void |
| 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 array rxBuffer. This command uses a low frequency read as specified in the datasheet.
| address | 3 byte address starting from which the data in memory will be read. |
| rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
| rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
| void |
| void fusionReadMID | ( | uint8_t * | rxBuffer | ) |
| void fusionReadSectorProtectionRegisters | ( | uint32_t | address, |
| uint8_t * | rxBuffer | ||
| ) |
OPCODE: 0x3C
Reads the sector protection register at address 'address.' 0x00 -> Sector is unprotected. 0xFF -> Sector is protected.
| address | 3 byte address for the sector of interest. |
| rxBuffer | The byte buffer in which the value of the protection register will be stored. |
| void |
| void fusionReadSR | ( | uint8_t * | rxBuffer | ) |
| void fusionReset | ( | ) |
| void fusionResumeFromDeepPowerDown | ( | ) |
OPCODE: 0xAB
Wakes the device up from Deep Power Down mode (fusionDeepPowerDown()).
| void |
| void fusionSequentialProgramMode | ( | uint8_t | txBuffer | ) |
| void fusionSequentialProgramModeEnable | ( | uint32_t | address, |
| uint8_t | txBuffer | ||
| ) |
OPCODE: 0xAD
Enables sequential program mode and loads the starting address into the device. The first byte of data is also stored.
| address | The address from which the sequential programming will begin. |
| txBuffer | The first byte of data to be stored in flash memory. |
| void |
| void fusionUDPDMode | ( | ) |
OPCODE: 0x79
Sends the device into Ultra Deep Power Down Mode. Exit UDPD Mode by toggling CS with command ___ or using a JEDEC reset with command fusionHardwareReset().
| void |
| void fusionUnprotectSector | ( | uint32_t | address | ) |
| void fusionWaitOnReady | ( | ) |
| void fusionWriteDisable | ( | ) |
| void fusionWriteEnable | ( | ) |
| void fusionWriteSRB1 | ( | uint8_t | data | ) |
| void fusionWriteSRB2 | ( | uint8_t | data | ) |
| uint8_t txFusionInternalBuffer[MAXIMUM_TX_BYTES] |