Low-level driver for the S25FL1XX Series QSPI Flash controller.
This driver provides access to the main features of the S25FL1XX Series QSPI Flash.
Macros | |
#define | PAGE_SIZE 256 |
Functions | |
static uint8_t | s25fl1xx_check_protected_addr (uint8_t status1, uint32_t addr) |
Check weather the address of addr is protected. More... | |
void | s25fl1xx_continous_read_mode_reset (struct qspid_t *qspid) |
Issue 'CContinuous Read Mode' command, the device can return to normal SPI command mode, in which all commands can be accepts. More... | |
uint8_t | s25fl1xx_data_protect (struct qspid_t *qspid, bool dir, enum block_size protect_size) |
Protect the contents of the serial flash device. More... | |
uint8_t | s25fl1xx_data_unprotect (struct qspid_t *qspid) |
Unprotected the contents of the serial flash device. More... | |
static void | s25fl1xx_disable_write (struct qspid_t *qspid) |
Disable write option to serial flash memory. More... | |
void | s25fl1xx_enable_wrap (struct qspid_t *qspid, uint8_t byte_align) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc. More... | |
static void | s25fl1xx_enable_write (struct qspid_t *qspid) |
Enable write option to serial flash memory. More... | |
void | s25fl1xx_enter_continous_read_mode (struct qspid_t *qspid) |
Reads data from the specified address on the serial flash. More... | |
uint8_t | s25fl1xx_erase_64k_block (struct qspid_t *qspid, uint32_t address) |
Erases the specified 64KB block of the serial firmware dataflash. More... | |
uint8_t | s25fl1xx_erase_chip (struct qspid_t *qspid) |
Erases all the content of the memory chip. More... | |
uint8_t | s25fl1xx_erase_sector (struct qspid_t *qspid, uint32_t address) |
Erases the specified block of the serial firmware dataflash. More... | |
static void | s25fl1xx_exec_command (struct qspid_t *qspid, uint8_t instr, uint32_t *tx_data, uint32_t *rx_data, enum qspi_access read_write, uint32_t size) |
Send command to the serial flash. More... | |
enum status_code | s25fl1xx_initialize (Qspi *qspi, struct qspi_config_t *mode_config, uint32_t use_default_config) |
Initialize QSPI serial memory mode. More... | |
static void | s25fl1xx_memory_access (struct qspid_t *qspid, uint8_t instr, uint32_t addr, uint32_t *tx_data, uint32_t *rx_data, enum qspi_access read_write, uint32_t size, uint8_t secure) |
Read/write data from serial flash memory. More... | |
uint8_t | s25fl1xx_protect (struct qspid_t *qspid) |
Unprotected the contents of the serial flash device. More... | |
uint8_t | s25fl1xx_read (struct qspid_t *qspid, uint32_t *data, uint32_t size, uint32_t address) |
Reads data from the specified address on the serial flash. More... | |
uint8_t | s25fl1xx_read_dual (struct qspid_t *qspid, uint32_t *data, uint32_t size, uint32_t address) |
Reads data from the specified address on the serial flash. More... | |
uint8_t | s25fl1xx_read_dual_io (struct qspid_t *qspid, uint32_t *data, uint32_t size, uint32_t address, uint8_t cont_mode, uint8_t secure) |
Reads data from the specified address on the serial flash. More... | |
uint32_t | s25fl1xx_read_jedec_id (struct qspid_t *qspid) |
Reads and returns the serial flash device ID. More... | |
uint8_t | s25fl1xx_read_quad (struct qspid_t *qspid, uint32_t *data, uint32_t size, uint32_t address) |
Reads data from the specified address on the serial flash. More... | |
uint8_t | s25fl1xx_read_quad_io (struct qspid_t *qspid, uint32_t *data, uint32_t size, uint32_t address, uint8_t cont_mode, uint8_t secure) |
Reads data from the specified address on the serial flash. More... | |
static uint32_t | s25fl1xx_read_status (struct qspid_t *qspid) |
Reads and returns the status register of the serial flash. More... | |
static uint8_t | s25fl1xx_read_status1 (struct qspid_t *qspid) |
Reads and returns the status register of the serial flash. More... | |
static uint8_t | s25fl1xx_read_status2 (struct qspid_t *qspid) |
Reads and returns the status register of the serial flash. More... | |
static uint8_t | s25fl1xx_read_status3 (struct qspid_t *qspid) |
Reads and returns the status register of the serial flash. More... | |
void | s25fl1xx_set_quad_mode (struct qspid_t *qspid, uint8_t mode) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc. More... | |
void | s25fl1xx_set_read_latency_control (struct qspid_t *qspid, uint8_t latency) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc. More... | |
void | s25fl1xx_soft_reset (struct qspid_t *qspid) |
s25fl1d software reset. More... | |
uint8_t | s25fl1xx_unprotect (struct qspid_t *qspid) |
Unprotected the control bits of the serial flash device. More... | |
static void | s25fl1xx_wait_memory_access_end (struct qspid_t *qspid) |
Wait for transfer to finish calling the SPI driver ISR. More... | |
uint8_t | s25fl1xx_write (struct qspid_t *qspid, uint32_t *pdata, uint32_t size, uint32_t address, uint8_t secure) |
Writes data at the specified address on the serial firmware dataflash. More... | |
static void | s25fl1xx_write_status (struct qspid_t *qspid, uint8_t *status) |
Writes the given value in the status register of the serial flash device. More... | |
static void | s25fl1xx_write_volatile_status (struct qspid_t *qspid, uint8_t *status) |
Writes the given value in the status register of the serial flash device. More... | |
Variables | |
struct qspi_inst_frame_t * | dev |
struct qspi_inst_frame_t * | mem |
#define PAGE_SIZE 256 |
Referenced by s25fl1xx_write().
|
static |
Check weather the address of addr is protected.
qspid | Pointer to an S25FL1 qspid_t struct. |
addr | Address to be checked. |
References S25FL1XX_BLOCK_PROTECT_Msk, S25FL1XX_SEC_PROTECT_Msk, and S25FL1XX_TOP_BTM_PROTECT_Msk.
Referenced by s25fl1xx_erase_sector().
void s25fl1xx_continous_read_mode_reset | ( | struct qspid_t * | qspid | ) |
Issue 'CContinuous Read Mode' command, the device can return to normal SPI command mode, in which all commands can be accepts.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_CMD_ACCESS, S25FL1XX_CONT_MODE_RESET, and s25fl1xx_exec_command().
uint8_t s25fl1xx_data_protect | ( | struct qspid_t * | qspid, |
bool | dir, | ||
enum block_size | protect_size | ||
) |
Protect the contents of the serial flash device.
qspid | Pointer to an S25FL1 qspid_t struct. |
dir | Data protect direction. |
size | Data size to be protect. |
References S25FL1XX_ERROR_PROTECTED, s25fl1xx_read_status(), s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_SIZE_32K, S25FL1XX_SIZE_64K, s25fl1xx_write_status(), and status.
uint8_t s25fl1xx_data_unprotect | ( | struct qspid_t * | qspid | ) |
Unprotected the contents of the serial flash device.
qspid | Pointer to an S25FL1 qspid_t struct. |
References S25FL1XX_CHIP_PROTECT_Msk, S25FL1XX_ERROR_PROTECTED, s25fl1xx_read_status(), s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), s25fl1xx_write_status(), and status.
|
static |
Disable write option to serial flash memory.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_CMD_ACCESS, s25fl1xx_exec_command(), s25fl1xx_read_status1(), S25FL1XX_STATUS_WEL, S25FL1XX_WRITE_DISABLE, and status.
Referenced by s25fl1xx_write(), s25fl1xx_write_status(), and s25fl1xx_write_volatile_status().
void s25fl1xx_enable_wrap | ( | struct qspid_t * | qspid, |
uint8_t | byte_align | ||
) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
qspid | Pointer to an S25FL1 qspid_t struct. |
byte_align | Burst wrap length to be set. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_WRITE_ACCESS, s25fl1xx_exec_command(), s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_WRAP_ENABLE, s25fl1xx_write_volatile_status(), and status.
|
static |
Enable write option to serial flash memory.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_CMD_ACCESS, s25fl1xx_exec_command(), s25fl1xx_read_status1(), S25FL1XX_STATUS_WEL, S25FL1XX_WRITE_ENABLE, and status.
Referenced by s25fl1xx_erase_64k_block(), s25fl1xx_erase_chip(), s25fl1xx_erase_sector(), s25fl1xx_write(), and s25fl1xx_write_status().
void s25fl1xx_enter_continous_read_mode | ( | struct qspid_t * | qspid | ) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_continues_read, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_len, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, qspi_mem_cmd_t::option, qspid_t::qspi_command, QSPI_READ_ACCESS, s25fl1xx_memory_access(), and S25FL1XX_READ_ARRAY_QUAD_IO.
uint8_t s25fl1xx_erase_64k_block | ( | struct qspid_t * | qspid, |
uint32_t | address | ||
) |
Erases the specified 64KB block of the serial firmware dataflash.
qspid | Pointer to an S25FL1 qspid_t struct. |
address | Address of the block to erase. |
References qspi_inst_frame_t::addr, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_addr_en, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_CMD_ACCESS, S25FL1XX_BLOCK_ERASE_64K, s25fl1xx_enable_write(), S25FL1XX_ERROR_BUSY, S25FL1XX_ERROR_PROTECTED, s25fl1xx_exec_command(), s25fl1xx_read_status(), S25FL1XX_STATUS_RDYBSY, S25FL1XX_STATUS_RDYBSY_READY, S25FL1XX_STATUS_SWP, S25FL1XX_STATUS_SWP_PROTNONE, s25fl1xx_wait_memory_access_end(), and status.
uint8_t s25fl1xx_erase_chip | ( | struct qspid_t * | qspid | ) |
Erases all the content of the memory chip.
qspid | Pointer to an S25FL1 qspid_t struct. |
References delay_ms, QSPI_CMD_ACCESS, S25FL1XX_CHIP_ERASE_2, S25FL1XX_CHIP_PROTECT_Msk, s25fl1xx_enable_write(), s25fl1xx_exec_command(), s25fl1xx_read_status1(), S25FL1XX_STATUS_RDYBSY, and status.
uint8_t s25fl1xx_erase_sector | ( | struct qspid_t * | qspid, |
uint32_t | address | ||
) |
Erases the specified block of the serial firmware dataflash.
qspid | Pointer to an S25FL1 qspid_t struct. |
address | Address of the block to erase. |
References qspi_inst_frame_t::addr, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_addr_en, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_CMD_ACCESS, S25FL1XX_BLOCK_ERASE_4K, S25FL1XX_BLOCK_PROTECT_Msk, s25fl1xx_check_protected_addr(), s25fl1xx_enable_write(), S25FL1XX_ERROR_BUSY, S25FL1XX_ERROR_PROTECTED, s25fl1xx_exec_command(), s25fl1xx_read_status1(), S25FL1XX_STATUS_RDYBSY, S25FL1XX_STATUS_RDYBSY_READY, s25fl1xx_wait_memory_access_end(), and status.
|
static |
Send command to the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
instr | Instruction to be execute. |
tx_data | Data buffer to send data. |
rx_data | Data buffer to receive data. |
read_write | Read/write access. |
size | Data size to be read/write. |
To prevent unaligned access
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_data_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_inst_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_tfr_type, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_buffer_t::data_rx, qspi_buffer_t::data_tx, dev, qspi_inst_frame_t::inst_frame, qspi_mem_cmd_t::instruction, qspid_t::qspi_buffer, QSPI_CMD_ACCESS, qspid_t::qspi_command, qspi_flash_execute_command(), qspid_t::qspi_frame, QSPI_WRITE_ACCESS, qspi_buffer_t::rx_data_size, and qspi_buffer_t::tx_data_size.
Referenced by s25fl1xx_continous_read_mode_reset(), s25fl1xx_disable_write(), s25fl1xx_enable_wrap(), s25fl1xx_enable_write(), s25fl1xx_erase_64k_block(), s25fl1xx_erase_chip(), s25fl1xx_erase_sector(), s25fl1xx_read_jedec_id(), s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), s25fl1xx_soft_reset(), s25fl1xx_write_status(), and s25fl1xx_write_volatile_status().
enum status_code s25fl1xx_initialize | ( | Qspi * | qspi, |
struct qspi_config_t * | mode_config, | ||
uint32_t | use_default_config | ||
) |
Initialize QSPI serial memory mode.
qspi | Pointer to an S25FL1 qspid_t struct. |
mode_config | Configure settings to config qspid. |
use_default_config | Config QSPI use default configures. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, qspi_get_config_default(), qspi_initialize(), status, and STATUS_OK.
|
static |
Read/write data from serial flash memory.
qspid | Pointer to an S25FL1 qspid_t struct.. |
instr | Instruction to be execute. |
addr | Address to send frame. |
tx_data | Data buffer to send data. |
rx_data | Data buffer to receive data. |
read_write | Read/write access. |
size | Data size to be read/write. |
secure | Enable or disable scramble on QSPI. |
References qspi_inst_frame_t::addr, addr, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_addr_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_data_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_inst_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_tfr_type, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_buffer_t::data_rx, qspi_buffer_t::data_tx, qspi_inst_frame_t::inst_frame, qspi_mem_cmd_t::instruction, mem, qspid_t::qspi_buffer, qspid_t::qspi_command, qspi_flash_access_memory(), qspid_t::qspi_frame, QSPI_WRITE_ACCESS, qspi_buffer_t::rx_data_size, and qspi_buffer_t::tx_data_size.
Referenced by s25fl1xx_enter_continous_read_mode(), s25fl1xx_read(), s25fl1xx_read_dual(), s25fl1xx_read_dual_io(), s25fl1xx_read_quad(), s25fl1xx_read_quad_io(), and s25fl1xx_write().
uint8_t s25fl1xx_protect | ( | struct qspid_t * | qspid | ) |
Unprotected the contents of the serial flash device.
qspid | Pointer to an S25FL1 driver instance. |
References S25FL1XX_ERROR_PROTECTED, s25fl1xx_read_status(), s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_STATUS_SPRL, S25FL1XX_STATUS_SPRL_LOCKED, S25FL1XX_STATUS_SWP, s25fl1xx_write_status(), and status.
uint8_t s25fl1xx_read | ( | struct qspid_t * | qspid, |
uint32_t * | data, | ||
uint32_t | size, | ||
uint32_t | address | ||
) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
data | Data buffer. |
size | Number of bytes to read. |
address | Read address. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_READ_ACCESS, s25fl1xx_memory_access(), S25FL1XX_READ_ARRAY, and secure().
uint8_t s25fl1xx_read_dual | ( | struct qspid_t * | qspid, |
uint32_t * | data, | ||
uint32_t | size, | ||
uint32_t | address | ||
) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
data | Data buffer. |
size | Number of bytes to read. |
address | Read address. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_READ_ACCESS, s25fl1xx_memory_access(), S25FL1XX_READ_ARRAY_DUAL, and secure().
uint8_t s25fl1xx_read_dual_io | ( | struct qspid_t * | qspid, |
uint32_t * | data, | ||
uint32_t | size, | ||
uint32_t | address, | ||
uint8_t | cont_mode, | ||
uint8_t | secure | ||
) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
data | Data buffer. |
size | Number of bytes to read. |
address | Read address. |
cont_mode | Continue read mode. |
secure | Enable or disable scramble on QSPI. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_continues_read, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_len, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, qspi_mem_cmd_t::option, qspid_t::qspi_command, QSPI_READ_ACCESS, s25fl1xx_memory_access(), and S25FL1XX_READ_ARRAY_DUAL_IO.
uint32_t s25fl1xx_read_jedec_id | ( | struct qspid_t * | qspid | ) |
Reads and returns the serial flash device ID.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_READ_ACCESS, s25fl1xx_exec_command(), and S25FL1XX_READ_JEDEC_ID.
uint8_t s25fl1xx_read_quad | ( | struct qspid_t * | qspid, |
uint32_t * | data, | ||
uint32_t | size, | ||
uint32_t | address | ||
) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
data | Data buffer. |
size | Number of bytes to read. |
address | Read address. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, QSPI_READ_ACCESS, s25fl1xx_memory_access(), S25FL1XX_READ_ARRAY_QUAD, and secure().
uint8_t s25fl1xx_read_quad_io | ( | struct qspid_t * | qspid, |
uint32_t * | data, | ||
uint32_t | size, | ||
uint32_t | address, | ||
uint8_t | cont_mode, | ||
uint8_t | secure | ||
) |
Reads data from the specified address on the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
data | Data buffer. |
size | Number of bytes to read. |
address | Read address. |
cont_mode | Continue read mode. |
secure | Enable or disable scramble on QSPI. |
References qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_continues_read, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_dummy_cycles, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_en, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_opt_len, qspi_inst_frame_t::_qspiinst_frame::_qspiinst_frame_bitmap::b_width, qspi_inst_frame_t::_qspiinst_frame::bm, qspi_inst_frame_t::inst_frame, qspi_mem_cmd_t::option, qspid_t::qspi_command, QSPI_READ_ACCESS, s25fl1xx_memory_access(), and S25FL1XX_READ_ARRAY_QUAD_IO.
|
static |
Reads and returns the status register of the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
References s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), and status.
Referenced by s25fl1xx_data_protect(), s25fl1xx_data_unprotect(), s25fl1xx_erase_64k_block(), and s25fl1xx_protect().
|
static |
Reads and returns the status register of the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_READ_ACCESS, s25fl1xx_exec_command(), S25FL1XX_READ_STATUS_1, and status.
Referenced by s25fl1xx_data_protect(), s25fl1xx_data_unprotect(), s25fl1xx_disable_write(), s25fl1xx_enable_wrap(), s25fl1xx_enable_write(), s25fl1xx_erase_chip(), s25fl1xx_erase_sector(), s25fl1xx_protect(), s25fl1xx_read_status(), s25fl1xx_set_quad_mode(), s25fl1xx_set_read_latency_control(), s25fl1xx_unprotect(), and s25fl1xx_wait_memory_access_end().
|
static |
Reads and returns the status register of the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_READ_ACCESS, s25fl1xx_exec_command(), S25FL1XX_READ_STATUS_2, and status.
Referenced by s25fl1xx_data_protect(), s25fl1xx_data_unprotect(), s25fl1xx_enable_wrap(), s25fl1xx_protect(), s25fl1xx_read_status(), s25fl1xx_set_quad_mode(), s25fl1xx_set_read_latency_control(), and s25fl1xx_unprotect().
|
static |
Reads and returns the status register of the serial flash.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_READ_ACCESS, s25fl1xx_exec_command(), S25FL1XX_READ_STATUS_3, and status.
Referenced by s25fl1xx_data_protect(), s25fl1xx_data_unprotect(), s25fl1xx_enable_wrap(), s25fl1xx_protect(), s25fl1xx_read_status(), s25fl1xx_set_quad_mode(), s25fl1xx_set_read_latency_control(), and s25fl1xx_unprotect().
void s25fl1xx_set_quad_mode | ( | struct qspid_t * | qspid, |
uint8_t | mode | ||
) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
qspid | Pointer to an S25FL1 qspid_t struct. |
mode | Mode to be set. |
References delay_ms, s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_STATUS_QUAD_ENABLE, s25fl1xx_write_status(), and status.
void s25fl1xx_set_read_latency_control | ( | struct qspid_t * | qspid, |
uint8_t | latency | ||
) |
Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.
qspid | Pointer to an S25FL1 qspid_t struct. |
latency | Latency control. |
References qspi_buffer_t::data_tx, delay_ms, qspid_t::qspi_buffer, s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_STATUS_LATENCY_CTRL, s25fl1xx_write_volatile_status(), and status.
void s25fl1xx_soft_reset | ( | struct qspid_t * | qspid | ) |
s25fl1d software reset.
qspid | Pointer to an S25FL1 qspid_t struct. |
References QSPI_CMD_ACCESS, s25fl1xx_exec_command(), S25FL1XX_SOFT_RESET, and S25FL1XX_SOFT_RESET_ENABLE.
uint8_t s25fl1xx_unprotect | ( | struct qspid_t * | qspid | ) |
Unprotected the control bits of the serial flash device.
qspid | Pointer to an S25FL1 qspid_t struct. |
References S25FL1XX_ERROR_PROTECTED, s25fl1xx_read_status1(), s25fl1xx_read_status2(), s25fl1xx_read_status3(), S25FL1XX_STATUS_SPRL, S25FL1XX_STATUS_SPRL_LOCKED, S25FL1XX_STATUS_SWP, S25FL1XX_STATUS_SWP_PROTNONE, s25fl1xx_write_status(), and status.
|
static |
Wait for transfer to finish calling the SPI driver ISR.
(interrupts are disabled)
qspid | Pointer to an S25FL1 qspid_t struct. |
References s25fl1xx_read_status1(), and S25FL1XX_STATUS_RDYBSY.
Referenced by s25fl1xx_erase_64k_block(), s25fl1xx_erase_sector(), and s25fl1xx_write().
uint8_t s25fl1xx_write | ( | struct qspid_t * | qspid, |
uint32_t * | pdata, | ||
uint32_t | size, | ||
uint32_t | address, | ||
uint8_t | secure | ||
) |
Writes data at the specified address on the serial firmware dataflash.
The page(s) to program must have been erased prior to writing. This function handles page boundary crossing automatically.
qspid | Pointer to an S25FL1 qspid_t struct. |
pData | Data buffer. |
size | Number of bytes in buffer. |
address | Write address. |
secure | Enable or disable scramble on QSPI. |
Size / page_zize
If less than page size
Multiple page
References addr, PAGE_SIZE, QSPI_WRITE_ACCESS, S25FL1XX_BYTE_PAGE_PROGRAM, s25fl1xx_disable_write(), s25fl1xx_enable_write(), s25fl1xx_memory_access(), and s25fl1xx_wait_memory_access_end().
|
static |
Writes the given value in the status register of the serial flash device.
qspid | Pointer to an S25FL1 qspid_t struct. |
status | Status to write. |
References QSPI_WRITE_ACCESS, s25fl1xx_disable_write(), s25fl1xx_enable_write(), s25fl1xx_exec_command(), and S25FL1XX_WRITE_STATUS.
Referenced by s25fl1xx_data_protect(), s25fl1xx_data_unprotect(), s25fl1xx_protect(), s25fl1xx_set_quad_mode(), and s25fl1xx_unprotect().
|
static |
Writes the given value in the status register of the serial flash device.
qspid | Pointer to an S25FL1 qspid_t struct. |
status | Status to write. |
References QSPI_CMD_ACCESS, QSPI_WRITE_ACCESS, s25fl1xx_disable_write(), s25fl1xx_exec_command(), and S25FL1XX_WRITE_STATUS.
Referenced by s25fl1xx_enable_wrap(), and s25fl1xx_set_read_latency_control().
struct qspi_inst_frame_t* dev |
struct qspi_inst_frame_t* mem |
Referenced by mem_free(), mem_init(), mem_malloc(), mem_trim(), plug_holes(), and s25fl1xx_memory_access().