Specifications

return 0;
}
alt_lock_flash()
Prototype
int alt_lock_flash(alt_flash_dev * flash_info,
alt_u32 sectors_to_lock)
Commonly Called By
C/C++ programs
Device drivers
Thread-safe
No.
Available from ISR
No.
Include
<sys/alt_flash.h>
Description
Locking to range of the flash memory sectors, which protected from writing and erasing by passing the
uninteger 32 bits value to the sectors_to_lock argument, where this argument depends on the specific
flash device being used,and this argument value can be found in the flash device datasheet. The flash
devices can be supported are shown as below:
EPCQ16, EPCQ32, EPCQ64, EPCQ128, EPCQ256, N25Q512, EPCQ512, EPCQL512, EPCQL1024
More Micron flash devices will be supported in future, and being updated into this document.
Arguments
*flash_info: Pointer to general flash device structure.
sectors_to_locL Block protection bits in EPCQ/QSPI ==>Bit4 | Bit3 | Bit2 | Bit1 | Bit0 TB | BP3 | BP2 |
BP1 | BP0
Return
*0 > Success
-EINVL > Invalid arguments
-ETIME > Time out and skipping the looping after 0.7 sec
-ENOLCK > Sectors lock failed
6-22
alt_lock_flash()
NII5V2
2015.05.14
Altera Corporation
Developing Programs Using the Hardware Abstraction Layer
Send Feedback