flash2 2.0.0.0
|
Functions | |
void | flash2_cfg_setup (flash2_cfg_t *cfg) |
Config Object Initialization function. | |
FLASH2_RETVAL | flash2_init (flash2_t *ctx, flash2_cfg_t *cfg) |
Initialization function. | |
void | flash2_generic_transfer (flash2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint8_t | flash2_busy (flash2_t *ctx) |
Flash 2 Busy. | |
uint8_t | flash2_get_status_reg (flash2_t *ctx) |
Flash 2 Get Status Register. | |
uint8_t | flash2_erase_status (flash2_t *ctx) |
Flash 2 Erase Status. | |
uint8_t | flash2_write_status (flash2_t *ctx) |
Flash 2 Write Status. | |
uint8_t | flash2_program_status (flash2_t *ctx) |
Flash 2 Program Status. | |
uint8_t | flash2_protect_status (flash2_t *ctx) |
Flash 2 Protect Status. | |
void | flash2_lock_security_id (flash2_t *ctx) |
flash2_lock_security_id | |
uint8_t | flash2_security_status (flash2_t *ctx) |
Flash 2 Security Status. | |
void | flash2_write_protect_enable (flash2_t *ctx) |
Flash 2 Write Protect Enable. | |
void | flash2_write_protect_disable (flash2_t *ctx) |
Flash 2 Write Protect Disable. | |
void | flash2_hold_enable (flash2_t *ctx) |
Flash 2 Hold Enable. | |
void | flash2_hold_disable (flash2_t *ctx) |
Flash 2 Hold Disable. | |
void | flash2_write_suspend (flash2_t *ctx) |
Flash 2 Write Suspend. | |
void | flash2_write_resume (flash2_t *ctx) |
Flash 2 Write Resume. | |
void | flash2_spi_get_security_id (flash2_t *ctx, uint8_t *buffer, uint32_t data_count) |
Flash 2 Get Security ID SPI. | |
void | flash2_sqi_get_security_id (flash2_t *ctx, uint8_t *buffer, uint32_t data_count) |
Flash 2 Get Security ID SQI. | |
void | flash2_set_security_id (flash2_t *ctx, uint8_t *buffer, uint32_t data_count) |
Flash 2 Set Security ID. | |
void | flash2_write_disable (flash2_t *ctx) |
Flash 2 Write Disable. | |
void | flash2_spi_get_bpr (flash2_t *ctx, uint8_t *buffer, uint32_t data_count) |
Flash 2 Get Block Protection Register SPI. | |
void | flash2_sqi_get_bpr (flash2_t *ctx, uint8_t *buffer, uint32_t data_count) |
Flash 2 Get Block Protection Register SQI. | |
void | flash2_set_bpr (flash2_t *ctx, uint8_t *buffer) |
Flash 2 Set Block Protection Register. | |
void | flash2_lockBpr (flash2_t *ctx) |
Flash 2 Lock Block Protection Register. | |
void | flash2_nonvolatile_write_lock (flash2_t *ctx, uint8_t *buffer) |
Flash 2 Non-Volatile Write-Lock. | |
void | flash2_global_block_unlock (flash2_t *ctx) |
Flash 2 Global Block Unlock. | |
void | flash2_read_generic (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Read. | |
void | flash2_highspeedRread (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 High Speed Read. | |
void | flash2_quadWrite (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Quad Write. | |
void | flash2_write_generic (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Write. | |
void | flash2_quad_enable (flash2_t *ctx) |
Flash 2 Quad Enable. | |
void | flash2_quad_out_read (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Quad Output Read. | |
void | flash2_quad_io_read (flash2_t *ctx, uint32_t address, uint8_t mode, uint8_t *buffer, uint32_t data_count) |
Flash 2 Quad I/O Read. | |
void | flash2_quad_reset (flash2_t *ctx) |
Flash 2 Quad Reset. | |
void | flash2_set_burst (flash2_t *ctx, uint8_t length) |
Flash 2 Set Burst. | |
void | flash2_read_sqi_burst_wrap (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Read Burst with Wrap through SQI. | |
void | flash2_read_spi_burst_wrap (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Read Burst with Wrap through SPI. | |
void | flash2_read_dual_output (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Read Dual Output. | |
void | flash2_read_dual_io (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 Read Dual I/O. | |
void | flash2_sector_erase (flash2_t *ctx, uint32_t address) |
Flash 2 Sector Erase. | |
void | flash2_block_erase (flash2_t *ctx, uint32_t address) |
Flash 2 Block Erase. | |
void | flash2_chip_erase (flash2_t *ctx) |
Flash 2 Chip Erase. | |
void | flash2_get_sfdp_params (flash2_t *ctx, uint32_t address, uint8_t *buffer, uint32_t data_count) |
Flash 2 get Serial Flash Discoverable \ Parameters. | |
uint8_t | flash2_quad_device_manufac (flash2_t *ctx) |
Flash 2 Quad Device Manufacturer. | |
uint8_t | flash2_quad_device_type (flash2_t *ctx) |
Flash 2 Quad Device Type. | |
uint8_t | flash2_quad_device_id (flash2_t *ctx) |
Flash 2 Quad Device ID. | |
uint8_t | flash2_device_manufac (flash2_t *ctx) |
Flash 2 Device Manufacturer. | |
uint8_t | flash2_device_type (flash2_t *ctx) |
Flash 2 Device Type. | |
uint8_t | flash2_device_id (flash2_t *ctx) |
Flash 2 Device ID. | |
void | flash2_reset (flash2_t *ctx) |
Flash 2 Reset. | |
void | flash2_write_status_reg (flash2_t *ctx, uint8_t s_reg) |
Flash 2 Write Status Register. | |
uint8_t | flash2_get_config_reg (flash2_t *ctx) |
Flash 2 Get Config Register. | |
void | flash2_write_enable (flash2_t *ctx) |
Flash 2 Write Enable. | |
void flash2_block_erase | ( | flash2_t * | ctx, |
uint32_t | address ) |
Flash 2 Block Erase.
ctx | Click object. |
address | - Address to start block erase from. |
@description The Block-Erase instruction clears all bits in the selected block to ‘1’. Block sizes can be 8 KByte, 32 KByte or 64 KByte depending on address. A Block-Erase instruction applied to a protected memory area will be ignored.
uint8_t flash2_busy | ( | flash2_t * | ctx | ) |
Flash 2 Busy.
ctx | Click object. |
void flash2_cfg_setup | ( | flash2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void flash2_chip_erase | ( | flash2_t * | ctx | ) |
Flash 2 Chip Erase.
ctx | Click object. |
@description The Chip-Erase instruction clears all bits in the device to ‘1.’ The Chip-Erase instruction is ignored if any of the memory area is protected.
uint8_t flash2_device_id | ( | flash2_t * | ctx | ) |
Flash 2 Device ID.
ctx | Click object. @description Using traditional SPI protocol, the JEDEC-ID Read instruction identifies the device as SST26VF064B/ 064BA and the manufacturer as Microchip®. |
uint8_t flash2_device_manufac | ( | flash2_t * | ctx | ) |
Flash 2 Device Manufacturer.
ctx | Click object. @description Using traditional SPI protocol, the JEDEC-ID Read instruction identifies the device as SST26VF064B/ 064BA and the manufacturer as Microchip®. |
uint8_t flash2_device_type | ( | flash2_t * | ctx | ) |
Flash 2 Device Type.
ctx | Click object. @description Using traditional SPI protocol, the JEDEC-ID Read instruction identifies the device as SST26VF064B/ 064BA and the manufacturer as Microchip®. |
uint8_t flash2_erase_status | ( | flash2_t * | ctx | ) |
Flash 2 Erase Status.
ctx | Click object. |
void flash2_generic_transfer | ( | flash2_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
uint8_t flash2_get_config_reg | ( | flash2_t * | ctx | ) |
Flash 2 Get Config Register.
ctx | Click object. @description The Read-Configuration Register command outputs the contents of the Configuration register. |
void flash2_get_sfdp_params | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 get Serial Flash Discoverable \ Parameters.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data into. |
data_count | - Amount of bytes to read. |
@description The Serial Flash Discoverable Parameters (SFDP) contain information describing the characteristics of the device. This allows device-independent, JEDEC ID- independent, and forward/backward compatible soft- ware support for all future Serial Flash device families.
uint8_t flash2_get_status_reg | ( | flash2_t * | ctx | ) |
Flash 2 Get Status Register.
ctx | Click object. |
@description The Read-Status Register command outputs the contents of the Status register.
void flash2_global_block_unlock | ( | flash2_t * | ctx | ) |
Flash 2 Global Block Unlock.
ctx | Click object. @description The Global Block-Protection Unlock instruction clears all write-protection bits in the Block-Protection register, except for those bits that have been locked down with the nVWLDR command. |
void flash2_highspeedRread | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 High Speed Read.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description The High-Speed Read instruction, 0BH, is supported in both SPI bus protocol and SQI protocol. This instruction supports frequencies of up to 104 MHz from 2.7-3.6V and up to 80 MHz from 2.3-3.6V.On power-up, the device is set to use SPI.
void flash2_hold_disable | ( | flash2_t * | ctx | ) |
Flash 2 Hold Disable.
ctx | Click object. @description Enables Hold on Flash 2 Click |
void flash2_hold_enable | ( | flash2_t * | ctx | ) |
Flash 2 Hold Enable.
ctx | Click object. @description Enables Hold on Flash 2 Click |
FLASH2_RETVAL flash2_init | ( | flash2_t * | ctx, |
flash2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void flash2_lock_security_id | ( | flash2_t * | ctx | ) |
flash2_lock_security_id
ctx | Click object. @description The Lockout Security ID instruction prevents any future changes to the Security ID, and is supported in both SPI and SQI modes. |
void flash2_lockBpr | ( | flash2_t * | ctx | ) |
Flash 2 Lock Block Protection Register.
ctx | Click object. @description The Lock-Down Block-Protection Register instruction prevents changes to the Block-Protection register during device operation. Lock-Down resets after power cycling; this allows the Block-Protection register to be changed. |
void flash2_nonvolatile_write_lock | ( | flash2_t * | ctx, |
uint8_t * | buffer ) |
Flash 2 Non-Volatile Write-Lock.
ctx | Click object. @description The Non-Volatile Write-Lock Lock-Down Register (nVWLDR) instruction controls the ability to change the Write-Lock bits in the Block-Protection register. |
buffer | - Buffer with new values for BPR register. |
uint8_t flash2_program_status | ( | flash2_t * | ctx | ) |
Flash 2 Program Status.
ctx | Click object. @description Checks if click write-program is suspended |
uint8_t flash2_protect_status | ( | flash2_t * | ctx | ) |
Flash 2 Protect Status.
ctx | Click object. @description Checks if click write-protect lock-down is suspended |
uint8_t flash2_quad_device_id | ( | flash2_t * | ctx | ) |
Flash 2 Quad Device ID.
ctx | Click object. @description The Read Quad J-ID Read instruction identifies the device as SST26VF064B/064BA and manufacturer as Microchip. |
uint8_t flash2_quad_device_manufac | ( | flash2_t * | ctx | ) |
Flash 2 Quad Device Manufacturer.
ctx | Click object. @description The Read Quad J-ID Read instruction identifies the device as SST26VF064B/064BA and manufacturer as Microchip. |
uint8_t flash2_quad_device_type | ( | flash2_t * | ctx | ) |
Flash 2 Quad Device Type.
ctx | Click object. @description The Read Quad J-ID Read instruction identifies the device as SST26VF064B/064BA and manufacturer as Microchip. |
void flash2_quad_enable | ( | flash2_t * | ctx | ) |
Flash 2 Quad Enable.
ctx | Click object. |
The Enable Quad I/O (EQIO) instruction, 38H, enables the flash device for SQI bus operation. Upon comple- tion of the instruction, all instructions thereafter are expected to be 4-bit multiplexed input/output (SQI mode) until a power cycle or a “Reset Quad I/O instruc- tion” is executed.
void flash2_quad_io_read | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t | mode, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Quad I/O Read.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
mode | - Mode to put Quad I/O in. |
@description The SPI Quad I/O Read (SQIOR) instruction supports frequencies of up to 104 MHz from 2.7-3.6V and up to 80 MHz from 2.3-3.6V. SST26VF064B requires the IOC bit in the configuration register to be set to ‘1’ prior to executing the command.
void flash2_quad_out_read | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Quad Output Read.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description The SPI Quad-Output Read instruction supports fre- quencies of up to 104 MHz from 2.7-3.6V and up to 80 MHz from 2.3-3.6V. SST26VF064B requires the IOC bit in the configuration register to be set to ‘1’ prior to exe- cuting the command.
void flash2_quad_reset | ( | flash2_t * | ctx | ) |
Flash 2 Quad Reset.
ctx | Click object. |
@description The Reset Quad I/O instruction, FFH, resets the device to 1-bit SPI protocol operation or exits the Set Mode configuration during a read sequence. This command allows the flash device to return to the default I/O state (SPI) without a power cycle, and executes in either 1- bit or 4-bit mode. If the device is in the Set Mode con- figuration, while in SQI High-Speed Read mode, the RSTQIO command will only return the device to a state where it can accept new command instruction. An addi- tional RSTQIO is required to reset the device to SPI mode.
void flash2_quadWrite | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Quad Write.
ctx | Click object. |
address | - Address to start write at. |
buffer | - Buffer with data to write. |
data_count | - Amount of bytes to write. |
@description The SPI Quad Page-Program instruction programs up to 256 Bytes of data in the memory. The data for the selected page address must be in the erased state (FFH) before initiating the SPI Quad Page-Program operation. A SPI Quad Page-Program applied to a pro- tected memory area will be ignored. SST26VF064B requires the ICO bit in the configuration register to be set to ‘1’ prior to executing the command.
void flash2_read_dual_io | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Read Dual I/O.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description Following the Set Mode configuration bits, the SST26VF064B/064BA outputs data from the specified address location. The device continually streams data output through all addresses until terminated by a low- to-high transition on CE#.
The Set Mode Configuration bit M[7:0] indicates if the next instruction cycle is another SPI Dual I/O Read command. When M[7:0] = AXH, the device expects the next continuous instruction to be another SDIOR com- mand, BBH, and does not require the op-code to be entered again. The host may set the next SDIOR cycle by driving CE# low, then sending the two-bit wide input for address A[23:0], followed by the Set Mode configu- ration bits M[7:0]. After the Set Mode configuration bits, the device outputs the data starting from the specified address location. There are no restrictions on address location access.
When M[7:0] is any value other than AXH, the device expects the next instruction initiated to be a command instruction. To reset/exit the Set Mode configuration, To reset/exit the Set Mode configuration, execute the Reset Quad I/O command.
void flash2_read_dual_output | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Read Dual Output.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description The SPI Dual-Output Read instruction supports fre- quencies of up to 104 MHz from 2.7-3.6V and up to 80 MHz from 2.3-3.6V.
void flash2_read_generic | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Read.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read to. |
data_count | - Amount of bytes to read. |
@description The Read instruction, 03H, is supported in SPI bus pro- tocol only with clock frequencies up to 40 MHz. This command is not supported in SQI bus protocol. The device outputs the data starting from the specified address location, theand Configuration n continuously streams the data output through all addresses until terminated by a low- to-high transition on CE#. The internal address pointer will automatically increment until the highest memory address is reached. Once the highest memory address is reached, the address pointer will automatically return to the beginning (wrap-around) of the address space.
void flash2_read_spi_burst_wrap | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Read Burst with Wrap through SPI.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description During RBSPI, the internal address pointer automati- cally increments until the last byte of the burst is reached, then it wraps around to the first byte of the burst. For example, if the burst length is eight Bytes, and the start address is 06h, the burst sequence would be: 06h, 07h, 00h, 01h, 02h, 03h, 04h, 05h, 06h, etc. The pattern repeats until the command is terminated by a low-to-high transition on CE#. During this operation, blocks that are Read-locked will output data 00H.
8 Bytes 00-07H, 08-0FH, 10-17H, 18-1FH... 16 Bytes 00-0FH, 10-1FH, 20-2FH, 30-3FH... 32 Bytes 00-1FH, 20-3FH, 40-5FH, 60-7FH... 64 Bytes 00-3FH, 40-7FH, 80-BFH, C0-FFH
void flash2_read_sqi_burst_wrap | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Read Burst with Wrap through SQI.
ctx | Click object. |
address | - Address to start reading from. |
buffer | - Buffer to read data to. |
data_count | - Amount of bytes to read. |
@description During RBSQI, the internal address pointer automati- cally increments until the last byte of the burst is reached, then it wraps around to the first byte of the burst. For example, if the burst length is eight Bytes, and the start address is 06h, the burst sequence would be: 06h, 07h, 00h, 01h, 02h, 03h, 04h, 05h, 06h, etc. The pattern repeats until the command is terminated by a low-to-high transition on CE#. During this operation, blocks that are Read-locked will output data 00H.
8 Bytes 00-07H, 08-0FH, 10-17H, 18-1FH... 16 Bytes 00-0FH, 10-1FH, 20-2FH, 30-3FH... 32 Bytes 00-1FH, 20-3FH, 40-5FH, 60-7FH... 64 Bytes 00-3FH, 40-7FH, 80-BFH, C0-FFH
void flash2_reset | ( | flash2_t * | ctx | ) |
Flash 2 Reset.
ctx | Click object. @description The Reset operation is used as a system (software) reset that puts the device in normal operating Ready mode. This operation consists of two commands: Reset-Enable (RSTEN) followed by Reset (RST). |
void flash2_sector_erase | ( | flash2_t * | ctx, |
uint32_t | address ) |
Flash 2 Sector Erase.
ctx | Click object. |
address | - Address to start sector erase from. |
@description The Sector-Erase instruction clears all bits in the selected 4 KByte sector to ‘1,’ but it does not change a protected memory area.
uint8_t flash2_security_status | ( | flash2_t * | ctx | ) |
Flash 2 Security Status.
ctx | Click object. @description Checks if click security ID is locked |
void flash2_set_bpr | ( | flash2_t * | ctx, |
uint8_t * | buffer ) |
Flash 2 Set Block Protection Register.
ctx | Click object. @description The Write Block-Protection Register command changes the Block-Protection register data to indicate the protection status. |
buffer | - Buffer with new BPR register values to write. |
void flash2_set_burst | ( | flash2_t * | ctx, |
uint8_t | length ) |
Flash 2 Set Burst.
ctx | Click object. |
length |
@description The Set Burst command specifies the number of bytes to be output during a Read Burst command before the device wraps around. It supports both SPI and SQI pro- tocols.
void flash2_set_security_id | ( | flash2_t * | ctx, |
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Set Security ID.
ctx | Click object. @description The Program Security ID instruction programs one to 2040 Bytes of data in the user-programmable, Security ID space. This Security ID space is one-time program- mable (OTP). The device ignores a Program Security ID instruction pointing to an invalid or protected address |
buffer | - Buffer to write into. |
data_count | - Amount of bytes to write. |
void flash2_spi_get_bpr | ( | flash2_t * | ctx, |
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Get Block Protection Register SPI.
ctx | Click object. @description The Read Block-Protection Register instruction outputs the Block-Protection register data which determines the protection status. |
buffer | - Buffer to read data into. |
data_count | - Amount of bytes to read. |
void flash2_spi_get_security_id | ( | flash2_t * | ctx, |
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Get Security ID SPI.
ctx | Click object. @description Reads the Unique ID Pre-Programmed at factory |
buffer | - Buffer to read data into. |
data_count | - Amount of bytes to read. |
void flash2_sqi_get_bpr | ( | flash2_t * | ctx, |
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Get Block Protection Register SQI.
ctx | Click object. @description The Read Block-Protection Register instruction outputs the Block-Protection register data which determines the protection status. |
buffer | - Buffer to read data into. |
data_count | - Amount of bytes to read. |
void flash2_sqi_get_security_id | ( | flash2_t * | ctx, |
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Get Security ID SQI.
ctx | Click object. @description Reads the Unique ID Pre-Programmed at factory |
buffer | - Buffer to read data into. |
data_count | - Amount of bytes to read. |
void flash2_write_disable | ( | flash2_t * | ctx | ) |
Flash 2 Write Disable.
ctx | Click object. @description The Write Disable instruction sets the Write- Enable-Latch bit in the Status register to ‘0,’ not allowing Write operations to occur. |
void flash2_write_enable | ( | flash2_t * | ctx | ) |
Flash 2 Write Enable.
ctx | Click object. @description The Write Enable (WREN) instruction sets the Write- Enable-Latch bit in the Status register to ‘1,’ allowing Write operations to occur. |
void flash2_write_generic | ( | flash2_t * | ctx, |
uint32_t | address, | ||
uint8_t * | buffer, | ||
uint32_t | data_count ) |
Flash 2 Write.
ctx | Click object. |
address | - Address to start write at. |
buffer | - Buffer with data to write. |
data_count | - Amount of bytes to write. |
@description The Page-Program instruction programs up to 256 Bytes of data in the memory, and supports both SPI and SQI protocols. The data for the selected page address must be in the erased state (FFH) before initi- ating the Page-Program operation. A Page-Program applied to a protected memory area will be ignored.
void flash2_write_protect_disable | ( | flash2_t * | ctx | ) |
Flash 2 Write Protect Disable.
ctx | Click object. @description Disables Write Protect on Flash 2 Click |
void flash2_write_protect_enable | ( | flash2_t * | ctx | ) |
Flash 2 Write Protect Enable.
ctx | Click object. @description Enables Write Protect on Flash 2 Click |
void flash2_write_resume | ( | flash2_t * | ctx | ) |
Flash 2 Write Resume.
ctx | Click object. @description Write-Suspend allows the interruption of Sector-Erase, Block-Erase, SPI Quad Page-Program, or Page-Pro- gram operations in order to erase, program, or read data in another portion of memory. The original opera- tion can be continued with the Write-Resume com- mand. This operation is supported in both SQI and SPI protocols. Only one write operation can be suspended at a time; if an operation is already suspended, the device will ignore the Write-Suspend command. Write-Suspend during Chip-Erase is ignored; Chip-Erase is not a valid command while a write is suspended. The Write- Resume command is ignored until any write operation (Program or Erase) initiated during the Write-Suspend is complete. The device requires a minimum of 500 μs between each Write-Suspend command. |
uint8_t flash2_write_status | ( | flash2_t * | ctx | ) |
Flash 2 Write Status.
ctx | Click object. @description Checks if click write is suspended |
void flash2_write_status_reg | ( | flash2_t * | ctx, |
uint8_t | s_reg ) |
Flash 2 Write Status Register.
ctx | Click object. @description The Write-Status Register (WRSR) command writes new values to the Configuration register. |
s_reg | - New Conifuration Register Values |
void flash2_write_suspend | ( | flash2_t * | ctx | ) |
Flash 2 Write Suspend.
ctx | Click object. @description Write-Suspend allows the interruption of Sector-Erase, Block-Erase, SPI Quad Page-Program, or Page-Pro- gram operations in order to erase, program, or read data in another portion of memory. The original opera- tion can be continued with the Write-Resume com- mand. This operation is supported in both SQI and SPI protocols. Only one write operation can be suspended at a time; if an operation is already suspended, the device will ignore the Write-Suspend command. Write-Suspend during Chip-Erase is ignored; Chip-Erase is not a valid command while a write is suspended. The Write- Resume command is ignored until any write operation (Program or Erase) initiated during the Write-Suspend is complete. The device requires a minimum of 500 μs between each Write-Suspend command. |