Microchip® Advanced Software Framework

spi_master_vec/at25dfx_priv_hal.h File Reference

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...
 

static enum status_code _at25dfx_chip_get_nonbusy_status ( struct at25dfx_chip_module chip)
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.

Parameters
chipAddress of SerialFlash chip instance to operate on.
Returns
Status of the operation.
Return values
STATUS_OKif operation succeeded.
STATUS_ERR_IOif 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().