提交 a0be4ee3 编写于 作者: R Rbb666 提交者: guo

Add uart0-5 configure

上级 fc5dfaf5
......@@ -19,12 +19,19 @@ if GetDepend(['RT_USING_SERIAL']):
src += ['drv_uart.c']
if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
if GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2'):
if GetDepend('BSP_USING_I2C1'):
src += ['drv_soft_i2c.c']
if GetDepend(['RT_USING_I2C']):
if GetDepend('BSP_USING_HW_I2C1'):
src += ['drv_i2c.c']
if GetDepend(['RT_USING_ADC']):
src += ['drv_adc.c']
if GetDepend(['RT_USING_QSPI']):
src += ['drv_qspi.c']
path = [cwd]
path += [cwd + '/config']
......
......@@ -70,32 +70,14 @@ void _Error_Handler(char *s, int num)
*/
void rt_hw_us_delay(rt_uint32_t us)
{
rt_uint32_t ticks;
rt_uint32_t told, tnow, tcnt = 0;
rt_uint32_t reload = SysTick->LOAD;
ticks = us * reload / (1000000 / RT_TICK_PER_SECOND);
told = SysTick->VAL;
while (1)
{
tnow = SysTick->VAL;
if (tnow != told)
{
if (tnow < told)
{
tcnt += told - tnow;
}
else
{
tcnt += reload - tnow + told;
}
told = tnow;
if (tcnt >= ticks)
{
break;
}
}
}
rt_uint32_t start, now, delta, reload, us_tick;
start = SysTick->VAL;
reload = SysTick->LOAD;
us_tick = SystemCoreClock / 1000000UL;
do {
now = SysTick->VAL;
delta = start > now ? start - now : reload + start - now;
} while(delta < us_tick * us);
}
/**
......
......@@ -11,67 +11,146 @@
#include <rtthread.h>
#include "drv_uart.h"
#include "uart_config.h"
#include "cy_retarget_io.h"
#include "cyhal_scb_common.h"
struct ifx_usart
{
char *name;
CySCB_Type *usart_x;
IRQn_Type intrSrc;
struct rt_serial_device serial;
};
enum
{
#ifdef BSP_USING_UART0
UART0_INDEX,
#endif
#ifdef BSP_USING_UART1
UART1_INDEX,
#endif
#ifdef BSP_USING_UART2
UART2_INDEX,
#endif
#ifdef BSP_USING_UART3
UART3_INDEX,
#endif
#ifdef BSP_USING_UART4
UART4_INDEX,
#endif
#ifdef BSP_USING_UART5
UART5_INDEX,
#endif
};
#ifdef BSP_USING_UART1
/* UART1 device driver structure */
const cy_stc_sysint_t UART1_SCB_IRQ_cfg =
static struct ifx_uart_config uart_config[] =
{
.intrSrc = scb_5_interrupt_IRQn,
.intrPriority = 7u,
};
#ifdef BSP_USING_UART0
UART0_CONFIG,
#endif
static struct ifx_usart usart_config[] =
{
#ifdef BSP_USING_UART1
{
"uart1",
SCB5,
scb_5_interrupt_IRQn,
},
UART1_CONFIG,
#endif
#ifdef BSP_USING_UART2
UART2_CONFIG,
#endif
#ifdef BSP_USING_UART3
UART3_CONFIG,
#endif
#ifdef BSP_USING_UART4
UART4_CONFIG,
#endif
#ifdef BSP_USING_UART5
UART5_CONFIG,
#endif
};
static void usart_isr(struct rt_serial_device *serial)
static struct ifx_uart uart_obj[sizeof(uart_config) / sizeof(uart_config[0])] = {0};
static void uart_isr(struct rt_serial_device *serial)
{
RT_ASSERT(serial != RT_NULL);
struct ifx_uart *uart = (struct ifx_uart *) serial->parent.user_data;
RT_ASSERT(uart != RT_NULL);
#ifdef BSP_USING_UART1
if ((SCB5->INTR_RX_MASKED & SCB_INTR_RX_MASKED_NOT_EMPTY_Msk) != 0)
#ifdef BSP_USING_UART5
if ((uart->config->usart_x->INTR_RX_MASKED & SCB_INTR_RX_MASKED_NOT_EMPTY_Msk) != 0)
{
/* Clear UART "RX fifo not empty interrupt" */
SCB5->INTR_RX = SCB5->INTR_RX & SCB_INTR_RX_NOT_EMPTY_Msk;
uart->config->usart_x->INTR_RX = uart->config->usart_x->INTR_RX & SCB_INTR_RX_NOT_EMPTY_Msk;
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
}
#endif
}
#ifdef BSP_USING_UART1
#ifdef BSP_USING_UART0
/* UART0 Interrupt Hanlder */
void uart0_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
uart_isr(&uart_obj[UART0_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef BSP_USING_UART1
/* UART1 Interrupt Hanlder */
void uart1_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
usart_isr(&usart_config[UART1_INDEX].serial);
uart_isr(&uart_obj[UART1_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef BSP_USING_UART2
/* UART2 Interrupt Hanlder */
void uart2_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
uart_isr(&uart_obj[UART2_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef BSP_USING_UART3
/* UART3 Interrupt Hanlder */
void uart3_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
uart_isr(&uart_obj[UART3_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef BSP_USING_UART4
/* UART4 Interrupt Hanlder */
void uart4_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
uart_isr(&uart_obj[UART4_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef BSP_USING_UART5
/* UART5 Interrupt Hanlder */
void uart5_isr_callback(void)
{
/* enter interrupt */
rt_interrupt_enter();
uart_isr(&uart_obj[UART5_INDEX].serial);
/* leave interrupt */
rt_interrupt_leave();
......@@ -83,18 +162,17 @@ void uart1_isr_callback(void)
*/
static rt_err_t ifx_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
{
struct ifx_usart *usart_instance = (struct ifx_usart *) serial->parent.user_data;
struct ifx_uart *uart = (struct ifx_uart *) serial->parent.user_data;
RT_ASSERT(serial != RT_NULL);
RT_ASSERT(usart_instance != RT_NULL);
RT_ASSERT(uart != RT_NULL);
cy_en_scb_uart_status_t result;
/* Initialize retarget-io to use the debug UART port */
result = cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX,
result = cy_retarget_io_init(uart->config->tx_pin, uart->config->rx_pin,
CY_RETARGET_IO_BAUDRATE);
/* retarget-io init failed. Stop program execution */
RT_ASSERT(result != RT_ERROR);
return RT_EOK;
......@@ -103,8 +181,8 @@ static rt_err_t ifx_configure(struct rt_serial_device *serial, struct serial_con
static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)
{
RT_ASSERT(serial != RT_NULL);
struct ifx_usart *usart = (struct ifx_usart *) serial->parent.user_data;
RT_ASSERT(usart != RT_NULL);
struct ifx_uart *uart = (struct ifx_uart *) serial->parent.user_data;
RT_ASSERT(uart != RT_NULL);
switch (cmd)
{
......@@ -114,15 +192,13 @@ static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)
case RT_DEVICE_CTRL_SET_INT:
/* Unmasking only the RX fifo not empty interrupt bit */
usart->usart_x->INTR_RX_MASK = SCB_INTR_RX_MASK_NOT_EMPTY_Msk;
uart->config->usart_x->INTR_RX_MASK = SCB_INTR_RX_MASK_NOT_EMPTY_Msk;
#ifdef BSP_USING_UART1
/* Interrupt Settings for UART */
Cy_SysInt_Init(&UART1_SCB_IRQ_cfg, uart1_isr_callback);
#endif
Cy_SysInt_Init(uart->config->UART_SCB_IRQ_cfg, uart->config->userIsr);
/* Enable the interrupt */
NVIC_EnableIRQ(usart->intrSrc);
NVIC_EnableIRQ(uart->config->intrSrc);
break;
}
......@@ -133,9 +209,9 @@ static int ifx_uarths_putc(struct rt_serial_device *serial, char c)
{
RT_ASSERT(serial != RT_NULL);
struct ifx_usart *usart = (struct ifx_usart *) serial->parent.user_data;
struct ifx_uart *uart = (struct ifx_uart *) serial->parent.user_data;
RT_ASSERT(usart != RT_NULL);
RT_ASSERT(uart != RT_NULL);
if (_cyhal_scb_pm_transition_pending())
return CYHAL_SYSPM_RSLT_ERR_PM_PENDING;
......@@ -143,7 +219,7 @@ static int ifx_uarths_putc(struct rt_serial_device *serial, char c)
uint32_t count = 0;
while (count == 0)
{
count = Cy_SCB_UART_Put(usart->usart_x, c);
count = Cy_SCB_UART_Put(uart->config->usart_x, c);
}
return (1);
......@@ -180,23 +256,23 @@ const struct rt_uart_ops _uart_ops =
void rt_hw_uart_init(void)
{
int index;
rt_size_t obj_num;
obj_num = sizeof(usart_config) / sizeof(struct ifx_usart);
rt_size_t obj_num = sizeof(uart_obj) / sizeof(struct ifx_uart);
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
rt_err_t result = 0;
for (index = 0; index < obj_num; index++)
{
usart_config[index].serial.ops = &_uart_ops;
usart_config[index].serial.config = config;
uart_obj[index].config = &uart_config[index];
uart_obj[index].serial.ops = &_uart_ops;
uart_obj[index].serial.config = config;
/* register uart device */
result = rt_hw_serial_register(&usart_config[index].serial,
usart_config[index].name,
result = rt_hw_serial_register(&uart_obj[index].serial,
uart_obj[index].config->name,
RT_DEVICE_FLAG_RDWR |
RT_DEVICE_FLAG_INT_RX,
&usart_config[index]);
&uart_obj[index]);
RT_ASSERT(result == RT_EOK);
}
......
......@@ -17,6 +17,25 @@
#include "board.h"
#include "cycfg_peripherals.h"
#define uart_isr_callback(name) name##_isr_callback
struct ifx_uart_config
{
const char *name;
rt_uint32_t tx_pin;
rt_uint32_t rx_pin;
CySCB_Type *usart_x;
IRQn_Type intrSrc;
cy_israddress userIsr;
cy_stc_sysint_t *UART_SCB_IRQ_cfg;
};
struct ifx_uart
{
struct ifx_uart_config *config;
struct rt_serial_device serial;
};
void rt_hw_uart_init(void);
#endif
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-07-08 Rbb666 first version
*/
#ifndef __UART_CONFIG_H__
#define __UART_CONFIG_H__
#include <rtthread.h>
#include "board.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef BSP_USING_UART0
/* UART0 device driver structure */
cy_stc_sysint_t UART2_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_0_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART1
/* UART1 device driver structure */
cy_stc_sysint_t UART1_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_1_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART2
/* UART2 device driver structure */
cy_stc_sysint_t UART2_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_2_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART3
/* UART3 device driver structure */
cy_stc_sysint_t UART3_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_3_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART4
/* UART4 device driver structure */
cy_stc_sysint_t UART4_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_4_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART5
/* UART5 device driver structure */
cy_stc_sysint_t UART5_SCB_IRQ_cfg =
{
.intrSrc = (IRQn_Type) scb_5_interrupt_IRQn,
.intrPriority = (7u),
};
#endif
#if defined(BSP_USING_UART0)
#ifndef UART0_CONFIG
#define UART0_CONFIG \
{ \
.name = "uart0", \
.tx_pin = P0_3, \
.rx_pin = P0_2, \
.usart_x = SCB0, \
.intrSrc = scb_0_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart0) \
.UART_SCB_IRQ_cfg = &UART0_SCB_IRQ_cfg, \
}
void uart0_isr_callback(void);
#endif /* UART0_CONFIG */
#endif /* BSP_USING_UART0 */
#if defined(BSP_USING_UART1)
#ifndef UART1_CONFIG
#define UART1_CONFIG \
{ \
.name = "uart1", \
.tx_pin = P10_1, \
.rx_pin = P10_0, \
.usart_x = SCB1, \
.intrSrc = scb_1_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart1) \
.UART_SCB_IRQ_cfg = &UART1_SCB_IRQ_cfg, \
}
void uart1_isr_callback(void);
#endif /* UART1_CONFIG */
#endif /* BSP_USING_UART1 */
#if defined(BSP_USING_UART2)
#ifndef UART2_CONFIG
#define UART2_CONFIG \
{ \
.name = "uart2", \
.tx_pin = P9_1, \
.rx_pin = P9_0, \
.usart_x = SCB2, \
.intrSrc = scb_2_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart2), \
.UART_SCB_IRQ_cfg = &UART2_SCB_IRQ_cfg, \
}
void uart2_isr_callback(void);
#endif /* UART2_CONFIG */
#endif /* BSP_USING_UART2 */
#if defined(BSP_USING_UART3)
#ifndef UART3_CONFIG
#define UART3_CONFIG \
{ \
.name = "uart3", \
.tx_pin = P6_1, \
.rx_pin = P6_0, \
.usart_x = SCB3, \
.intrSrc = scb_3_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart3), \
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
}
void uart3_isr_callback(void);
#endif /* UART3_CONFIG */
#endif /* BSP_USING_UART3 */
#if defined(BSP_USING_UART4)
#ifndef UART4_CONFIG
#define UART4_CONFIG \
{ \
.name = "uart4", \
.tx_pin = P7_1, \
.rx_pin = P7_0, \
.usart_x = SCB4, \
.intrSrc = scb_4_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart4), \
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
}
void uart4_isr_callback(void);
#endif /* UART4_CONFIG */
#endif /* BSP_USING_UART4 */
#if defined(BSP_USING_UART5)
#ifndef UART5_CONFIG
#define UART5_CONFIG \
{ \
.name = "uart5", \
.tx_pin = P5_1, \
.rx_pin = P5_0, \
.usart_x = SCB5, \
.intrSrc = scb_5_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart5), \
.UART_SCB_IRQ_cfg = &UART5_SCB_IRQ_cfg, \
}
void uart5_isr_callback(void);
#endif /* UART5_CONFIG */
#endif /* BSP_USING_UART5 */
#ifdef __cplusplus
}
#endif
#endif
......@@ -67,10 +67,23 @@ if GetDepend(['RT_USING_ADC']):
src += ['mtb-pdl-cat1/drivers/source/cy_dmac.c']
src += ['mtb-pdl-cat1/drivers/source/cy_sysanalog.c']
if GetDepend(['RT_USING_QSPI']):
src += ['mtb-hal-cat1/source/cyhal_qspi.c']
src += ['mtb-pdl-cat1/drivers/source/cy_dma.c']
src += ['mtb-pdl-cat1/drivers/source/cy_smif.c']
src += ['mtb-pdl-cat1/drivers/source/cy_smif_sfdp.c']
src += ['mtb-pdl-cat1/drivers/source/cy_smif_memslot.c']
src += ['mtb_shared/serial-flash/cy_serial_flash_qspi.c']
src += ['TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c']
if GetDepend(['RT_USING_I2C']):
src += ['mtb-hal-cat1/source/cyhal_i2c.c']
path = [cwd + '/capsense',
cwd + '/psoc6cm0p',
cwd + '/retarget-io',
cwd + '/core-lib/include',
cwd + '/mtb_shared/serial-flash',
cwd + '/mtb-hal-cat1/include',
cwd + '/mtb-hal-cat1/include_pvt',
cwd + '/mtb-pdl-cat1/cmsis/include',
......
......@@ -26,6 +26,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************/
#include <rtthread.h>
#include "cycfg_peripherals.h"
......@@ -34,8 +35,32 @@ cy_stc_csd_context_t cy_csd_0_context =
.lockKey = CY_CSD_NONE_KEY,
};
void init_cycfg_peripherals(void)
{
Cy_SysClk_PeriphAssignDivider(PCLK_CSD_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#ifdef BSP_USING_UART0
/* UART0 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB0_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
#ifdef BSP_USING_UART1
/* UART1 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB1_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
#ifdef BSP_USING_UART2
/* UART2 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB2_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
#ifdef BSP_USING_UART3
/* UART3 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB3_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
#ifdef BSP_USING_UART4
/* UART4 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB4_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
#ifdef BSP_USING_UART5
/* UART5 Device Clock*/
Cy_SysClk_PeriphAssignDivider(PCLK_SCB5_CLOCK, CY_SYSCLK_DIV_8_BIT, 0U);
#endif
}
CYPRESS END USER LICENSE AGREEMENT
PLEASE READ THIS END USER LICENSE AGREEMENT ("Agreement") CAREFULLY BEFORE DOWNLOADING, INSTALLING, COPYING, OR USING THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION. BY DOWNLOADING, INSTALLING, COPYING OR USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, PROMPTLY RETURN AND DO NOT USE THE SOFTWARE. IF YOU HAVE PURCHASED THIS LICENSE TO THE SOFTWARE, YOUR RIGHT TO RETURN THE SOFTWARE EXPIRES 30 DAYS AFTER YOUR PURCHASE AND APPLIES ONLY TO THE ORIGINAL PURCHASER.
1. Definitions.
"Software" means this software and any accompanying documentation, including any upgrades, updates, bug fixes or modified versions provided to you by Cypress.
"Source Code" means software in human-readable form.
"Binary Code" means the software in binary code form such as object code or an executable.
"Development Tools" means software that is intended to be installed on a personal computer and used to create programming code for Firmware, Drivers, or Host Applications. Examples of Development Tools are Cypress's PSoC Creator software, Cypress's WICED SDKs, and Cypress's ModusToolbox software.
"Firmware" means software that executes on a Cypress hardware product.
"Driver" means software that enables the use of a Cypress hardware product on a particular host operating system such as GNU/Linux, Windows, MacOS, Android, and iOS.
"Host Application" means software that executes on a device other than a Cypress hardware product in order to program, control, or communicate with a Cypress hardware product.
"inf File" means a hardware setup information file (.inf file) created by the Software to allow a Microsoft Windows operating system to install the driver for a Cypress hardware product.
2. License. Subject to the terms and conditions of this Agreement, Cypress Semiconductor Corporation ("Cypress") and its suppliers grant to you a non-exclusive, non-transferable license under their copyright rights:
a. to use the Development Tools in object code form solely for the purpose of creating Firmware, Drivers, Host Applications, and inf Files for Cypress hardware products; and
b. (i) if provided in Source Code form, to copy, modify, and compile the Firmware Source Code to create Firmware for execution on a Cypress hardware product, and (ii) to distribute Firmware in binary code form only, only when installed onto a Cypress hardware product; and
c. (i) if provided in Source Code form, to copy, modify, and compile the Driver Source Code to create one or more Drivers to enable the use of a Cypress hardware product on a particular host operating system, and (ii) to distribute the Driver, in binary code form only, only when installed on a device that includes the Cypress hardware product that the Driver is intended to enable; and
d. (i) if provided in Source Code form, to copy, modify, and compile the Host Application Source Code to create one or more Host Applications to program, control, or communicate with a Cypress hardware product, and (ii) to distribute Host Applications, in binary code form only, only when installed on a device that includes a Cypress hardware product that the Host Application is intended to program, control, or communicate with; and
e. to freely distribute any inf File.
Any distribution of Software permitted under this Agreement must be made pursuant to your standard end user license agreement used for your proprietary (closed source) software products, such end user license agreement to include, at a minimum, provisions limiting your licensors' liability and prohibiting reverse engineering of the Software, consistent with such provisions in this Agreement.
3. Free and Open Source Software. Portions of the Software may be licensed under free and/or open source licenses such as the GNU General Public License or other licenses from third parties ("Third Party Software"). Third Party Software is subject to the applicable license agreement and not this Agreement. If you are entitled to receive the source code from Cypress for any Third Party Software included with the Software, either the source code will be included with the Software or you may obtain the source code at no charge from <http://www.cypress.com/go/opensource>. The applicable license terms will accompany each source code package. To review the license terms applicable to any Third Party Software for which Cypress is not required to provide you with source code, please see the Software's installation directory on your computer.
4. Proprietary Rights; Ownership. The Software, including all intellectual property rights therein, is and will remain the sole and exclusive property of Cypress or its suppliers. Cypress retains ownership of the Source Code and any compiled version thereof. Subject to Cypress' ownership of the underlying Software (including Source Code), you retain ownership of any modifications you make to the Source Code. You agree not to remove any Cypress copyright or other notices from the Source Code and any modifications thereof. You agree to keep the Source Code confidential. Any reproduction, modification, translation, compilation, or representation of the Source Code except as permitted in Section 2 ("License") is prohibited without the express written permission of Cypress. Except as otherwise expressly provided in this Agreement, you may not: (i) modify, adapt, or create derivative works based upon the Software; (ii) copy the Software; (iii) except and only to the extent explicitly permitted by applicable law despite this limitation, decompile, translate, reverse engineer, disassemble or otherwise reduce the Software to human-readable form; or (iv) use the Software or any sample code other than for the Purpose. You hereby covenant that you will not assert any claim that the Software, or derivative works thereof created by or for Cypress, infringe any intellectual property right owned or controlled by you
5. No Support. Cypress may, but is not required to, provide technical support for the Software.
6. Term and Termination. This Agreement is effective until terminated, and either party may terminate this Agreement at any time with or without cause. This Agreement and your license rights under this Agreement will terminate immediately without notice from Cypress if you fail to comply with any provision of this Agreement. Upon termination, you must destroy all copies of Software in your possession or control. The following paragraphs shall survive any termination of this Agreement: "Free and Open Source Software," "Proprietary Rights; Ownership," "Compliance With Law," "Disclaimer," "Limitation of Liability," and "General."
7. Compliance With Law. Each party agrees to comply with all applicable laws, rules and regulations in connection with its activities under this Agreement. Without limiting the foregoing, the Software may be subject to export control laws and regulations of the United States and other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain licenses to export, re-export, or import the Software.
8. Disclaimer. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THE SOFTWARE, INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes to the Software without notice. Cypress does not assume any liability arising out of the application or use of Software or any product or circuit described in the Software. It is the responsibility of the user of the Software to properly design, program, and test the functionality and safety of any application made of the Software and any resulting product. Cypress does not authorize its Software or products for use in any products where a malfunction or failure of the Software or Cypress product may reasonably be expected to result in significant property damage, injury or death ("High Risk Product"). If you include any Software or Cypress product in a High Risk Product, you assume all risk of such use and agree to indemnify Cypress and its suppliers against all liability. No computing device can be absolutely secure. Therefore, despite security measures implemented in Cypress hardware or software products, Cypress does not assume any liability arising out of any security breach, such as unauthorized access to or use of a Cypress product.
9. Limitation of Liability. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL CYPRESS OR ITS SUPPLIERS, RESELLERS, OR DISTRIBUTORS BE LIABLE FOR ANY LOST REVENUE, PROFIT, OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF CYPRESS OR ITS SUPPLIERS, RESELLERS, OR DISTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT SHALL CYPRESS' OR ITS SUPPLIERS', RESELLERS', OR DISTRIBUTORS' TOTAL LIABILITY TO YOU, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, EXCEED THE GREATER OF US$500 OR THE PRICE PAID BY YOU FOR THE SOFTWARE. THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF THE ABOVE-STATED WARRANTY FAILS OF ITS ESSENTIAL PURPOSE. BECAUSE SOME STATES OR JURISDICTIONS DO NOT ALLOW LIMITATION OR EXCLUSION OF CONSEQUENTIAL OR INCIDENTAL DAMAGES, ALL OR PORTIONS OF THE ABOVE LIMITATION MAY NOT APPLY TO YOU.
10. Restricted Rights. The Software is commercial computer software as that term is described in 48 C.F.R. 252.227-7014(a)(1). If the Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software shall be only those set forth in this Agreement.
11. Personal Information. You agree that information you provide through your registration on Cypress IoT Community Forum or other Cypress websites, including contact information or other personal information, may be collected and used by Cypress consistent with its Data Privacy Policy (www.cypress.com/privacy-policy), as updated or revised from time to time, and may be provided to its third party sales representatives, distributors and other entities conducting sales activities for Cypress for sales-related and other business purposes.
12. General. This Agreement will bind and inure to the benefit of each party's successors and assigns, provided that you may not assign or transfer this Agreement, in whole or in part, without Cypress' written consent. This Agreement shall be governed by and construed in accordance with the laws of the State of California, United States of America, as if performed wholly within the state and without giving effect to the principles of conflict of law. The parties consent to personal and exclusive jurisdiction of and venue in, the state and federal courts within Santa Clara County, California; provided however, that nothing in this Agreement will limit Cypress' right to bring legal action in any venue in order to protect or enforce its intellectual property rights. No failure of either party to exercise or enforce any of its rights under this Agreement will act as a waiver of such rights. If any portion of this Agreement is found to be void or unenforceable, the remaining provisions of this Agreement shall remain in full force and effect. This Agreement is the complete and exclusive agreement between the parties with respect to the subject matter hereof, superseding and replacing any and all prior agreements, communications, and understandings (both written and oral) regarding such subject matter. Any notice to Cypress will be deemed effective when actually received and must be sent to Cypress Semiconductor Corporation, ATTN: Chief Legal Officer, 198 Champion Court, San Jose, CA 95134 USA.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
# Serial Flash
### Overview
Provides functions for interacting with an external flash connected through its Single SPI/Dual SPI/Quad SPI/Octal SPI interface. The read operation can be performed in either blocking or non-blocking manner by calling the corresponding function while the write and erase operations are implemented as blocking functions. This library accepts the configuration generated using the QSPI Configurator tool but supports only one memory slot. Note that PSoC™ 6 supports up to 4 memory slots on the same QSPI block.
### Features
* Supports asynchronous (non-blocking) read operation
* Implements thread-safety for use with multi-threaded RTOS environment using the [abstraction-rtos](https://github.com/infineon/abstraction-rtos) library
* Accepts the configuration generated by the QSPI Configurator tool
* Supports Execute-in-Place (XIP) mode of operation
* Provides information about the external memory to the programming tool for it to be able to program the memory, for example, when user wants to place the code into the external memory for XIP operation.
* Allows for programming external memory if CY_ENABLE_XIP_PROGRAM is defined when building the application. Note: This is not compatible with the PSoC™ 64 series of devices.
### Quick Start
1. Add \#include "cy_serial_flash_qspi.h"
2. Add `DEFINES=CY_SERIAL_FLASH_QSPI_THREAD_SAFE` in the Makefile to enable thread-safety when used in a multi-threaded RTOS environment
3. See the [PSoC™ 6 MCU: QSPI Flash Read and Write](https://github.com/infineon/mtb-example-psoc6-qspi-readwrite) code example to learn using this library
**NOTE:**
If you delete the contents of the GeneratedSource directory inside the BSP, you must re-generate the memory configuration files *cycfg_qspi_memslot.c/.h*. To do this from inside the ModusToolbox™ IDE, open the QSPI Configurator tool from the Quick Panel and press **Ctrl+S** or click **File > Save**. If you open the tool outside the IDE, you need to first open the *design.cyqspi* file in the tool. To do this, click **File > Import** and then locate the file inside the BSP under *COMPONENT_BSP_DESIGN_MODUS* directory.
**NOTE:**
For devices with no internal flash (eg:CAT1B device CYW20829), user needs to disable 'config data in flash' option in QSPI Configurator.
### Dependencies
* [abstraction-rtos](https://github.com/infineon/abstraction-rtos) library if `DEFINES=CY_SERIAL_FLASH_QSPI_THREAD_SAFE` is added in the Makefile
### More information
* [API Reference Guide](https://infineon.github.io/serial-flash/html/index.html)
* [Cypress Semiconductor, an Infineon Technologies Company](http://www.cypress.com)
* [Infineon GitHub](https://github.com/infineon)
* [ModusToolbox™](https://www.cypress.com/products/modustoolbox-software-environment)
* [PSoC™ 6 Code Examples using ModusToolbox™ IDE](https://github.com/infineon/Code-Examples-for-ModusToolbox-Software)
* [ModusToolbox™ Software](https://github.com/Infineon/modustoolbox-software)
* [PSoC™ 6 Resources - KBA223067](https://community.cypress.com/docs/DOC-14644)
---
© Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation, 2019-2021.
# Serial Flash Library Release Notes
Provides functions for interacting with an external flash connected through its Single/Dual/Quad/Octal SPI interface.
### What's Included?
* APIs for Read/Write/Erase operations
* Supports Execute-in-Place (XIP) mode of operation
* Accepts the configuration generated by the QSPI Configurator tool
* Allows for providing information to the programming tool to program the external memory.
### What Changed?
#### v1.3.0
* Added support for CAT1B device - CYW20829.
#### v1.2.0
* Added support for HAL API v1 or v2
#### v1.1.0
* Added the following functions:
- `cy_serial_flash_qspi_read_async()` - Supports asynchronous (non-blocking) read using fixed DMA resources. Refer to the API reference manual for details on the list of devices supported for DMA operation and the exact DMA resources used.
- `cy_serial_flash_qspi_abort_read()` - Aborts an ongoing asynchronous read operation
- `cy_serial_flash_qspi_set_dma_interrupt_priority()` - Changes the DMA interrupt priority
* Implemented thread-safety for use with multi-threaded RTOS environment using the [abstraction-rtos](https://github.com/infineon/abstraction-rtos) library
- Add `DEFINES=CY_SERIAL_FLASH_QSPI_THREAD_SAFE` in the Makefile to enable thread-safety
* Updated `cy_serial_flash_qspi_get_erase_size()` to support memories with hybrid sectors
#### 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
* Initial release
### Supported Software and Tools
This version of the Serial Flash library was validated for compatibility with the following Software and Tools:
| Software and Tools | Version |
| :--- | :----: |
| ModusToolbox™ Software Environment | 2.4.0 |
| GCC Compiler | 10.3.1 |
| IAR Compiler | 8.4 |
| ARM Compiler 6 | 6.11 |
Minimum required ModusToolbox™ Software Environment: v2.0
### More information
* [API Reference Guide](https://infineon.github.io/serial-flash/html/index.html)
* [Cypress Semiconductor, an Infineon Technologies Company](http://www.cypress.com)
* [Infineon GitHub](https://github.com/infineon)
* [ModusToolbox™](https://www.cypress.com/products/modustoolbox-software-environment)
* [PSoC™ 6 Code Examples using ModusToolbox™ IDE](https://github.com/infineon/Code-Examples-for-ModusToolbox-Software)
* [ModusToolbox™ Software](https://github.com/Infineon/modustoolbox-software)
* [PSoC™ 6 Resources - KBA223067](https://community.cypress.com/docs/DOC-14644)
---
© Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation, 2019-2021.
\ No newline at end of file
/***********************************************************************************************//**
* \file cy_serial_flash_prog.c
*
* \brief
* Provides variables necessary to inform programming tools how to program the
* attached serial flash memory. The variables used here must be placed at
* specific locations in order to be detected and used by programming tools
* to know that there is an attached memory and its characteristics. Uses the
* configuration provided as part of BSP.
*
***************************************************************************************************
* \copyright
* Copyright 2018-2022 Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**************************************************************************************************/
/**
* \addtogroup group_board_libs
* \{
* In addition to the APIs for reading and writting to memory at runtime, this library also
* provides support for informing programming tools about the external memory so it can be
* be written at the same time as internal flash. This support can be enabled by defining
* CY_ENABLE_XIP_PROGRAM while building the application. With this define in place, code
* will be generated in the .cy_sflash_user_data & .cy_toc_part2 sections. These sections
* must be provided by the linker script for the application. One the application has been
* built, these locations can be read by programming tools (eg: Cypress Programmer, OpenOCD,
* pyOCD) to know that there is a memory device attached and how to program it.
* \note This support is not compatible with the PSoCâ„¢ 64 series of devices.
* \} group_board_libs
*/
#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(CY_ENABLE_XIP_PROGRAM)
#include "cycfg_qspi_memslot.h"
typedef struct
{
const cy_stc_smif_block_config_t* smifCfg; // Pointer to SMIF top-level configuration
const uint32_t null_t; // NULL termination
} stc_smif_ipblocks_arr_t;
// This data can be placed anywhere in the internal memory, but it must be at a location that
// can be determined and used for the calculation of the CRC16 checksum in the cyToc below. There
// are multiple ways this can be accomplished including:
// 1) Placing it in a dedicated memory block with a known address. (as done here)
// 2) Placing it at an absolute location via a the linker script
// 3) Using 'cymcuelftool -S' to recompute the checksum and patch the elf file after linking
CY_SECTION(".cy_sflash_user_data") __attribute__((used))
const stc_smif_ipblocks_arr_t smifIpBlocksArr = { &smifBlockConfig, 0x00000000 };
// This data is used to populate the table of contents part 2. When present, it is used by the boot
// process and programming tools to determine key characteristics about the memory usage including
// where the boot process should start the application from and what external memories are connected
// (if any). This must consume a full row of flash memory row. The last entry is a checksum of the
// other values in the ToC which must be updated if any other value changes. This can be done
// manually or by running 'cymcuelftool -S' to recompute the checksum.
CY_SECTION(".cy_toc_part2") __attribute__((used))
const uint32_t cyToc[128] =
{
0x200-4, // Offset=0x0000: Object Size, bytes
0x01211220, // Offset=0x0004: Magic Number (TOC Part 2, ID)
0, // Offset=0x0008: Key Storage Address
(int)&smifIpBlocksArr, // Offset=0x000C: This points to a null terminated array of SMIF
// structures.
0x10000000u, // Offset=0x0010: App image start address
// Offset=0x0014-0x01F7: Reserved
[126] = 0x000002C2, // Offset=0x01
// Bits[ 1: 0] CLOCK_CONFIG (0=8MHz, 1=25MHz, 2=50MHz, 3=100MHz)
// Bits[ 4: 2] LISTEN_WINDOW (0=20ms, 1=10ms, 2=1ms, 3=0ms, 4=100ms)
// Bits[ 6: 5] SWJ_PINS_CTL (0/1/3=Disable SWJ, 2=Enable SWJ)
// Bits[ 8: 7] APP_AUTHENTICATION (0/2/3=Enable, 1=Disable)
// Bits[10: 9] FB_BOOTLOADER_CTL: UNUSED
[127] = 0x3BB30000 // Offset=0x01FC: CRC16-CCITT
// (the upper 2 bytes contain the CRC and the lower 2 bytes are 0)
};
#endif // defined(CY_ENABLE_XIP_PROGRAM)
#if defined(__cplusplus)
}
#endif
/***********************************************************************************************//**
* \file cy_serial_flash_qspi.h
*
* \brief
* Provides APIs for interacting with an external flash connected to the SPI or
* QSPI interface. Read is implemented as both blocking and non-blocking whereas
* write, and erase are implemented as blocking functions.
*
***************************************************************************************************
* \copyright
* Copyright 2018-2022 Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**************************************************************************************************/
/**
* \addtogroup group_board_libs Serial Flash
* \ingroup group_lib
* \{
*
* \section section_resource_usage DMA Resource Usage
* This library uses fixed DMA (Datawire or DW) resources and supports DMA only
* for the following devices. DMA is not supported for other devices and the
* functions \ref cy_serial_flash_qspi_read_async() and
* \ref cy_serial_flash_qspi_abort_read() will return
* \ref CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED error and
* \ref cy_serial_flash_qspi_set_dma_interrupt_priority() will simply return
* doing nothing.
* * CY8C6xx4, CY8C6xx5, CY8C6xx8, CY8C6xxA, CYB06xx5, CYB06xxA, CYS06xxA: <b>DW1, Channel 23</b>
* * CY8C6xx6, CY8C6xx7, CYB06xx7: <b>DW1, Channel 15</b>
*/
#pragma once
#include <stddef.h>
#include "cy_result.h"
#include "cy_pdl.h"
#include "cyhal.h"
#ifdef CY_IP_MXSMIF
#if defined(__cplusplus)
extern "C" {
#endif
/** The function or operation is not supported on the target or the memory */
#define CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED \
(CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH, 1))
/** Parameters passed to a function are invalid */
#define CY_RSLT_SERIAL_FLASH_ERR_BAD_PARAM \
(CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH, 2))
/** A previously initiated read operation is not yet complete */
#define CY_RSLT_SERIAL_FLASH_ERR_READ_BUSY \
(CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH, 3))
/** A DMA error occurred during read transfer */
#define CY_RSLT_SERIAL_FLASH_ERR_DMA \
(CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH, 4))
/** Read abort failed. QSPI block is busy. */
#define CY_RSLT_SERIAL_FLASH_ERR_QSPI_BUSY \
(CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_BOARD_LIB_SERIAL_FLASH, 5))
#ifdef DOXYGEN
/** Enables thread-safety for use with multi-threaded RTOS environment. */
#define CY_SERIAL_FLASH_QSPI_THREAD_SAFE
#endif /* #ifdef DOXYGEN */
/**
* Callback pointer to use with \ref cy_serial_flash_qspi_read_async().
* \param operation_status Status of the read operation
* \param callback_arg Pointer to be passed back to the callback function
*/
typedef void (* cy_serial_flash_qspi_read_complete_callback_t)(cy_rslt_t operation_status,
void* callback_arg);
/**
* \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.
* 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.
* \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.
* \param io2 Data/IO pin 2 connected to the memory, Pass NC when unused.
* \param io3 Data/IO pin 3 connected to the memory, Pass NC when unused.
* \param io4 Data/IO pin 4 connected to the memory, Pass NC when unused.
* \param io5 Data/IO pin 5 connected to the memory, Pass NC when unused.
* \param io6 Data/IO pin 6 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 ssel Slave select pin connected to the memory
* \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(
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);
/**
* \brief De-initializes the serial flash memory.
* Before calling this function, ensure that an ongoing asynchronous read
* operation is either completed or successfully aborted.
* Async read is started by calling \ref cy_serial_flash_qspi_read_async() and
* aborted by calling \ref cy_serial_flash_qspi_abort_read().
*/
void cy_serial_flash_qspi_deinit(void);
/**
* \brief Returns the size of the serial flash memory in bytes.
* \returns Memory size in bytes.
*/
size_t cy_serial_flash_qspi_get_size(void);
/**
* \brief Returns the size of the erase 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 Erase sector size in bytes.
*/
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.
* \param addr Address in the sector for which the starting address is returned.
* \returns Starting address of the sector
*/
__STATIC_INLINE uint32_t cy_serial_flash_get_sector_start_address(uint32_t addr)
{
return (addr & ~(cy_serial_flash_qspi_get_erase_size(addr) - 1));
}
/**
* \brief Reads data from the serial flash memory. This is a blocking
* function. Returns error if (addr + length) exceeds the flash size.
* \param addr Starting address to read from
* \param length Number of data bytes to read
* \param buf Pointer to the buffer to store the data read from the memory
* \returns CY_RSLT_SUCCESS if the read was successful, an error code otherwise.
*/
cy_rslt_t cy_serial_flash_qspi_read(uint32_t addr, size_t length, uint8_t* buf);
/**
* \brief Reads data from the serial flash memory. This is a non-blocking
* function. Returns error if (addr + length) exceeds the flash size.
* Uses fixed DMA (DW) instance and channel for transferring the data from
* QSPI RX FIFO to the user-provided buffer.
* \param addr Starting address to read from
* \param length Number of data bytes to read
* \param buf Pointer to the buffer to store the data read from the memory
* \param callback Pointer to the callback function to be called after the read
* operation is complete. Callback is invoked from the DMA ISR.
* \param callback_arg Pointer to the argument to be passed to the callback
* function
* \returns CY_RSLT_SUCCESS if the read was successful, an error code otherwise.
*/
cy_rslt_t cy_serial_flash_qspi_read_async(uint32_t addr, size_t length, uint8_t* buf,
cy_serial_flash_qspi_read_complete_callback_t callback,
void* callback_arg);
/**
* \brief Aborts an ongoing asynchronous read initiated by calling
* \ref cy_serial_flash_qspi_read_async().
*
* \returns CY_RSLT_SUCCESS if the abort was successful, an error code
* if the QSPI block is still busy after a timeout.
*/
cy_rslt_t cy_serial_flash_qspi_abort_read(void);
/**
* \brief Writes the data to the serial flash memory. The program area
* must have been erased prior to calling this API using
* \ref cy_serial_flash_qspi_erase() This is a blocking function. Returns error if
* (addr + length) exceeds the flash size.
* \param addr Starting address to write to
* \param length Number of bytes to write
* \param buf Pointer to the buffer storing the data to be written
* \returns CY_RSLT_SUCCESS if the write was successful, an error code
* otherwise.
*/
cy_rslt_t cy_serial_flash_qspi_write(uint32_t addr, size_t length, const uint8_t* buf);
/**
* \brief Erases the serial flash memory, uses chip erase command when
* addr = 0 and length = flash_size otherwise uses sector erase command. This is
* a blocking function. Returns error if addr or (addr + length) is not aligned
* to the sector size or if (addr + length) exceeds the flash size.
* For memories with hybrid sectors, returns error if the end address
* (=addr + length) is not aligned to the size of the sector in which the end
* address is located.
* Call \ref cy_serial_flash_qspi_get_size() to get the flash size and
* call \ref cy_serial_flash_qspi_get_erase_size() to get the size of an erase
* sector.
*
* \param addr Starting address to begin erasing
* \param length Number of bytes to erase
* \returns CY_RSLT_SUCCESS if the erase was successful, an error code
* otherwise.
*/
cy_rslt_t cy_serial_flash_qspi_erase(uint32_t addr, size_t length);
/**
* \brief Enables Execute-in-Place (memory mapped) mode on the MCU. This
* function does not send any command to the serial flash. This may not be
* supported on all the targets in which case
* CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED is returned.
* \param enable true: XIP mode is set, false: normal mode is set
* \returns CY_RSLT_SUCCESS if the operation was successful.
* CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED if the target does not
* support XIP.
*/
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);
/**
* \brief Changes the DMA interrupt priority
* \param priority interrupt priority to be set
*/
void cy_serial_flash_qspi_set_dma_interrupt_priority(uint8_t priority);
#if defined(__cplusplus)
}
#endif
#endif // CY_IP_MXSMIF
/** \} group_board_libs */
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Redirect to API Reference Manual main page after 0 seconds</title>
<noscript>
<meta http-equiv="refresh" content="0; URL=html/index.html">
</noscript>
<meta name="keywords" content="automatic redirection">
</head>
<body onLoad="window.location='html/index.html' " >
<h2>
If the automatic redirection is failing, click the following link to open <a href="html/index.html">API Reference Manual</a>.
</h2>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 104 31" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a">
<stop stop-color="#5373B4" offset="0"/>
<stop stop-color="#7C95C6" offset="1"/>
</linearGradient>
<linearGradient id="d" x1="31.474" x2="31.474" y1="24.821" y2="26.773" gradientUnits="userSpaceOnUse" xlink:href="#a"/>
<linearGradient id="c" x1="31.474" x2="31.474" y1="24.821" y2="26.773" gradientTransform="matrix(.6816 0 0 1.0248 72.391 -.91809)" gradientUnits="userSpaceOnUse" xlink:href="#a"/>
<linearGradient id="b" x1="56.295" x2="56.295" y1="24.622" y2="26.574" gradientUnits="userSpaceOnUse" xlink:href="#a"/>
<linearGradient id="e" x1="49.067" x2="48.956" y1="19.719" y2="9.5227" gradientTransform="matrix(.97968 0 0 1.0207 -.25579 -.25579)" gradientUnits="userSpaceOnUse">
<stop stop-color="#C0CCE3" offset="0"/>
<stop stop-color="#EEF1F7" offset="1"/>
</linearGradient>
<filter id="f" x="-.010676" y="-.045304" width="1.0214" height="1.0906" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="0.45293203"/>
</filter>
</defs>
<g>
<path transform="translate(-2.5759 -27.848)" d="m13.609 32.203v6.8633h-0.05078c-0.40533-0.66867-0.96254-1.1715-1.6719-1.5059-0.69244-0.35193-1.4282-0.52734-2.2051-0.52734-0.96267 0-1.807 0.2027-2.5332 0.60742-0.72622 0.38713-1.3344 0.90556-1.8242 1.5566-0.47289 0.65108-0.83456 1.4092-1.0879 2.2715-0.23644 0.84464-0.35547 1.7236-0.35547 2.6387 0 0.95022 0.11902 1.8643 0.35547 2.7441 0.25333 0.87983 0.615 1.6633 1.0879 2.3496 0.48978 0.66867 1.1065 1.2066 1.8496 1.6113 0.74311 0.38713 1.6044 0.58008 2.584 0.58008 0.86133 0 1.6311-0.15787 2.3066-0.47461 0.69244-0.33434 1.2497-0.87227 1.6719-1.6113h0.05078v1.7422h3.4199v-18.846zm12.875 4.8301c-1.0302 0-1.9596 0.17541-2.7871 0.52734-0.82756 0.33434-1.5358 0.81965-2.127 1.4531-0.59111 0.61588-1.0483 1.3721-1.3691 2.2695-0.32089 0.87983-0.48047 1.866-0.48047 2.957s0.15958 2.0752 0.48047 2.9551c0.32089 0.87983 0.77803 1.6361 1.3691 2.2695 0.59111 0.61588 1.2994 1.0914 2.127 1.4258 0.82756 0.33434 1.7569 0.50195 2.7871 0.50195 1.0302 0 1.9596-0.16762 2.7871-0.50195 0.84444-0.33434 1.5612-0.8099 2.1523-1.4258 0.59111-0.63348 1.0483-1.3897 1.3691-2.2695 0.32089-0.87983 0.48047-1.8641 0.48047-2.9551s-0.15958-2.0772-0.48047-2.957c-0.32089-0.89743-0.77803-1.6536-1.3691-2.2695-0.59111-0.63348-1.3079-1.1188-2.1523-1.4531-0.82756-0.35193-1.7569-0.52734-2.7871-0.52734zm41.715 0c-0.912 0-1.7223 0.18516-2.4316 0.55469-0.69244 0.36953-1.2752 0.87043-1.748 1.5039-0.47289 0.61588-0.83651 1.337-1.0898 2.1641-0.23645 0.80944-0.35352 1.6553-0.35352 2.5352 0 0.93262 0.10007 1.8214 0.30273 2.666 0.21956 0.82704 0.55767 1.556 1.0137 2.1895 0.456 0.61588 1.0387 1.109 1.748 1.4785 0.70933 0.35193 1.5536 0.5293 2.5332 0.5293 0.79378 0 1.5446-0.16762 2.2539-0.50195 0.72622-0.35193 1.2834-0.88986 1.6719-1.6113h0.05078v1.7949c0.01689 0.96782-0.21071 1.7689-0.68359 2.4023-0.456 0.63348-1.1898 0.95117-2.2031 0.95117-0.64178 0-1.2075-0.14228-1.6973-0.42383-0.48978-0.26395-0.81939-0.74731-0.98828-1.4512h-3.5723c0.05067 0.77425 0.25276 1.435 0.60742 1.9805 0.37156 0.56309 0.8287 1.0192 1.3691 1.3711 0.55733 0.35193 1.1656 0.60726 1.8242 0.76562 0.67556 0.17597 1.3328 0.26562 1.9746 0.26562 1.5031 0 2.7025-0.21245 3.5977-0.63477 0.89511-0.42232 1.5798-0.94076 2.0527-1.5566 0.47289-0.59829 0.777-1.2493 0.91211-1.9531 0.152-0.70386 0.22656-1.3295 0.22656-1.875v-12.775h-3.4199v1.8223h-0.05078c-0.43911-0.79185-0.98782-1.3551-1.6465-1.6895-0.64178-0.33434-1.3926-0.50195-2.2539-0.50195zm16.523 0c-0.99644 0-1.9088 0.18516-2.7363 0.55469-0.81067 0.36953-1.5124 0.88018-2.1035 1.5312-0.59111 0.63348-1.0463 1.3897-1.3672 2.2695s-0.48047 1.831-0.48047 2.8516c0 1.0558 0.15108 2.0225 0.45508 2.9023 0.32089 0.87983 0.76758 1.6361 1.3418 2.2695 0.57422 0.63348 1.276 1.1266 2.1035 1.4785 0.82756 0.33434 1.7569 0.50195 2.7871 0.50195 1.4862 0 2.7517-0.35277 3.7988-1.0566 1.0471-0.70387 1.8254-1.8733 2.332-3.5098h-3.168c-0.11822 0.42232-0.43934 0.82772-0.96289 1.2148-0.52355 0.36953-1.1468 0.55274-1.873 0.55273-1.0133 0-1.7916-0.27286-2.332-0.81836-0.54044-0.5455-0.83605-1.4245-0.88672-2.6387h9.4492c0.06756-1.0558-0.01551-2.0673-0.25195-3.0352-0.23644-0.96782-0.62557-1.8293-1.166-2.5859-0.52356-0.75666-1.1998-1.355-2.0273-1.7949-0.82756-0.45751-1.7974-0.6875-2.9121-0.6875zm16.189 0c-0.76 0-1.5023 0.18516-2.2285 0.55469-0.72622 0.35193-1.3174 0.92299-1.7734 1.7148h-0.07617v-1.9004h-3.4199v13.646h3.5977v-7.1523c0-1.3901 0.21909-2.3841 0.6582-2.9824 0.43911-0.61588 1.1494-0.92383 2.1289-0.92383 0.86133 0 1.4611 0.28066 1.7988 0.84375 0.33777 0.5455 0.50586 1.3816 0.50586 2.5078v7.707h3.5976v-8.3926c0-0.84464-0.0765-1.6106-0.22851-2.2969-0.13511-0.70387-0.37971-1.2925-0.73438-1.7676-0.35466-0.49271-0.84386-0.87277-1.4688-1.1367-0.608-0.28155-1.3948-0.42188-2.3574-0.42188zm-66.063 0.36914 4.3066 6.4668-4.7129 7.1797h4.0293l2.7363-4.3027 2.7344 4.3027h4.1055l-4.8398-7.2578 4.3066-6.3887h-3.9766l-2.2793 3.5645-2.3066-3.5645zm13.275 0 4.584 12.803c0.10133 0.26395 0.15234 0.54461 0.15234 0.84375 0 0.40472-0.11707 0.77504-0.35352 1.1094-0.21956 0.33434-0.56617 0.52729-1.0391 0.58008-0.35467 0.0176-0.70979 0.0098-1.0645-0.02539-0.35467-0.03519-0.70128-0.07028-1.0391-0.10547v3.0879c0.37156 0.03519 0.73518 0.06051 1.0898 0.07813 0.37156 0.03519 0.74368 0.05273 1.1152 0.05273 1.2329 0 2.1943-0.23778 2.8867-0.71289 0.69244-0.47511 1.2326-1.2664 1.6211-2.375l5.4727-15.336h-3.7246l-2.8613 9.3438h-0.05078l-2.9648-9.3438zm-37.48 2.4551c0.59111 0 1.0823 0.12279 1.4707 0.36914 0.38844 0.24635 0.6991 0.57184 0.93555 0.97656 0.25333 0.38713 0.43187 0.84515 0.5332 1.373 0.10133 0.5103 0.15234 1.0482 0.15234 1.6113 0 0.56309-0.05101 1.1069-0.15234 1.6348-0.10133 0.5279-0.27137 1.0035-0.50781 1.4258-0.23644 0.40472-0.5556 0.73021-0.96094 0.97656-0.38844 0.24635-0.87959 0.36914-1.4707 0.36914-0.55733 0-1.038-0.12279-1.4434-0.36914-0.38844-0.26395-0.71806-0.59723-0.98828-1.002-0.25333-0.42232-0.43842-0.89788-0.55664-1.4258s-0.17773-1.0561-0.17773-1.584c-1e-7 -0.56309 0.05101-1.0991 0.15234-1.6094 0.11822-0.5279 0.29481-0.99567 0.53125-1.4004 0.25333-0.40472 0.58295-0.73021 0.98828-0.97656 0.40533-0.24635 0.90303-0.36914 1.4941-0.36914zm15.84 0c0.608 0 1.1142 0.13253 1.5195 0.39648 0.42222 0.24635 0.75184 0.57184 0.98828 0.97656 0.25333 0.40472 0.42992 0.87054 0.53125 1.3984 0.10133 0.5279 0.15234 1.0658 0.15234 1.6113 0 0.5455-0.05101 1.0815-0.15234 1.6094-0.10134 0.5103-0.27792 0.97612-0.53125 1.3984-0.23644 0.40472-0.56606 0.73021-0.98828 0.97656-0.40533 0.24635-0.91153 0.36914-1.5195 0.36914-0.608 0-1.1142-0.12279-1.5195-0.36914s-0.73495-0.57184-0.98828-0.97656c-0.23644-0.42232-0.40648-0.88814-0.50781-1.3984-0.10133-0.5279-0.15234-1.0639-0.15234-1.6094 0-0.5455 0.05101-1.0834 0.15234-1.6113 0.10133-0.5279 0.27137-0.99371 0.50781-1.3984 0.25333-0.40472 0.58295-0.73021 0.98828-0.97656 0.40533-0.26395 0.91153-0.39648 1.5195-0.39648zm42.602 0c0.59111 0 1.0803 0.11499 1.4688 0.34375 0.38844 0.22876 0.70105 0.5367 0.9375 0.92383 0.23644 0.38713 0.40648 0.8354 0.50781 1.3457 0.10133 0.49271 0.15039 1.0209 0.15039 1.584 0 0.4927-0.06606 0.96827-0.20117 1.4258-0.11822 0.43992-0.30526 0.83557-0.55859 1.1875-0.25333 0.35193-0.57445 0.63259-0.96289 0.84375-0.38844 0.21116-0.83513 0.31836-1.3418 0.31836-0.55733 0-1.021-0.12474-1.3926-0.37109-0.37156-0.24635-0.67566-0.56209-0.91211-0.94922-0.21956-0.38713-0.38109-0.81786-0.48242-1.293-0.08444-0.49271-0.12695-0.98581-0.12695-1.4785 0-0.5103 0.05101-0.99366 0.15234-1.4512 0.11822-0.47511 0.29676-0.89025 0.5332-1.2422 0.25333-0.36953 0.55744-0.65993 0.91211-0.87109 0.37156-0.21116 0.80974-0.31641 1.3164-0.31641zm15.535 0c0.87822 0 1.529 0.24753 1.9512 0.74023 0.43911 0.49271 0.74322 1.2138 0.91211 2.1641h-5.8535c0.01689-0.26395 0.0679-0.5641 0.15234-0.89844 0.10133-0.33434 0.26287-0.65008 0.48242-0.94922 0.23644-0.29914 0.54055-0.54667 0.91211-0.74023 0.38845-0.21116 0.86914-0.31641 1.4434-0.31641z" filter="url(#f)" opacity=".3" stroke="#969696" xlink:href="#path141"/>
<path d="m0.97202 24.161 43.605-0.0019 0.0508 3.3061-43.6 0.04174z" fill="url(#d)" stroke="#000" stroke-width=".5"/>
<path d="m10.283 3.5547v6.8633h-0.05078c-0.40533-0.66867-0.96254-1.1715-1.6719-1.5059-0.69244-0.35193-1.4282-0.52734-2.2051-0.52734-0.96267 0-1.807 0.2027-2.5332 0.60742-0.72622 0.38713-1.3344 0.90556-1.8242 1.5566-0.47289 0.65108-0.83456 1.4092-1.0879 2.2715-0.23644 0.84464-0.35547 1.7236-0.35547 2.6387 0 0.95022 0.11902 1.8643 0.35547 2.7441 0.25333 0.87983 0.615 1.6633 1.0879 2.3496 0.48978 0.66867 1.1065 1.2066 1.8496 1.6113 0.74311 0.38713 1.6044 0.58008 2.584 0.58008 0.86133 0 1.6311-0.15787 2.3066-0.47461 0.69244-0.33434 1.2497-0.87227 1.6719-1.6113h0.05078v1.7422h3.4199v-18.846zm12.875 4.8301c-1.0302 0-1.9596 0.17541-2.7871 0.52734-0.82756 0.33434-1.5358 0.81965-2.127 1.4531-0.59111 0.61588-1.0483 1.3721-1.3691 2.2695-0.32089 0.87983-0.48047 1.866-0.48047 2.957s0.15958 2.0752 0.48047 2.9551c0.32089 0.87983 0.77803 1.6361 1.3691 2.2695 0.59111 0.61588 1.2994 1.0914 2.127 1.4258 0.82756 0.33434 1.7569 0.50195 2.7871 0.50195 1.0302 0 1.9596-0.16762 2.7871-0.50195 0.84444-0.33434 1.5612-0.8099 2.1523-1.4258 0.59111-0.63348 1.0483-1.3897 1.3691-2.2695 0.32089-0.87983 0.48047-1.8641 0.48047-2.9551s-0.15958-2.0772-0.48047-2.957c-0.32089-0.89743-0.77803-1.6536-1.3691-2.2695-0.59111-0.63348-1.3079-1.1188-2.1523-1.4531-0.82756-0.35193-1.7569-0.52734-2.7871-0.52734zm41.715 0c-0.912 0-1.7223 0.18516-2.4316 0.55469-0.69244 0.36953-1.2752 0.87043-1.748 1.5039-0.47289 0.61588-0.83651 1.337-1.0898 2.1641-0.23644 0.80944-0.35352 1.6553-0.35352 2.5352 0 0.93262 0.10007 1.8214 0.30273 2.666 0.21956 0.82704 0.55767 1.556 1.0137 2.1895 0.456 0.61588 1.0387 1.109 1.748 1.4785 0.70933 0.35193 1.5536 0.5293 2.5332 0.5293 0.79378 0 1.5446-0.16762 2.2539-0.50195 0.72622-0.35193 1.2834-0.88986 1.6719-1.6113h0.05078v1.7949c0.01689 0.96782-0.21071 1.7689-0.68359 2.4023-0.456 0.63348-1.1898 0.95117-2.2031 0.95117-0.64178 0-1.2075-0.14228-1.6973-0.42383-0.48978-0.26395-0.81939-0.74731-0.98828-1.4512h-3.5723c0.05067 0.77425 0.25276 1.435 0.60742 1.9805 0.37156 0.56309 0.8287 1.0192 1.3691 1.3711 0.55733 0.35193 1.1656 0.60726 1.8242 0.76562 0.67556 0.17597 1.3328 0.26562 1.9746 0.26562 1.5031 0 2.7025-0.21245 3.5977-0.63477 0.89511-0.42232 1.5798-0.94076 2.0527-1.5566 0.47289-0.59829 0.777-1.2493 0.91211-1.9531 0.152-0.70386 0.22656-1.3295 0.22656-1.875v-12.775h-3.4199v1.8223h-0.05078c-0.43911-0.79185-0.98782-1.3551-1.6465-1.6895-0.64178-0.33434-1.3926-0.50195-2.2539-0.50195zm16.523 0c-0.99644 0-1.9088 0.18516-2.7363 0.55469-0.81067 0.36953-1.5124 0.88017-2.1035 1.5312-0.59111 0.63348-1.0463 1.3897-1.3672 2.2695s-0.48047 1.831-0.48047 2.8516c0 1.0558 0.15108 2.0225 0.45508 2.9023 0.32089 0.87983 0.76758 1.6361 1.3418 2.2695 0.57422 0.63348 1.276 1.1266 2.1035 1.4785 0.82756 0.33434 1.7569 0.50195 2.7871 0.50195 1.4862 0 2.7517-0.35278 3.7988-1.0566 1.0471-0.70386 1.8254-1.8733 2.332-3.5098h-3.168c-0.11822 0.42232-0.43934 0.82772-0.96289 1.2148-0.52355 0.36953-1.1468 0.55274-1.873 0.55273-1.0133 0-1.7916-0.27286-2.332-0.81836-0.54044-0.5455-0.83605-1.4245-0.88672-2.6387h9.4492c0.06756-1.0558-0.01551-2.0673-0.25195-3.0352-0.23644-0.96782-0.62557-1.8293-1.166-2.5859-0.52356-0.75666-1.1998-1.355-2.0273-1.7949-0.82756-0.45751-1.7974-0.6875-2.9121-0.6875zm16.189 0c-0.76 0-1.5023 0.18516-2.2285 0.55469-0.72622 0.35193-1.3174 0.923-1.7734 1.7148h-0.07617v-1.9004h-3.4199v13.646h3.5977v-7.1523c0-1.3901 0.21909-2.3841 0.6582-2.9824 0.43911-0.61588 1.1494-0.92383 2.1289-0.92383 0.86133 0 1.461 0.28066 1.7988 0.84375 0.33778 0.5455 0.50586 1.3816 0.50586 2.5078v7.707h3.5977v-8.3926c0-0.84464-0.0765-1.6106-0.22852-2.2969-0.13511-0.70387-0.3797-1.2925-0.73437-1.7676-0.35466-0.49271-0.84386-0.87277-1.4688-1.1367-0.608-0.28155-1.3948-0.42188-2.3574-0.42188zm-66.062 0.36914 4.3066 6.4668-4.7129 7.1797h4.0293l2.7363-4.3027 2.7344 4.3027h4.1055l-4.8398-7.2578 4.3066-6.3887h-3.9766l-2.2793 3.5645-2.3066-3.5645zm13.275 0 4.584 12.803c0.10133 0.26395 0.15234 0.54461 0.15234 0.84375 0 0.40472-0.11707 0.77504-0.35352 1.1094-0.21956 0.33434-0.56617 0.52729-1.0391 0.58008-0.35467 0.0176-0.70979 0.0098-1.0645-0.02539-0.35467-0.03519-0.70128-0.07027-1.0391-0.10547v3.0879c0.37156 0.03519 0.73518 0.06052 1.0898 0.07813 0.37156 0.03519 0.74368 0.05273 1.1152 0.05273 1.2329 0 2.1943-0.23778 2.8867-0.71289 0.69244-0.47511 1.2326-1.2664 1.6211-2.375l5.4727-15.336h-3.7246l-2.8613 9.3437h-0.05078l-2.9648-9.3437zm-37.48 2.4551c0.59111 0 1.0823 0.12279 1.4707 0.36914s0.6991 0.57184 0.93555 0.97656c0.25333 0.38713 0.43187 0.84515 0.5332 1.373 0.10133 0.5103 0.15234 1.0482 0.15234 1.6113 0 0.56309-0.05101 1.1069-0.15234 1.6348-0.10133 0.5279-0.27137 1.0035-0.50781 1.4258-0.23644 0.40472-0.5556 0.73021-0.96094 0.97656-0.38844 0.24635-0.87959 0.36914-1.4707 0.36914-0.55733 0-1.038-0.12279-1.4434-0.36914-0.38844-0.26395-0.71806-0.59723-0.98828-1.002-0.25333-0.42232-0.43842-0.89788-0.55664-1.4258s-0.17773-1.0561-0.17773-1.584c-1e-7 -0.56309 0.05101-1.0991 0.15234-1.6094 0.11822-0.5279 0.29481-0.99567 0.53125-1.4004 0.25333-0.40472 0.58295-0.73021 0.98828-0.97656 0.40533-0.24635 0.90303-0.36914 1.4941-0.36914zm15.84 0c0.608 0 1.1142 0.13254 1.5195 0.39648 0.42222 0.24635 0.75184 0.57184 0.98828 0.97656 0.25333 0.40472 0.42992 0.87054 0.53125 1.3984 0.10133 0.5279 0.15234 1.0658 0.15234 1.6113 0 0.5455-0.05101 1.0815-0.15234 1.6094-0.10133 0.5103-0.27792 0.97612-0.53125 1.3984-0.23644 0.40472-0.56606 0.73021-0.98828 0.97656-0.40533 0.24635-0.91153 0.36914-1.5195 0.36914-0.608 0-1.1142-0.12279-1.5195-0.36914s-0.73495-0.57184-0.98828-0.97656c-0.23644-0.42232-0.40648-0.88813-0.50781-1.3984-0.10133-0.5279-0.15234-1.0639-0.15234-1.6094 0-0.5455 0.05101-1.0834 0.15234-1.6113 0.10133-0.5279 0.27137-0.99371 0.50781-1.3984 0.25333-0.40472 0.58295-0.73021 0.98828-0.97656 0.40533-0.26395 0.91153-0.39648 1.5195-0.39648zm42.602 0c0.59111 0 1.0803 0.11499 1.4688 0.34375 0.38844 0.22876 0.70106 0.5367 0.9375 0.92383 0.23644 0.38713 0.40648 0.8354 0.50781 1.3457 0.10133 0.49271 0.15039 1.0209 0.15039 1.584 0 0.49271-0.06606 0.96827-0.20117 1.4258-0.11822 0.43992-0.30526 0.83557-0.55859 1.1875-0.25333 0.35193-0.57445 0.63259-0.96289 0.84375-0.38844 0.21116-0.83513 0.31836-1.3418 0.31836-0.55733 0-1.021-0.12474-1.3926-0.37109-0.37156-0.24635-0.67566-0.56209-0.91211-0.94922-0.21956-0.38713-0.38109-0.81786-0.48242-1.293-0.08444-0.49271-0.12695-0.98581-0.12695-1.4785 0-0.5103 0.05101-0.99366 0.15234-1.4512 0.11822-0.47511 0.29676-0.89026 0.5332-1.2422 0.25333-0.36953 0.55744-0.65993 0.91211-0.87109 0.37156-0.21116 0.80974-0.31641 1.3164-0.31641zm15.535 0c0.87822 0 1.529 0.24753 1.9512 0.74024 0.43911 0.49271 0.74322 1.2138 0.91211 2.1641h-5.8535c0.01689-0.26395 0.0679-0.5641 0.15234-0.89844 0.10133-0.33434 0.26287-0.65008 0.48242-0.94922 0.23644-0.29914 0.54055-0.54667 0.91211-0.74023 0.38845-0.21116 0.86914-0.31641 1.4434-0.31641z" fill="url(#e)" stroke="#4665A2" stroke-width=".7"/>
<path d="m52.988 27.291c0.99602-1.0359 1.3944-1.8725 1.7928-3.1076l3.8247-0.03984c0.3113 1.6096 0.82413 2.5137 1.6335 3.1474z" fill="url(#b)" stroke="#000" stroke-width=".5"/>
<path d="m73.89 24.04 28.885-0.2011-0.12476 3.3879-31.033 0.16229c1.2621-1.0234 1.9665-2.2859 2.2724-3.3491z" fill="url(#c)" stroke="#000" stroke-width=".41788"/>
</g>
</svg>
/*
@licstart The following is the entire license notice for the JavaScript code in this file.
The MIT License (MIT)
Copyright (C) 1997-2020 by Dimitri van Heesch
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@licend The above is the entire license notice for the JavaScript code in this file
*/
function toggleVisibility(linkObj)
{
var base = $(linkObj).attr('id');
var summary = $('#'+base+'-summary');
var content = $('#'+base+'-content');
var trigger = $('#'+base+'-trigger');
var src=$(trigger).attr('src');
if (content.is(':visible')===true) {
content.hide();
summary.show();
$(linkObj).addClass('closed').removeClass('opened');
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
content.show();
summary.hide();
$(linkObj).removeClass('closed').addClass('opened');
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
}
return false;
}
function updateStripes()
{
$('table.directory tr').
removeClass('even').filter(':visible:even').addClass('even');
}
function toggleLevel(level)
{
$('table.directory tr').each(function() {
var l = this.id.split('_').length-1;
var i = $('#img'+this.id.substring(3));
var a = $('#arr'+this.id.substring(3));
if (l<level+1) {
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
a.html('&#9660;');
$(this).show();
} else if (l==level+1) {
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
a.html('&#9658;');
$(this).show();
} else {
$(this).hide();
}
});
updateStripes();
}
function toggleFolder(id)
{
// the clicked row
var currentRow = $('#row_'+id);
// all rows after the clicked row
var rows = currentRow.nextAll("tr");
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
// only match elements AFTER this one (can't hide elements before)
var childRows = rows.filter(function() { return this.id.match(re); });
// first row is visible we are HIDING
if (childRows.filter(':first').is(':visible')===true) {
// replace down arrow by right arrow for current row
var currentRowSpans = currentRow.find("span");
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
currentRowSpans.filter(".arrow").html('&#9658;');
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
} else { // we are SHOWING
// replace right arrow by down arrow for current row
var currentRowSpans = currentRow.find("span");
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
currentRowSpans.filter(".arrow").html('&#9660;');
// replace down arrows by right arrows for child rows
var childRowsSpans = childRows.find("span");
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
childRowsSpans.filter(".arrow").html('&#9658;');
childRows.show(); //show all children
}
updateStripes();
}
function toggleInherit(id)
{
var rows = $('tr.inherit.'+id);
var img = $('tr.inherit_header.'+id+' img');
var src = $(img).attr('src');
if (rows.filter(':first').is(':visible')===true) {
rows.css('display','none');
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
rows.css('display','table-row'); // using show() causes jump in firefox
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
}
}
/* @license-end */
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Serial Flash (serial-flash)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Serial Flash (serial-flash)</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">Serial Flash </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md_source_peripherals_serial_flash_README_doxygen"></a> </p>
<h2><a class="anchor" id="autotoc_md1"></a>
Overview</h2>
<p >Provides functions for interacting with an external flash connected through its Single SPI/Dual SPI/Quad SPI/Octal SPI interface. The read operation can be performed in either blocking or non-blocking manner by calling the corresponding function while the write and erase operations are implemented as blocking functions. This library accepts the configuration generated using the QSPI Configurator tool but supports only one memory slot. Note that PSoC™ 6 supports up to 4 memory slots on the same QSPI block.</p>
<h2><a class="anchor" id="autotoc_md2"></a>
Features</h2>
<ul>
<li>Supports asynchronous (non-blocking) read operation</li>
<li>Implements thread-safety for use with multi-threaded RTOS environment using the <a href="https://github.com/infineon/abstraction-rtos">abstraction-rtos</a> library</li>
<li>Accepts the configuration generated by the QSPI Configurator tool</li>
<li>Supports Execute-in-Place (XIP) mode of operation</li>
<li>Provides information about the external memory to the programming tool for it to be able to program the memory, for example, when user wants to place the code into the external memory for XIP operation.</li>
<li>Allows for programming external memory if CY_ENABLE_XIP_PROGRAM is defined when building the application. Note: This is not compatible with the PSoC™ 64 series of devices.</li>
</ul>
<h2><a class="anchor" id="autotoc_md3"></a>
Quick Start</h2>
<ol type="1">
<li>Add #include "cy_serial_flash_qspi.h"</li>
<li>Add <code>DEFINES=CY_SERIAL_FLASH_QSPI_THREAD_SAFE</code> in the Makefile to enable thread-safety when used in a multi-threaded RTOS environment</li>
<li>See the <a href="https://github.com/infineon/mtb-example-psoc6-qspi-readwrite">PSoC™ 6 MCU: QSPI Flash Read and Write</a> code example to learn using this library</li>
</ol>
<p ><b>NOTE:</b> If you delete the contents of the GeneratedSource directory inside the BSP, you must re-generate the memory configuration files <em>cycfg_qspi_memslot.c/.h</em>. To do this from inside the ModusToolbox™ IDE, open the QSPI Configurator tool from the Quick Panel and press <b>Ctrl+S</b> or click <b>File &gt; Save</b>. If you open the tool outside the IDE, you need to first open the <em>design.cyqspi</em> file in the tool. To do this, click <b>File &gt; Import</b> and then locate the file inside the BSP under <em>COMPONENT_BSP_DESIGN_MODUS</em> directory.</p>
<p ><b>NOTE:</b> For devices with no internal flash (eg:CAT1B device CYW20829), user needs to disable 'config data in flash' option in QSPI Configurator.</p>
<h2><a class="anchor" id="autotoc_md4"></a>
Dependencies</h2>
<ul>
<li><a href="https://github.com/infineon/abstraction-rtos">abstraction-rtos</a> library if <code>DEFINES=CY_SERIAL_FLASH_QSPI_THREAD_SAFE</code> is added in the Makefile</li>
</ul>
<h2><a class="anchor" id="autotoc_md5"></a>
More information</h2>
<ul>
<li><a href="https://infineon.github.io/serial-flash/html/index.html">API Reference Guide</a></li>
<li><a href="http://www.cypress.com">Cypress Semiconductor, an Infineon Technologies Company</a></li>
<li><a href="https://github.com/infineon">Infineon GitHub</a></li>
<li><a href="https://www.cypress.com/products/modustoolbox-software-environment">ModusToolbox™</a></li>
<li><a href="https://github.com/infineon/Code-Examples-for-ModusToolbox-Software">PSoC™ 6 Code Examples using ModusToolbox™ IDE</a></li>
<li><a href="https://github.com/Infineon/modustoolbox-software">ModusToolbox™ Software</a></li>
<li><a href="https://community.cypress.com/docs/DOC-14644">PSoC™ 6 Resources - KBA223067</a></li>
</ul>
<hr />
<p> © Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation, 2019-2021. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
<ul>
<li class="footer">
Generated for <b>Serial Flash (serial-flash)</b> by <b>Cypress Semiconductor Corporation</b>.
All rights reserved.
</li>
</ul>
</div>
-->
</body>
</html>
/*
@licstart The following is the entire license notice for the JavaScript code in this file.
The MIT License (MIT)
Copyright (C) 1997-2020 by Dimitri van Heesch
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@licend The above is the entire license notice for the JavaScript code in this file
*/
var menudata={children:[
{text:"Home",url:"index.html"},
{text:"API Reference",url:"group__group__board__libs.html"}]}
/*
@licstart The following is the entire license notice for the JavaScript code in this file.
The MIT License (MIT)
Copyright (C) 1997-2020 by Dimitri van Heesch
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@licend The above is the entire license notice for the JavaScript code in this file
*/
var NAVTREE =
[
[ "Serial Flash (serial-flash)", "index.html", [
[ "Serial Flash", "index.html", null ],
[ "API Reference", "group__group__board__libs.html", null ]
] ]
];
var NAVTREEINDEX =
[
"group__group__board__libs.html"
];
var SYNCONMSG = 'click to disable panel synchronisation';
var SYNCOFFMSG = 'click to enable panel synchronisation';
\ No newline at end of file
var NAVTREEINDEX0 =
{
"group__group__board__libs.html":[1],
"index.html":[],
"index.html":[0],
"pages.html":[]
};
var searchData=
[
['cy_5frslt_5fserial_5fflash_5ferr_5fbad_5fparam_0',['CY_RSLT_SERIAL_FLASH_ERR_BAD_PARAM',['../group__group__board__libs.html#ga21e3c8199504eb76df66c793488e01e8',1,'cy_serial_flash_qspi.h']]],
['cy_5frslt_5fserial_5fflash_5ferr_5fdma_1',['CY_RSLT_SERIAL_FLASH_ERR_DMA',['../group__group__board__libs.html#ga63374cfb508c830f53f25682c183b610',1,'cy_serial_flash_qspi.h']]],
['cy_5frslt_5fserial_5fflash_5ferr_5fqspi_5fbusy_2',['CY_RSLT_SERIAL_FLASH_ERR_QSPI_BUSY',['../group__group__board__libs.html#ga959a08da14d528096cf8ebbfb48c5da4',1,'cy_serial_flash_qspi.h']]],
['cy_5frslt_5fserial_5fflash_5ferr_5fread_5fbusy_3',['CY_RSLT_SERIAL_FLASH_ERR_READ_BUSY',['../group__group__board__libs.html#ga41875c99fa454d69ec187e772234ce44',1,'cy_serial_flash_qspi.h']]],
['cy_5frslt_5fserial_5fflash_5ferr_5funsupported_4',['CY_RSLT_SERIAL_FLASH_ERR_UNSUPPORTED',['../group__group__board__libs.html#gabe7c8c3af5cdc0f9640b70402f543dd7',1,'cy_serial_flash_qspi.h']]],
['cy_5fserial_5fflash_5fget_5fsector_5fstart_5faddress_5',['cy_serial_flash_get_sector_start_address',['../group__group__board__libs.html#ga1aec27b28a9ce3205ce16e12c4d576b0',1,'cy_serial_flash_qspi.h']]],
['cy_5fserial_5fflash_5fqspi_5fabort_5fread_6',['cy_serial_flash_qspi_abort_read',['../group__group__board__libs.html#ga49c497643b74f2e9071e27266836f45d',1,'cy_serial_flash_qspi_abort_read(void):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga49c497643b74f2e9071e27266836f45d',1,'cy_serial_flash_qspi_abort_read(void):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fdeinit_7',['cy_serial_flash_qspi_deinit',['../group__group__board__libs.html#gac4914a8bff25287d43c661d6cd68fbfd',1,'cy_serial_flash_qspi_deinit(void):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gac4914a8bff25287d43c661d6cd68fbfd',1,'cy_serial_flash_qspi_deinit(void):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fenable_5fxip_8',['cy_serial_flash_qspi_enable_xip',['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga56772d2543b7b7f2c17ed9ddb9db941e',1,'cy_serial_flash_qspi_enable_xip(bool enable):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5ferase_9',['cy_serial_flash_qspi_erase',['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga41c8380588bc01b6a8320b23bc172649',1,'cy_serial_flash_qspi_erase(uint32_t addr, size_t length):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fget_5ferase_5fsize_10',['cy_serial_flash_qspi_get_erase_size',['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#gacaad29bc13d3a4cd243830980b21c274',1,'cy_serial_flash_qspi_get_erase_size(uint32_t addr):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fget_5fprog_5fsize_11',['cy_serial_flash_qspi_get_prog_size',['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga3b4219e6b1182c0c75704581b6cacc37',1,'cy_serial_flash_qspi_get_prog_size(uint32_t addr):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fget_5fsize_12',['cy_serial_flash_qspi_get_size',['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga7b9bff94b0c4ba30b11de9f64a0e4980',1,'cy_serial_flash_qspi_get_size(void):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5finit_13',['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):&#160;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):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fread_14',['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):&#160;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):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fread_5fasync_15',['cy_serial_flash_qspi_read_async',['../group__group__board__libs.html#ga869d6c8e2b93215608161fb889675b82',1,'cy_serial_flash_qspi_read_async(uint32_t addr, size_t length, uint8_t *buf, cy_serial_flash_qspi_read_complete_callback_t callback, void *callback_arg):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga869d6c8e2b93215608161fb889675b82',1,'cy_serial_flash_qspi_read_async(uint32_t addr, size_t length, uint8_t *buf, cy_serial_flash_qspi_read_complete_callback_t callback, void *callback_arg):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fread_5fcomplete_5fcallback_5ft_16',['cy_serial_flash_qspi_read_complete_callback_t',['../group__group__board__libs.html#gaa528d15ff15325aaec05e5a548856a19',1,'cy_serial_flash_qspi.h']]],
['cy_5fserial_5fflash_5fqspi_5fset_5fdma_5finterrupt_5fpriority_17',['cy_serial_flash_qspi_set_dma_interrupt_priority',['../group__group__board__libs.html#ga181056affe774bccde023137e1e01f3a',1,'cy_serial_flash_qspi_set_dma_interrupt_priority(uint8_t priority):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga181056affe774bccde023137e1e01f3a',1,'cy_serial_flash_qspi_set_dma_interrupt_priority(uint8_t priority):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fset_5finterrupt_5fpriority_18',['cy_serial_flash_qspi_set_interrupt_priority',['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority):&#160;cy_serial_flash_qspi.c'],['../group__group__board__libs.html#ga818e617f0abbff49f43ee1254d7bc35c',1,'cy_serial_flash_qspi_set_interrupt_priority(uint8_t priority):&#160;cy_serial_flash_qspi.c']]],
['cy_5fserial_5fflash_5fqspi_5fthread_5fsafe_19',['CY_SERIAL_FLASH_QSPI_THREAD_SAFE',['../group__group__board__libs.html#ga93bd4d9c9082ff732c56c1a6657abc32',1,'cy_serial_flash_qspi.h']]],
['cy_5fserial_5fflash_5fqspi_5fwrite_20',['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):&#160;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):&#160;cy_serial_flash_qspi.c']]]
];
var searchData=
[
['serial_20flash_0',['Serial Flash',['../group__group__board__libs.html',1,'(Global Namespace)'],['../index.html',1,'(Global Namespace)']]]
];
var searchData=
[
['serial_20flash_0',['Serial Flash',['../group__group__board__libs.html',1,'']]]
];
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册