From 8558f203f1f20a81e96a9f5583da327d4b3f062d Mon Sep 17 00:00:00 2001 From: gitlab-runner Date: Sat, 26 Sep 2020 10:23:09 -0500 Subject: [PATCH] Upload serial-flash 1.0.2.17634 --- RELEASE.md | 11 +++-- cy_serial_flash_qspi.c | 11 +++++ cy_serial_flash_qspi.h | 44 ++++++++++------- docs/html/group__group__board__libs.html | 61 +++++++++++++++++++++++- docs/html/search/all_0.js | 2 + docs/html/search/functions_0.js | 2 + version.xml | 2 +- 7 files changed, 112 insertions(+), 21 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 1bb4505..3848448 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -8,6 +8,9 @@ Provides functions for interacting with an external flash connected through its * Allows for providing information to the programming tool to program the external memory. ### What Changed? +#### v1.0.2 +* Added new function cy_serial_flash_qspi_get_prog_size() to get the programming size +* Minor documentation updates #### v1.0.1 * Minor update for documentation & branding #### v1.0.0 @@ -18,11 +21,13 @@ This version of the Serial Flash library was validated for compatibility with th | Software and Tools | Version | | :--- | :----: | -| ModusToolbox Software Environment | 2.0 | -| GCC Compiler | 7.4 | -| IAR Compiler | 8.32 | +| ModusToolbox Software Environment | 2.1 | +| GCC Compiler | 9.2 | +| IAR Compiler | 8.4 | | ARM Compiler 6 | 6.11 | +Minimum required ModusToolbox Software Environment: v2.0 + ### More information * [API Reference Guide](https://cypresssemiconductorco.github.io/serial-flash/html/index.html) diff --git a/cy_serial_flash_qspi.c b/cy_serial_flash_qspi.c index 6c09a90..945f5af 100644 --- a/cy_serial_flash_qspi.c +++ b/cy_serial_flash_qspi.c @@ -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; } +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_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; } +void cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority) +{ + NVIC_SetPriority(smif_interrupt_IRQn, priority); +} + #if defined(__cplusplus) } #endif diff --git a/cy_serial_flash_qspi.h b/cy_serial_flash_qspi.h index 1b9154f..27bf4e9 100644 --- a/cy_serial_flash_qspi.h +++ b/cy_serial_flash_qspi.h @@ -48,11 +48,11 @@ extern "C" { /** * \brief Initializes the serial flash memory. This function accepts up to 8 * I/Os. Number of I/Os depend on the type of memory interface. Pass NC when an - * I/O is unused. + * I/O is unused. * Single SPI - (io0, io1) or (io2, io3) or (io4, io5) or (io6, io7) - * Dual SPI - (io0, io1) or (io2, io3) or (io4, io5) or (io6, io7) - * Quad SPI - (io0, io1, io2, io3) or (io4, io5, io6, io7) - * Octal SPI - All 8 I/Os are used. + * Dual SPI - (io0, io1) or (io2, io3) or (io4, io5) or (io6, io7) + * Quad SPI - (io0, io1, io2, io3) or (io4, io5, io6, io7) + * Octal SPI - All 8 I/Os are used. * \param mem_config Memory configuration to be used for initializing * \param io0 Data/IO pin 0 connected to the memory, Pass NC when unused. * \param io1 Data/IO pin 1 connected to the memory, Pass NC when unused. @@ -64,24 +64,22 @@ extern "C" { * \param io7 Data/IO pin 7 connected to the memory, Pass NC when unused. * \param sclk Clock 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 - * ignored currently. Change the CLK_HF frequency using either the - Device Configurator tool or the clock driver. + * \param hz Clock frequency to be used with the memory. * \returns CY_RSLT_SUCCESS if the initialization was successful, an error code * otherwise. */ -cy_rslt_t cy_serial_flash_qspi_init( +cy_rslt_t cy_serial_flash_qspi_init( const cy_stc_smif_mem_config_t* mem_config, - cyhal_gpio_t io0, - cyhal_gpio_t io1, - cyhal_gpio_t io2, + cyhal_gpio_t io0, + cyhal_gpio_t io1, + cyhal_gpio_t io2, cyhal_gpio_t io3, - cyhal_gpio_t io4, - cyhal_gpio_t io5, - cyhal_gpio_t io6, - cyhal_gpio_t io7, + cyhal_gpio_t io4, + cyhal_gpio_t io5, + cyhal_gpio_t io6, + cyhal_gpio_t io7, cyhal_gpio_t sclk, - cyhal_gpio_t ssel, + cyhal_gpio_t ssel, uint32_t hz); /** @@ -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); +/** + * \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 * 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); +/** + * \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) } #endif diff --git a/docs/html/group__group__board__libs.html b/docs/html/group__group__board__libs.html index 4c98f6d..cf37679 100644 --- a/docs/html/group__group__board__libs.html +++ b/docs/html/group__group__board__libs.html @@ -119,6 +119,9 @@ size_t cy_serial_flash_qspi_get_erase_size (uint32_t addr)  Returns the size of the erase sector to which the given address belongs. More...
  +size_t cy_serial_flash_qspi_get_prog_size (uint32_t addr) + Returns the page size for programming of the sector to which the given address belongs. More...
+  __STATIC_INLINE uint32_t cy_serial_flash_get_sector_start_address (uint32_t addr)  Utility function to calculate the starting address of an erase sector to which the given address belongs. More...
  @@ -134,6 +137,9 @@ cy_rslt_t cy_serial_flash_qspi_enable_xip (bool enable)  Enables Execute-in-Place (memory mapped) mode on the MCU. More...
  +void cy_serial_flash_qspi_set_interrupt_priority (uint8_t priority) + Changes QSPI interrupt priority. More...

Function Documentation

@@ -236,7 +242,7 @@

io7Data/IO pin 7 connected to the memory, Pass NC when unused. sclkClock pin connected to the memory sselSlave select pin connected to the memory - hzClock frequency to be used with the memory. This parameter is ignored currently. Change the CLK_HF frequency using either the Device Configurator tool or the clock driver. + hzClock frequency to be used with the memory. @@ -290,6 +296,33 @@

Returns
Erase sector size in bytes.
+ + +
+

◆ cy_serial_flash_qspi_get_prog_size()

+ +
+
+ + + + + + + + +
size_t cy_serial_flash_qspi_get_prog_size (uint32_t addr)
+
+ +

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.

Parameters
+ + +
addrAddress that belongs to the sector for which size is returned.
+
+
+
Returns
Page size in bytes.
+
@@ -473,6 +506,32 @@

Returns
CY_RSLT_SUCCESS if the operation was successful. CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED if the target does not support XIP.
+ + +
+

◆ cy_serial_flash_qspi_set_interrupt_priority()

+ +
+
+ + + + + + + + +
void cy_serial_flash_qspi_set_interrupt_priority (uint8_t priority)
+
+ +

Changes QSPI interrupt priority.

+
Parameters
+ + +
priorityinterrupt priority to be set
+
+
+
diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js index 6fef0a1..87adaf6 100644 --- a/docs/html/search/all_0.js +++ b/docs/html/search/all_0.js @@ -6,8 +6,10 @@ var searchData= ['cy_5fserial_5fflash_5fqspi_5fenable_5fxip',['cy_serial_flash_qspi_enable_xip',['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5ferase',['cy_serial_flash_qspi_erase',['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fget_5ferase_5fsize',['cy_serial_flash_qspi_get_erase_size',['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr): cy_serial_flash_qspi.c']]], + ['cy_5fserial_5fflash_5fqspi_5fget_5fprog_5fsize',['cy_serial_flash_qspi_get_prog_size',['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fget_5fsize',['cy_serial_flash_qspi_get_size',['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5finit',['cy_serial_flash_qspi_init',['../group__group__board__libs.html#gaa9c587684b8b629a0fde56e786400d82',1,'cy_serial_flash_qspi_init(const cy_stc_smif_mem_config_t *mem_config, cyhal_gpio_t io0, cyhal_gpio_t io1, cyhal_gpio_t io2, cyhal_gpio_t io3, cyhal_gpio_t io4, cyhal_gpio_t io5, cyhal_gpio_t io6, cyhal_gpio_t io7, cyhal_gpio_t sclk, cyhal_gpio_t ssel, uint32_t hz): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gaa9c587684b8b629a0fde56e786400d82',1,'cy_serial_flash_qspi_init(const cy_stc_smif_mem_config_t *mem_config, cyhal_gpio_t io0, cyhal_gpio_t io1, cyhal_gpio_t io2, cyhal_gpio_t io3, cyhal_gpio_t io4, cyhal_gpio_t io5, cyhal_gpio_t io6, cyhal_gpio_t io7, cyhal_gpio_t sclk, cyhal_gpio_t ssel, uint32_t hz): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fread',['cy_serial_flash_qspi_read',['../group__group__board__libs.html#ga8b700333be27d3f22dbf2b7a273e7f1e',1,'cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga8b700333be27d3f22dbf2b7a273e7f1e',1,'cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf): cy_serial_flash_qspi.c']]], + ['cy_5fserial_5fflash_5fqspi_5fset_5finterrupt_5fpriority',['cy_serial_flash_qspi_set_interrupt_priority',['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fwrite',['cy_serial_flash_qspi_write',['../group__group__board__libs.html#gab7e5444e256507f0bc5d112d6741621a',1,'cy_serial_flash_qspi_write(uint32_t addr, size_t length, const uint8_t *buf): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gab7e5444e256507f0bc5d112d6741621a',1,'cy_serial_flash_qspi_write(uint32_t addr, size_t length, const uint8_t *buf): cy_serial_flash_qspi.c']]] ]; diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 94718aa..434f006 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -5,8 +5,10 @@ var searchData= ['cy_5fserial_5fflash_5fqspi_5fenable_5fxip',['cy_serial_flash_qspi_enable_xip',['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5ferase',['cy_serial_flash_qspi_erase',['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fget_5ferase_5fsize',['cy_serial_flash_qspi_get_erase_size',['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr): cy_serial_flash_qspi.c']]], + ['cy_5fserial_5fflash_5fqspi_5fget_5fprog_5fsize',['cy_serial_flash_qspi_get_prog_size',['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fget_5fsize',['cy_serial_flash_qspi_get_size',['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5finit',['cy_serial_flash_qspi_init',['../group__group__board__libs.html#gaa9c587684b8b629a0fde56e786400d82',1,'cy_serial_flash_qspi_init(const cy_stc_smif_mem_config_t *mem_config, cyhal_gpio_t io0, cyhal_gpio_t io1, cyhal_gpio_t io2, cyhal_gpio_t io3, cyhal_gpio_t io4, cyhal_gpio_t io5, cyhal_gpio_t io6, cyhal_gpio_t io7, cyhal_gpio_t sclk, cyhal_gpio_t ssel, uint32_t hz): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gaa9c587684b8b629a0fde56e786400d82',1,'cy_serial_flash_qspi_init(const cy_stc_smif_mem_config_t *mem_config, cyhal_gpio_t io0, cyhal_gpio_t io1, cyhal_gpio_t io2, cyhal_gpio_t io3, cyhal_gpio_t io4, cyhal_gpio_t io5, cyhal_gpio_t io6, cyhal_gpio_t io7, cyhal_gpio_t sclk, cyhal_gpio_t ssel, uint32_t hz): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fread',['cy_serial_flash_qspi_read',['../group__group__board__libs.html#ga8b700333be27d3f22dbf2b7a273e7f1e',1,'cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga8b700333be27d3f22dbf2b7a273e7f1e',1,'cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t *buf): cy_serial_flash_qspi.c']]], + ['cy_5fserial_5fflash_5fqspi_5fset_5finterrupt_5fpriority',['cy_serial_flash_qspi_set_interrupt_priority',['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority): cy_serial_flash_qspi.c']]], ['cy_5fserial_5fflash_5fqspi_5fwrite',['cy_serial_flash_qspi_write',['../group__group__board__libs.html#gab7e5444e256507f0bc5d112d6741621a',1,'cy_serial_flash_qspi_write(uint32_t addr, size_t length, const uint8_t *buf): cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gab7e5444e256507f0bc5d112d6741621a',1,'cy_serial_flash_qspi_write(uint32_t addr, size_t length, const uint8_t *buf): cy_serial_flash_qspi.c']]] ]; diff --git a/version.xml b/version.xml index 16604c7..21856f3 100644 --- a/version.xml +++ b/version.xml @@ -1 +1 @@ -1.0.1.15154 +1.0.2.17634