Microchip® Advanced Software Framework

spi_polled/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_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.

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, spi_is_ready_to_read(), spi_is_ready_to_write(), spi_read(), spi_write(), status, STATUS_ERR_IO, STATUS_OK, and UNUSED.

static void _at25dfx_chip_issue_read_command_wait ( struct at25dfx_chip_module chip,
struct at25dfx_command  cmd 
)
inlinestatic
static void _at25dfx_chip_issue_write_command_wait ( struct at25dfx_chip_module chip,
struct at25dfx_command  cmd 
)
inlinestatic