Update Cypress serial flash asset to 1.0.2.17634

pull/14062/head
Dustin Crossman 2020-12-01 14:59:01 -08:00 committed by Dustin Crossman
parent ee7c7bda37
commit 5a3af0039f
3 changed files with 42 additions and 19 deletions

View File

@ -10,7 +10,7 @@
* *
******************************************************************************** ********************************************************************************
* \copyright * \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation * Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -8,7 +8,7 @@
* *
******************************************************************************** ********************************************************************************
* \copyright * \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation * Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -160,6 +160,12 @@ size_t cy_serial_flash_qspi_get_erase_size(uint32_t addr)
return (size_t)qspi_block_config.memConfig[MEM_SLOT]->deviceCfg->eraseSize; return (size_t)qspi_block_config.memConfig[MEM_SLOT]->deviceCfg->eraseSize;
} }
size_t cy_serial_flash_qspi_get_prog_size(uint32_t addr)
{
CY_UNUSED_PARAMETER(addr);
return (size_t)qspi_block_config.memConfig[MEM_SLOT]->deviceCfg->programSize;
}
cy_rslt_t cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf) cy_rslt_t cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf)
{ {
/* Cy_SMIF_MemRead() returns error if (addr + length) > total flash size. */ /* Cy_SMIF_MemRead() returns error if (addr + length) > total flash size. */
@ -215,6 +221,11 @@ cy_rslt_t cy_serial_flash_qspi_enable_xip(bool enable)
return CY_RSLT_SUCCESS; return CY_RSLT_SUCCESS;
} }
void cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority)
{
NVIC_SetPriority(smif_interrupt_IRQn, priority);
}
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif

View File

@ -8,7 +8,7 @@
* *
******************************************************************************** ********************************************************************************
* \copyright * \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation * Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -64,9 +64,7 @@ extern "C" {
* \param io7 Data/IO pin 7 connected to the memory, Pass NC when unused. * \param io7 Data/IO pin 7 connected to the memory, Pass NC when unused.
* \param sclk Clock pin connected to the memory * \param sclk Clock pin connected to the memory
* \param ssel Slave select pin connected to the memory * \param ssel Slave select pin connected to the memory
* \param hz Clock frequency to be used with the memory. This parameter is * \param hz Clock frequency to be used with the memory.
* ignored currently. Change the CLK_HF frequency using either the
Device Configurator tool or the clock driver.
* \returns CY_RSLT_SUCCESS if the initialization was successful, an error code * \returns CY_RSLT_SUCCESS if the initialization was successful, an error code
* otherwise. * otherwise.
*/ */
@ -103,6 +101,14 @@ size_t cy_serial_flash_qspi_get_size(void);
*/ */
size_t cy_serial_flash_qspi_get_erase_size(uint32_t addr); size_t cy_serial_flash_qspi_get_erase_size(uint32_t addr);
/**
* \brief Returns the page size for programming of the sector to which the given
* address belongs. Address is used only for a memory with hybrid sector size.
* \param addr Address that belongs to the sector for which size is returned.
* \returns Page size in bytes.
*/
size_t cy_serial_flash_qspi_get_prog_size(uint32_t addr);
/** /**
* \brief Utility function to calculate the starting address of an erase sector * \brief Utility function to calculate the starting address of an erase sector
* to which the given address belongs. * to which the given address belongs.
@ -165,6 +171,12 @@ cy_rslt_t cy_serial_flash_qspi_erase(uint32_t addr, size_t length);
*/ */
cy_rslt_t cy_serial_flash_qspi_enable_xip(bool enable); cy_rslt_t cy_serial_flash_qspi_enable_xip(bool enable);
/**
* \brief Changes QSPI interrupt priority
* \param priority interrupt priority to be set
*/
void cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif