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_lock |
Alias for SPI lock function. More... | |
#define | _at25dfx_spi_unlock spi_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_lock |
Alias for SPI lock function.
#define _at25dfx_spi_unlock spi_unlock |
Alias for SPI unlock function.
|
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, spi_is_ready_to_read(), spi_is_ready_to_write(), spi_read(), spi_write(), status, STATUS_ERR_IO, STATUS_OK, and UNUSED.
|
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, at25dfx_command::length, at25dfx_command::opcode, at25dfx_command::rx, spi_read_buffer_wait(), spi_write_buffer_wait(), status, STATUS_OK, and UNUSED.
|
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, at25dfx_command::length, at25dfx_command::opcode, spi_write_buffer_wait(), status, STATUS_OK, at25dfx_command::tx, and UNUSED.