AT25DFx SerialFlash driver private SPI HAL interface.
Copyright (C) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Private SPI helpers | |
#define | _at25dfx_spi_lock spi_master_vec_lock |
Alias for SPI lock function. More... | |
#define | _at25dfx_spi_unlock spi_master_vec_unlock |
Alias for SPI unlock function. More... | |
static void | _at25dfx_chip_issue_read_command_wait (struct at25dfx_chip_module *chip, struct at25dfx_command cmd) |
Issue a read command. More... | |
static void | _at25dfx_chip_issue_write_command_wait (struct at25dfx_chip_module *chip, struct at25dfx_command cmd) |
Issue a read command. More... | |
static enum status_code | _at25dfx_chip_get_nonbusy_status (struct at25dfx_chip_module *chip) |
Get status after current operation completes. More... | |
#define _at25dfx_spi_lock spi_master_vec_lock |
Alias for SPI lock function.
Referenced by at25dfx_chip_check_presence(), at25dfx_chip_erase(), at25dfx_chip_erase_block(), at25dfx_chip_get_sector_protect(), at25dfx_chip_read_buffer(), at25dfx_chip_set_global_sector_protect(), at25dfx_chip_set_sector_protect(), at25dfx_chip_sleep(), at25dfx_chip_wake(), and at25dfx_chip_write_buffer().
#define _at25dfx_spi_unlock spi_master_vec_unlock |
Alias for SPI unlock function.
Referenced by at25dfx_chip_check_presence(), at25dfx_chip_erase(), at25dfx_chip_erase_block(), at25dfx_chip_get_sector_protect(), at25dfx_chip_read_buffer(), at25dfx_chip_set_global_sector_protect(), at25dfx_chip_set_sector_protect(), at25dfx_chip_sleep(), at25dfx_chip_wake(), and at25dfx_chip_write_buffer().
|
inlinestatic |
Get status after current operation completes.
This function will issue a command to read out the status, and will then read the status continuously from the chip until it indicates that it is not busy. The error flag of the status is then checked, before returning the result.
chip | Address of SerialFlash chip instance to operate on. |
STATUS_OK | if operation succeeded. |
STATUS_ERR_IO | if an error occurred. |
References _at25dfx_chip_deselect(), _at25dfx_chip_select(), Assert, AT25DFX_COMMAND_READ_STATUS, AT25DFX_STATUS_BUSY, AT25DFX_STATUS_ERROR, data, spi_master_vec_bufdesc::data, spi_master_vec_bufdesc::length, NULL, spi_master_vec_get_job_status_wait(), spi_master_vec_transceive_buffer_job(), status, STATUS_ERR_IO, and STATUS_OK.
Referenced by at25dfx_chip_erase(), at25dfx_chip_erase_block(), and at25dfx_chip_write_buffer().
|
inlinestatic |
Issue a read command.
chip | Address of SerialFlash chip instance to operate on. |
cmd | The command to issue. |
References _at25dfx_chip_deselect(), _at25dfx_chip_select(), at25dfx_command::address, Assert, AT25DFX_COMMAND_MAX_SIZE, at25dfx_command::command_size, at25dfx_command::data, spi_master_vec_bufdesc::data, at25dfx_command::length, spi_master_vec_bufdesc::length, NULL, at25dfx_command::opcode, at25dfx_command::rx, spi_master_vec_get_job_status_wait(), spi_master_vec_transceive_buffer_job(), status, and STATUS_OK.
Referenced by at25dfx_chip_check_presence(), at25dfx_chip_get_sector_protect(), and at25dfx_chip_read_buffer().
|
inlinestatic |
Issue a read command.
chip | Address of SerialFlash chip instance to operate on. |
cmd | The command to issue. |
References _at25dfx_chip_deselect(), _at25dfx_chip_select(), at25dfx_command::address, Assert, AT25DFX_COMMAND_MAX_SIZE, at25dfx_command::command_size, at25dfx_command::data, spi_master_vec_bufdesc::data, at25dfx_command::length, spi_master_vec_bufdesc::length, NULL, at25dfx_command::opcode, spi_master_vec_get_job_status_wait(), spi_master_vec_transceive_buffer_job(), status, STATUS_OK, and at25dfx_command::tx.
Referenced by _at25dfx_chip_enable_write(), at25dfx_chip_erase(), at25dfx_chip_erase_block(), at25dfx_chip_set_global_sector_protect(), at25dfx_chip_set_sector_protect(), at25dfx_chip_sleep(), at25dfx_chip_wake(), and at25dfx_chip_write_buffer().