【BSP】CY8CKIT-062S2-43012 (#6237)

英飞凌 CY8CKIT-062S2-43012 BSP
This commit is contained in:
Rbb666 2022-08-10 00:36:36 +08:00 committed by GitHub
parent 38154c4656
commit 9a8249bbba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 12875 additions and 562 deletions

View File

@ -37,6 +37,7 @@ jobs:
- {RTT_BSP: "at91/at91sam9g45", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "at91/at91sam9g45", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "at91/at91sam9260", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "at91/at91sam9260", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "allwinner_tina", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "allwinner_tina", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "cypress/psoc6-cy8cproto-4343w", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "ft32/ft32f072xb-starter", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "ft32/ft32f072xb-starter", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "gd32/arm/gd32103c-eval", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "gd32/arm/gd32103c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
- {RTT_BSP: "gd32/arm/gd32105c-eval", RTT_TOOL_CHAIN: "sourcery-arm"} - {RTT_BSP: "gd32/arm/gd32105c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}

View File

@ -38,6 +38,9 @@ if GetDepend(['BSP_USING_SPI']):
if GetDepend(['BSP_USING_ADC']): if GetDepend(['BSP_USING_ADC']):
src += ['drv_adc.c'] src += ['drv_adc.c']
if GetDepend(['BSP_USING_USBD']):
src += ['drv_usbd.c']
if GetDepend('BSP_USING_RTC'): if GetDepend('BSP_USING_RTC'):
src += ['drv_rtc.c'] src += ['drv_rtc.c']
@ -47,6 +50,9 @@ if GetDepend('BSP_USING_ON_CHIP_FLASH'):
if GetDepend(['RT_USING_WDT']): if GetDepend(['RT_USING_WDT']):
src += ['drv_wdt.c'] src += ['drv_wdt.c']
if GetDepend(['RT_USING_DAC']):
src += ['drv_dac.c']
if GetDepend(['BSP_USING_TIM']): if GetDepend(['BSP_USING_TIM']):
src += ['drv_hwtimer.c'] src += ['drv_hwtimer.c']

View File

@ -0,0 +1,181 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-07-28 rtthread qiu first version
*/
#include "drv_dac.h"
#include "drv_common.h"
#include <rtthread.h>
#if defined(BSP_USING_DAC1) || defined(BSP_USING_DAC2)
#define LOG_TAG "drv.dac"
#include <drv_log.h>
struct cyp_dac
{
cy_stc_csdidac_config_t cyhal_dac_device;
struct rt_dac_device cyp_dac_device;
char *name;
};
static struct cyp_dac dac_config[] =
{
#ifdef BSP_USING_DAC1
DAC1_CONFIG,
#endif
#ifdef BSP_USING_DAC2
DAC2_CONFIG,
#endif
};
/*get dac channel*/
static rt_uint32_t cyp_dac_get_channel(rt_uint32_t channel)
{
rt_uint32_t cyp_dac_channel = 0;
switch (channel)
{
case 1:
cyp_dac_channel = CY_CSDIDAC_A;
break;
case 2:
cyp_dac_channel = CY_CSDIDAC_B;
break;
default:
RT_ASSERT(0);
break;
}
return cyp_dac_channel;
}
struct cyp_dac cyp_adc_obj[sizeof(dac_config) / sizeof(dac_config[0])];
cy_stc_csdidac_context_t csdidac_context;
/*dac device enable*/
static rt_err_t cyp_dac_enabled(struct rt_dac_device *device, rt_uint32_t channel)
{
cy_rslt_t result;
rt_uint32_t cyp_channel;
RT_ASSERT(device != RT_NULL);
cyhal_dac_t *dac_device;
dac_device = device->parent.user_data;
/* get current dac channel*/
cyp_channel = cyp_dac_get_channel(channel);
/*DAC device init*/
result = Cy_CSDIDAC_Init(&CSDIDAC_csdidac_config, &csdidac_context);
if (result != RT_EOK)
{
LOG_E("Cy_CSDIDAC_Init fail = %d\n", result);
return -RT_ENOSYS;
}
return RT_EOK;
}
/*dac device disable*/
static rt_err_t cyp_dac_disable(struct rt_dac_device *device, rt_uint32_t channel)
{
rt_uint32_t cyp_channel;
cy_rslt_t result;
RT_ASSERT(device != RT_NULL);
cyhal_dac_t *dac_device;
dac_device = device->parent.user_data;
cyp_channel = cyp_dac_get_channel(channel);
/*DAC free device*/
result = Cy_CSDIDAC_OutputDisable(cyp_channel, &csdidac_context);
if (result != RT_EOK)
{
LOG_E("DAC Outputdisable failed. Error: %d\n", result);
return -RT_ENOSYS;
}
return RT_EOK;
}
/*set dac output value*/
static rt_err_t cyp_adc_convert(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value)
{
RT_ASSERT(device != RT_NULL);
cy_rslt_t result;
rt_uint32_t cyp_channel;
cyp_channel = cyp_dac_get_channel(channel);
result = Cy_CSDIDAC_OutputEnable(cyp_channel, *value, &csdidac_context);
if (result != RT_EOK)
{
LOG_E("DAC channel initialization failed. Error: %d\n", result);
return -RT_ENOSYS;
}
return RT_EOK;
}
static const struct rt_dac_ops cyp_dac_ops =
{
.disabled = cyp_dac_disable,
.enabled = cyp_dac_enabled,
.convert = cyp_adc_convert,
};
/*dac device init*/
static int rt_hw_dac_init(void)
{
int result = RT_EOK;
/* save dac name */
char name_buf[5] = {'d', 'a', 'c', '0', 0};
int i = 0;
i = sizeof(dac_config) / sizeof(dac_config[0]);
for (i = 0; i < sizeof(dac_config) / sizeof(dac_config[0]); i++)
{
#ifdef BSP_USING_DAC1
name_buf[3] = '1';
#endif
#ifdef BSP_USING_DAC2
name_buf[3] = '2';
#endif
/* register DAC device */
if (rt_hw_dac_register(&cyp_adc_obj[i].cyp_dac_device, name_buf, &cyp_dac_ops, RT_NULL) == RT_EOK)
{
LOG_E("dac device register success\n");
}
else
{
LOG_E("dac device register fail\n");
result = -RT_ERROR;
}
}
return result;
}
INIT_BOARD_EXPORT(rt_hw_dac_init);
#endif /* BSP_USING_DAC1 /BSP_USING_DAC2 */

View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-07-28 rtthread qiu first version
*/
#ifndef __DRV__DAC_H__
#define __DRV__DAC_H__
#include "rtconfig.h"
#include "cycfg.h"
#include <rtthread.h>
#include "cy_csdidac.h"
#include "cycfg_peripherals.h"
static const cy_stc_csdidac_pin_t CSDIDAC_csdidac_a_pin =
{
.ioPcPtr = GPIO_PRT10,
.pin = 0u,
};
static const cy_stc_csdidac_pin_t CSDIDAC_csdidac_b_pin =
{
.ioPcPtr = GPIO_PRT10,
.pin = 0u,
};
const cy_stc_csdidac_config_t CSDIDAC_csdidac_config =
{
.base = CSD0,
.csdCxtPtr = &cy_csd_0_context,
.configA = CY_CSDIDAC_GPIO,
.configB = CY_CSDIDAC_GPIO,
.ptrPinA = (const cy_stc_csdidac_pin_t *)&CSDIDAC_csdidac_a_pin,
.ptrPinB = (const cy_stc_csdidac_pin_t *)&CSDIDAC_csdidac_b_pin,
.cpuClk = 100000000u,
.csdInitTime = 25u,
};
#ifdef BSP_USING_DAC1
#ifndef DAC1_CONFIG
#define DAC1_CONFIG \
{ \
.name = "dac1", \
}
#endif /* DAC1_CONFIG */
#endif /*BSP_USING_DAC2*/
#ifdef BSP_USING_DAC2
#ifndef DAC2_CONFIG
#define DAC2_CONFIG \
{ \
.name = "dac2", \
}
#endif /* DAC2_CONFIG */
#endif /*BSP_USING_DAC2*/
#endif /*__DRV__DAC_H__*/

View File

@ -15,8 +15,6 @@
#include <rtdevice.h> #include <rtdevice.h>
#include "drv_common.h" #include "drv_common.h"
#include "cy_retarget_io.h"
#include "cyhal_gpio.h"
#include "cyhal_irq_psoc.h" #include "cyhal_irq_psoc.h"
#define GPIO_INTERRUPT_PRIORITY (7u) #define GPIO_INTERRUPT_PRIORITY (7u)

View File

@ -12,7 +12,6 @@
#include "drv_uart.h" #include "drv_uart.h"
#include "uart_config.h" #include "uart_config.h"
#include "cy_retarget_io.h"
#include "cyhal_scb_common.h" #include "cyhal_scb_common.h"
enum enum

View File

@ -15,7 +15,6 @@
#include <rtdevice.h> #include <rtdevice.h>
#include "board.h" #include "board.h"
#include "cycfg_peripherals.h"
#define uart_isr_callback(name) name##_isr_callback #define uart_isr_callback(name) name##_isr_callback

View File

@ -20,7 +20,7 @@ extern "C" {
#ifdef BSP_USING_UART0 #ifdef BSP_USING_UART0
/* UART0 device driver structure */ /* UART0 device driver structure */
cy_stc_sysint_t UART2_SCB_IRQ_cfg = cy_stc_sysint_t UART0_SCB_IRQ_cfg =
{ {
.intrSrc = (IRQn_Type) scb_0_interrupt_IRQn, .intrSrc = (IRQn_Type) scb_0_interrupt_IRQn,
.intrPriority = (7u), .intrPriority = (7u),

View File

@ -20,7 +20,6 @@ src = Split('''
mtb-hal-cat1/source/cyhal_utils.c mtb-hal-cat1/source/cyhal_utils.c
mtb-hal-cat1/source/cyhal_lptimer.c mtb-hal-cat1/source/cyhal_lptimer.c
mtb-hal-cat1/source/cyhal_irq_psoc.c mtb-hal-cat1/source/cyhal_irq_psoc.c
mtb-hal-cat1/include_pvt/cyhal_hw_types.h
mtb-hal-cat1/COMPONENT_CAT1A/source/triggers/cyhal_triggers_psoc6_02.c mtb-hal-cat1/COMPONENT_CAT1A/source/triggers/cyhal_triggers_psoc6_02.c
mtb-hal-cat1/COMPONENT_CAT1A/source/pin_packages/cyhal_psoc6_02_124_bga.c mtb-hal-cat1/COMPONENT_CAT1A/source/pin_packages/cyhal_psoc6_02_124_bga.c
mtb-pdl-cat1/devices/COMPONENT_CAT1A/source/cy_device.c mtb-pdl-cat1/devices/COMPONENT_CAT1A/source/cy_device.c
@ -38,7 +37,6 @@ src = Split('''
mtb-pdl-cat1/drivers/source/cy_ipc_drv.c mtb-pdl-cat1/drivers/source/cy_ipc_drv.c
mtb-pdl-cat1/drivers/source/cy_trigmux.c mtb-pdl-cat1/drivers/source/cy_trigmux.c
mtb-pdl-cat1/drivers/source/cy_prot.c mtb-pdl-cat1/drivers/source/cy_prot.c
mtb-pdl-cat1/drivers/source/TOOLCHAIN_ARM/cy_syslib_mdk.s
TARGET_CY8CKIT-062S2-43012/cybsp.c TARGET_CY8CKIT-062S2-43012/cybsp.c
TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/system_psoc6_cm4.c TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/system_psoc6_cm4.c
TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c
@ -95,6 +93,16 @@ if GetDepend(['RT_USING_SPI']):
if GetDepend(['RT_USING_I2C']): if GetDepend(['RT_USING_I2C']):
src += ['mtb-hal-cat1/source/cyhal_i2c.c'] src += ['mtb-hal-cat1/source/cyhal_i2c.c']
if GetDepend('BSP_USING_USBD'):
src += ['mtb_shared/usbdev/cy_usb_dev.c']
src += ['mtb_shared/usbdev/cy_usb_dev_hid.c']
src += ['mtb-hal-cat1/source/cyhal_usb_dev.c']
src += ['mtb-pdl-cat1/drivers/source/cy_dma.c']
src += ['mtb-pdl-cat1/drivers/source/cy_usbfs_dev_drv.c']
src += ['mtb-pdl-cat1/drivers/source/cy_usbfs_dev_drv_io.c']
src += ['mtb-pdl-cat1/drivers/source/cy_usbfs_dev_drv_io_dma.c']
src += ['TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_usbdev.c']
if GetDepend('BSP_USING_RTC'): if GetDepend('BSP_USING_RTC'):
src += ['mtb-pdl-cat1/drivers/source/cy_rtc.c'] src += ['mtb-pdl-cat1/drivers/source/cy_rtc.c']
src += ['mtb-hal-cat1/source/cyhal_rtc.c'] src += ['mtb-hal-cat1/source/cyhal_rtc.c']
@ -121,6 +129,9 @@ if GetDepend(['RT_USING_WDT']):
src += ['mtb-pdl-cat1/drivers/source/cy_wdt.c'] src += ['mtb-pdl-cat1/drivers/source/cy_wdt.c']
src += ['mtb-hal-cat1/source/cyhal_wdt.c'] src += ['mtb-hal-cat1/source/cyhal_wdt.c']
if GetDepend(['RT_USING_DAC']):
src += ['mtb_shared/csdidac/cy_csdidac.c']
if GetDepend(['RT_USING_HWTIMER']): if GetDepend(['RT_USING_HWTIMER']):
src += ['mtb-hal-cat1/source/cyhal_timer.c'] src += ['mtb-hal-cat1/source/cyhal_timer.c']
@ -129,13 +140,14 @@ path = [cwd + '/capsense',
cwd + '/retarget-io', cwd + '/retarget-io',
cwd + '/core-lib/include', cwd + '/core-lib/include',
cwd + '/mtb_shared/serial-flash', cwd + '/mtb_shared/serial-flash',
cwd + '/mtb-hal-cat1/include', cwd + '/mtb_shared/usbdev',
cwd + '/mtb-hal-cat1/include_pvt', cwd + '/mtb_shared/csdidac',
cwd + '/mtb-pdl-cat1/cmsis/include', cwd + '/mtb-pdl-cat1/cmsis/include',
cwd + '/mtb-pdl-cat1/drivers/include', cwd + '/mtb-pdl-cat1/drivers/include',
cwd + '/mtb-hal-cat1/COMPONENT_CAT1A/include',
cwd + '/mtb-pdl-cat1/devices/COMPONENT_CAT1A/include', cwd + '/mtb-pdl-cat1/devices/COMPONENT_CAT1A/include',
cwd + '/mtb-pdl-cat1/devices/COMPONENT_CAT1B/include', cwd + '/mtb-hal-cat1/include_pvt',
cwd + '/mtb-hal-cat1/include',
cwd + '/mtb-hal-cat1/COMPONENT_CAT1A/include',
cwd + '/TARGET_CY8CKIT-062S2-43012', cwd + '/TARGET_CY8CKIT-062S2-43012',
cwd + '/TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource'] cwd + '/TARGET_CY8CKIT-062S2-43012/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource']

View File

@ -156,66 +156,86 @@ static uint8_t _cyhal_scb_get_block_from_irqn(_cyhal_system_irq_t irqn)
switch (irqn) switch (irqn)
{ {
#if (_SCB_ARRAY_SIZE > 0) #if (_SCB_ARRAY_SIZE > 0)
case scb_0_interrupt_IRQn: return 0; case scb_0_interrupt_IRQn:
return 0;
#endif #endif
#if (_SCB_ARRAY_SIZE > 1) #if (_SCB_ARRAY_SIZE > 1)
case scb_1_interrupt_IRQn: return 1; case scb_1_interrupt_IRQn:
return 1;
#endif #endif
#if (_SCB_ARRAY_SIZE > 2) #if (_SCB_ARRAY_SIZE > 2)
case scb_2_interrupt_IRQn: return 2; case scb_2_interrupt_IRQn:
return 2;
#endif #endif
#if (_SCB_ARRAY_SIZE > 3) #if (_SCB_ARRAY_SIZE > 3)
#if !defined(CY_DEVICE_PSOC6A256K) #if !defined(CY_DEVICE_PSOC6A256K)
case scb_3_interrupt_IRQn: return 3; case scb_3_interrupt_IRQn:
return 3;
#endif #endif
#endif #endif
#if (_SCB_ARRAY_SIZE > 4) #if (_SCB_ARRAY_SIZE > 4)
case scb_4_interrupt_IRQn: return 4; case scb_4_interrupt_IRQn:
return 4;
#endif #endif
#if (_SCB_ARRAY_SIZE > 5) #if (_SCB_ARRAY_SIZE > 5)
case scb_5_interrupt_IRQn: return 5; case scb_5_interrupt_IRQn:
return 5;
#endif #endif
#if (_SCB_ARRAY_SIZE > 6) #if (_SCB_ARRAY_SIZE > 6)
case scb_6_interrupt_IRQn: return 6; case scb_6_interrupt_IRQn:
return 6;
#endif #endif
#if (_SCB_ARRAY_SIZE > 7) #if (_SCB_ARRAY_SIZE > 7)
case scb_7_interrupt_IRQn: return 7; case scb_7_interrupt_IRQn:
return 7;
#endif #endif
#if (_SCB_ARRAY_SIZE > 8) #if (_SCB_ARRAY_SIZE > 8)
case scb_8_interrupt_IRQn: return 8; case scb_8_interrupt_IRQn:
return 8;
#endif #endif
#if (_SCB_ARRAY_SIZE > 9) #if (_SCB_ARRAY_SIZE > 9)
case scb_9_interrupt_IRQn: return 9; case scb_9_interrupt_IRQn:
return 9;
#endif #endif
#if (_SCB_ARRAY_SIZE > 10) #if (_SCB_ARRAY_SIZE > 10)
case scb_10_interrupt_IRQn: return 10; case scb_10_interrupt_IRQn:
return 10;
#endif #endif
#if (_SCB_ARRAY_SIZE > 11) #if (_SCB_ARRAY_SIZE > 11)
case scb_11_interrupt_IRQn: return 11; case scb_11_interrupt_IRQn:
return 11;
#endif #endif
#if (_SCB_ARRAY_SIZE > 12) #if (_SCB_ARRAY_SIZE > 12)
case scb_12_interrupt_IRQn: return 12; case scb_12_interrupt_IRQn:
return 12;
#endif #endif
#if (_SCB_ARRAY_SIZE > 13) #if (_SCB_ARRAY_SIZE > 13)
case scb_13_interrupt_IRQn: return 13; case scb_13_interrupt_IRQn:
return 13;
#endif #endif
#if (_SCB_ARRAY_SIZE > 14) #if (_SCB_ARRAY_SIZE > 14)
case scb_14_interrupt_IRQn: return 14; case scb_14_interrupt_IRQn:
return 14;
#endif #endif
#if (_SCB_ARRAY_SIZE > 15) #if (_SCB_ARRAY_SIZE > 15)
case scb_15_interrupt_IRQn: return 15; case scb_15_interrupt_IRQn:
return 15;
#endif #endif
#if (_SCB_ARRAY_SIZE > 16) #if (_SCB_ARRAY_SIZE > 16)
case scb_16_interrupt_IRQn: return 16; case scb_16_interrupt_IRQn:
return 16;
#endif #endif
#if (_SCB_ARRAY_SIZE > 17) #if (_SCB_ARRAY_SIZE > 17)
case scb_17_interrupt_IRQn: return 17; case scb_17_interrupt_IRQn:
return 17;
#endif #endif
#if (_SCB_ARRAY_SIZE > 18) #if (_SCB_ARRAY_SIZE > 18)
case scb_18_interrupt_IRQn: return 18; case scb_18_interrupt_IRQn:
return 18;
#endif #endif
#if (_SCB_ARRAY_SIZE > 19) #if (_SCB_ARRAY_SIZE > 19)
case scb_19_interrupt_IRQn: return 19; case scb_19_interrupt_IRQn:
return 19;
#endif #endif
#if (_SCB_ARRAY_SIZE > 20) #if (_SCB_ARRAY_SIZE > 20)
#error "Unhandled scb count" #error "Unhandled scb count"

View File

@ -0,0 +1,55 @@
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 Modus Toolbox 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 partys 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.

View File

@ -0,0 +1,36 @@
# Cypress CSDIDAC Middleware Library
### Overview
The CSDIDAC provides an API that allows the CSD HW block IDAC functionality.
It can be useful for devices that do not include other DAC options.
### Features
* A two-channel IDAC with the 7-bit resolution
* The IDAC A and IDAC B channels can be enabled/disabled independently
* The IDAC A and IDAC B channels can be configured with sourcing/sinking current independently
* The IDAC A and IDAC B channels can be joined to increase a maximum output current
* The IDAC A and IDAC B channels can be enabled/disabled simultaneously by using the CY_CSDIDAC_AB option
* The 0 to 609.6 uA (609600 nA) current range is available for each IDAC channel
* Each IDAC can use independently one of the six available LSB depending on a desired output current
### Quick Start
The CSDIDAC could be configured by the ModusToolbox CSD personality. Refer to the [API Reference Guide Configuration Considerations](https://cypresssemiconductorco.github.io/csdidac/csdidac_api_reference_manual/html/index.html#group_csdidac_configuration).
### More information
The following resources contain more information:
* [CSDIDAC Middleware RELEASE.md](./RELEASE.md)
* [CSDIDAC Middleware API Reference Guide](https://cypresssemiconductorco.github.io/csdidac/csdidac_api_reference_manual/html/index.html)
* [ModusToolbox Software Environment, Quick Start Guide, Documentation, and Videos](https://www.cypress.com/products/modustoolbox-software-environment)
* [CSDIDAC Middleware Code Example for MBED OS](https://github.com/cypresssemiconductorco/mbed-os-example-csdidac)
* [ModusToolbox Device Configurator Tool Guide](https://www.cypress.com/ModusToolboxDeviceConfig)
* [CapSense Middleware API Reference Guide](https://cypresssemiconductorco.github.io/capsense/capsense_api_reference_manual/html/index.html)
* [CSDADC Middleware API Reference Guide](https://cypresssemiconductorco.github.io/csdadc/csdadc_api_reference_manual/html/index.html)
* [PSoC 6 Technical Reference Manual](https://www.cypress.com/documentation/technical-reference-manuals/psoc-6-mcu-psoc-63-ble-architecture-technical-reference)
* [PSoC 63 with BLE Datasheet Programmable System-on-Chip datasheet](http://www.cypress.com/ds218787)
* [PSoC 4000S Family: PSoC 4 Architecture Technical Reference Manual (TRM)](https://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psoc-4-architecture-technical-reference)
* [PSoC 4100S and PSoC 4100S Plus: PSoC 4 Architecture Technical Reference Manual (TRM)](https://www.cypress.com/documentation/technical-reference-manuals/psoc-4100s-and-psoc-4100s-plus-psoc-4-architecture)
* [Cypress Semiconductor](http://www.cypress.com)
---
© Cypress Semiconductor Corporation, 2019.

View File

@ -0,0 +1,44 @@
# Cypress CSDIDAC Middleware Library 2.10
### What's Included?
Please refer to the [README.md](./README.md) and the [API Reference Guide](https://cypresssemiconductorco.github.io/csdidac/csdidac_api_reference_manual/html/index.html) for a complete description of the CSDIDAC Middleware.
The revision history of the CSDIDAC Middleware is also available on the [API Reference Guide Changelog](https://cypresssemiconductorco.github.io/csdidac/csdidac_api_reference_manual/html/index.html#group_csdidac_changelog).
New in this release:
* Added the support for the PSoC 4100S Plus devices
### Supported Software and Tools
This version of the CSDIDAC Middleware was validated for compatibility with the following Software and Tools:
| Software and Tools | Version |
| :--- | :----: |
| ModusToolbox Software Environment | 2.1 |
| - ModusToolbox Device Configurator | 2.1 |
| - ModusToolbox CSD Personality for PSoC4 devices in Device Configurator | 1.0 |
| - ModusToolbox CSD Personality for PSoC6 devices in Device Configurator | 2.0 |
| PSoC4 Peripheral Driver Library (PDL) | 1.0.0 |
| PSoC6 Peripheral Driver Library (PDL) | 1.5.0 |
| GCC Compiler | 7.2.1 |
| IAR Compiler | 8.32 |
| ARM Compiler 6 | 6.11 |
| MBED OS | 5.15.1 |
| FreeRTOS | 10.0.1 |
### More information
The following resources contain more information:
* [CSDIDAC Middleware RELEASE.md](./RELEASE.md)
* [CSDIDAC Middleware API Reference Guide](https://cypresssemiconductorco.github.io/csdidac/csdidac_api_reference_manual/html/index.html)
* [ModusToolbox Software Environment, Quick Start Guide, Documentation, and Videos](https://www.cypress.com/products/modustoolbox-software-environment)
* [CSDIDAC Middleware Code Example for MBED OS](https://github.com/cypresssemiconductorco/mbed-os-example-csdidac)
* [ModusToolbox Device Configurator Tool Guide](https://www.cypress.com/ModusToolboxDeviceConfig)
* [CapSense Middleware API Reference Guide](https://cypresssemiconductorco.github.io/capsense/capsense_api_reference_manual/html/index.html)
* [CSDADC Middleware API Reference Guide](https://cypresssemiconductorco.github.io/csdadc/csdadc_api_reference_manual/html/index.html)
* [PSoC 6 Technical Reference Manual](https://www.cypress.com/documentation/technical-reference-manuals/psoc-6-mcu-psoc-63-ble-architecture-technical-reference)
* [PSoC 63 with BLE Datasheet Programmable System-on-Chip datasheet](http://www.cypress.com/ds218787)
* [PSoC 4000S Family: PSoC 4 Architecture Technical Reference Manual (TRM)](https://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psoc-4-architecture-technical-reference)
* [PSoC 4100S and PSoC 4100S Plus: PSoC 4 Architecture Technical Reference Manual (TRM)](https://www.cypress.com/documentation/technical-reference-manuals/psoc-4100s-and-psoc-4100s-plus-psoc-4-architecture)
* [Cypress Semiconductor](http://www.cypress.com)
---
© Cypress Semiconductor Corporation, 2019-2020.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
<version>2.10.0.248</version>

View File

@ -0,0 +1 @@
/docs

View File

@ -0,0 +1 @@
test/*

View File

@ -0,0 +1,210 @@
CYPRESS (AN INFINEON COMPANY) 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.

View File

@ -0,0 +1,69 @@
# USB Device Middleware Library
## Overview
The USB Device middleware provides a full-speed
[USB 2.0 Chapter 9 specification](https://usb.org/document-library/usb-20-specification)
compliant device framework. It uses the USBFS driver from
CAT1A/CAT2 Peripheral Driver Library to interface with the hardware.
The middleware provides support for Audio, CDC, HID and Vendor classes.
It also enables implementing support for other classes. The USB Configurator
tool makes it easy to construct a USB Device descriptor.
## Features
* USB Full-Speed Device Framework
* USB Device Configurator
* The following USB Classes are supported:
* Audio Class
* CDC: Communication Device Class
* HID: Human Interface Device
* Adding Custom Class Support
* Vendor-Specific Requests Support
* Power Status Reporting for Self-Powered Devices
* Blocking API Timeout Function Redefinition
* Compliance with [MISRA-C:2012 coding standard](https://www.misra.org.uk/)
## USB Device Specific Instructions
The user must ensure that the parameters selected in the USB Device personality
are aligned with the descriptor configuration in the USB Configurator, because
there is no connection between the USB Device personality in the Device
Configurator and USB Configurator.
Specifically, parameter "Endpoints Mask" in the USB personality must be aligned
with the endpoints selected in the USB Configurator. If DMA Automatic mode is
selected, parameter "Endpoint Buffer Size" must be aligned with the total size
of the endpoint buffers allocated in the USB Configurator.
## Quick Start
Configure the USB Device using the ModusToolbox™ USB Device personality and
USB Device Configurator. Refer to the
[API Reference Quick Start Guide](https://infineon.github.io/usbdev/usbfs_dev_api_reference_manual/html/index.html)
## More information
The following links provide more information:
* [USB Device Middleware Library Release Notes](./RELEASE.md)
* [USB Device Middleware Library API Reference](https://infineon.github.io/usbdev/usbfs_dev_api_reference_manual/html/index.html)
* [CAT1 Peripheral Driver Library API Reference](https://infineon.github.io/mtb-pdl-cat1/pdl_api_reference_manual/html/index.html)
* [CAT2 Peripheral Driver Library API Reference](https://infineon.github.io/mtb-pdl-cat2/pdl_api_reference_manual/html/index.html)
* [ModusToolbox™ Software Environment, Quick Start Guide, Documentation, and Videos](https://www.cypress.com/products/modustoolbox-software-environment)
* [PSoC™ 6 SDK Examples](https://github.com/Infineon?q=mtb-example-psoc6%20NOT%20Deprecated)
* [ModusToolbox™ USB Configurator Tool Guide](https://www.cypress.com/ModusToolboxUSBConfig)
* [ModusToolbox™ Device Configurator Tool Guide](https://www.cypress.com/ModusToolboxDeviceConfig)
* [PSoC™ 6 WiFi-BT Pioneer Kit](http://www.cypress.com/CY8CKIT-062-WiFi-BT)
* [PSoC™ 6 Wi-Fi BT Prototyping Kit](http://www.cypress.com/cy8cproto-062-4343w)
* [PSoC™ 6 MCU Datasheets](http://www.cypress.com/psoc6ds)
* [PSoC™ 6 MCU Application Notes](http://www.cypress.com/psoc6an)
* [PSoC™ 6 MCU Technical Reference Manuals](http://www.cypress.com/psoc6trm)
* [PMG1-S2 Prototyping Kit](http://www.cypress.com/CY7112)
* [PMG1-S3 Prototyping Kit](http://www.cypress.com/CY7113)
* [PMG1 Datasheets](https://www.cypress.com/PMG1DS)
* [CYPRESS™ Semiconductor](http://www.cypress.com)
---
© 2019-2021, CYPRESS™ Semiconductor Corporation (an Infineon company)
or an affiliate of CYPRESS™ Semiconductor Corporation.

View File

@ -0,0 +1,62 @@
# USB Device Middleware Library 2.10
## What's Included?
For a complete description of the USB Device Middleware, refer to
[README.md](./README.md) and the
[USB Device API Reference](https://infineon.github.io/usbdev/usbfs_dev_api_reference_manual/html/index.html).
The revision history of the USB Device Middleware is also available in the
[API Reference Changelog](https://infineon.github.io/usbdev/usbfs_dev_api_reference_manual/html/index.html#group_usb_dev_changelog).
New in this release:
* Updated the middleware to support configurations without any data endpoints.
* Added support for the PMG1 Family of MCUs.
* Updated the middleware to comply with MISRA-C:2012 standard.
## Defect Fixes
* Fixed an issue in vendor class request handling.
## USB Device Specific Instructions
The user must ensure that the parameters selected in the USB Device personality
are aligned with the descriptor configuration in the USB Configurator, because
there is no connection between the USB Device personality in the Device
Configurator and USB Configurator.
Specifically, parameter "Endpoints Mask" in the USB personality must be aligned
with the endpoints selected in the USB Configurator. If DMA Automatic mode is
selected, parameter "Endpoint Buffer Size" must be aligned with the total size
of the endpoint buffers allocated in the USB Configurator.
## Known Issues
| Problem | Workaround |
| ------- | ---------- |
| The USB Device ignores LPM requests after wake up from Deep Sleep. | Call USBFS driver Cy_USBFS_Dev_Drv_Lpm_SetResponse() after calling Cy_USBFS_Dev_Drv_Resume() to restore response to the LPM packets. |
| The USB Device modes with DMA do not work after wake up from Deep Sleep, due to incorrect restore of the ARB_CFG register. | Save ARB_CFG values before entering Deep Sleep and restore it after calling of Cy_USBFS_Dev_Drv_Resume. |
## Supported Software and Tools
This version of the USB Device Middleware was validated for compatibility with the following Software and Tools:
| Software and Tools | Version |
| :--- | :----: |
| ModusToolbox™ Software Environment | 2.3 |
| - ModusToolbox™ Device Configurator | 3.0 |
| - ModusToolbox™ USB Device Personality in Device Configurator | 1.1 |
| - ModusToolbox™ USB Device Configurator | 2.30 |
| MTB CAT1A Peripheral Driver Library (PDL) | 2.2.1 |
| MTB CAT2 Peripheral Driver Library (PDL) | 1.2.0 |
| GCC Compiler | 9.3.1 |
| IAR Compiler | 8.42.2 |
| ARM Compiler 6 | 6.16 |
## More information
For a more information, refer to [README.md](./README.md)
---
© 2019-2021, CYPRESS™ Semiconductor Corporation (an Infineon company)
or an affiliate of CYPRESS™ Semiconductor Corporation.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
/***************************************************************************//**
* \file cy_usb_dev_audio.c
* \version 2.10
*
* Provides Audio class-specific API implementation.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cy_usb_dev_audio.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
/*******************************************************************************
* Function Name: Cy_USB_Dev_Audio_Init
****************************************************************************//**
*
* Initializes the Audio class.
* This function must be called to enable USB Device Audio functionality.
*
* \param config
* Pass NULL as an argument (left for future purposes).
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_audio_context_t
* allocated by the user. The structure is used during the Audio Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \param devContext
* The pointer to the USB Device context structure \ref cy_stc_usb_dev_context_t.
*
* \return
* Status code of the function execution \ref cy_en_usb_dev_status_t.
*
*******************************************************************************/
cy_en_usb_dev_status_t Cy_USB_Dev_Audio_Init(void const *config,
cy_stc_usb_dev_audio_context_t *context,
cy_stc_usb_dev_context_t *devContext)
{
/* Suppress a compiler warning about unused variables */
(void) config;
if ((NULL == context) || (NULL == devContext))
{
return CY_USB_DEV_BAD_PARAM;
}
/* Store device context */
context->devContext = devContext;
return Cy_USB_Dev_RegisterClass(&context->classItem, &context->classObj, context, devContext);
}
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
/* [] END OF FILE */

View File

@ -0,0 +1,217 @@
/***************************************************************************//**
* \file cy_usb_dev_audio.h
* \version 2.10
*
* Provides Audio class-specific API declarations.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
/**
* \addtogroup group_usb_dev_audio
* This section provides API description for the Audio class.
* \{
* \defgroup group_usb_dev_audio_macros Macros
* \defgroup group_usb_dev_audio_functions Functions
* \defgroup group_usb_dev_audio_data_structures Data Structures
* \}
*/
#if !defined(CY_USB_DEV_AUDIO_H)
#define CY_USB_DEV_AUDIO_H
#include "cy_usb_dev.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* Enumerated Types
*******************************************************************************/
/*******************************************************************************
* Type Definitions
*******************************************************************************/
/**
* \addtogroup group_usb_dev_audio_data_structures
* \{
*/
/** Audio class context structure.
* All fields for the Audio context structure are internal. Firmware never reads or
* writes these values. Firmware allocates the structure and provides the
* address of the structure to the middleware in Audio function calls. Firmware
* must ensure that the defined instance of this structure remains in scope while
* the middleware is in use.
*/
typedef struct
{
/** \cond INTERNAL*/
/** Pointer to device context */
cy_stc_usb_dev_context_t *devContext;
/** Audio class functions pointers */
cy_stc_usb_dev_class_t classObj;
/** Audio class linked list item */
cy_stc_usb_dev_class_ll_item_t classItem;
/** \endcond */
} cy_stc_usb_dev_audio_context_t;
/** \} group_usb_dev_audio_data_structures */
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
/**
* \addtogroup group_usb_dev_audio_functions
* \{
*/
cy_en_usb_dev_status_t Cy_USB_Dev_Audio_Init(void const *config,
cy_stc_usb_dev_audio_context_t *context,
cy_stc_usb_dev_context_t *devContext);
__STATIC_INLINE void Cy_USB_Dev_Audio_RegisterUserCallback(cy_cb_usb_dev_request_received_t requestReceivedHandle,
cy_cb_usb_dev_request_cmplt_t requestCompletedHandle,
cy_stc_usb_dev_audio_context_t *context);
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_Audio_GetClass(cy_stc_usb_dev_audio_context_t *context);
/** \} group_usb_dev_audio_functions */
/*******************************************************************************
* API Constants
*******************************************************************************/
/**
* \addtogroup group_usb_dev_audio_macros
* \{
*/
#define CY_USB_DEV_AUDIO_RQST_GET_CUR (0x81u) /**< GET_CUR Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_GET_MIN (0x82u) /**< GET_MIN Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_GET_MAX (0x83u) /**< GET_MAX Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_GET_RES (0x84u) /**< GET_RES Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_GET_MEM (0x85u) /**< GET_MEM Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_GET_STAT (0xFFu) /**< GET_STAT Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_SET_CUR (0x01u) /**< SET_CUR Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_SET_MIN (0x02u) /**< SET_MIN Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_SET_MAX (0x03u) /**< SET_MAX Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_SET_RES (0x04u) /**< SET_RES Audio v1.0 request */
#define CY_USB_DEV_AUDIO_RQST_SET_MEM (0x05u) /**< SET_STAT Audio v1.0 request */
#define CY_USB_DEV_AUDIO2_RQST_CUR (0x01u) /**< CUR Audio v2.0 request */
#define CY_USB_DEV_AUDIO2_RQST_RANGE (0x02u) /**< RANGE Audio v2.0 request */
#define CY_USB_DEV_AUDIO2_RQST_MEM (0x03u) /**< MEM Audio v2.0 request */
#define CY_USB_DEV_AUDIO_MASTER_CHANNEL (0U) /**< Master channel */
#define CY_USB_DEV_AUDIO_VOLUME_MIN (0x8001U) /**< Volume minimum value */
#define CY_USB_DEV_AUDIO_VOLUME_MAX (0x7FFFU) /**< Volume maximum value */
#define CY_USB_DEV_AUDIO_VOLUME_SILENCE (0x8000U) /**< Volume value that represent silence (CUR attribute only) */
#define CY_USB_DEV_AUDIO_VOLUME_MIN_MSB (0x80U) /**< Volume minimum value MSB */
#define CY_USB_DEV_AUDIO_VOLUME_MIN_LSB (0x01U) /**< Volume minimum value LSB */
#define CY_USB_DEV_AUDIO_VOLUME_MAX_MSB (0x7FU) /**< Volume maximum value MSB */
#define CY_USB_DEV_AUDIO_VOLUME_MAX_LSB (0xFFU) /**< Volume maximum value LSB */
/** \} group_usb_dev_audio_macros */
/*******************************************************************************
* Internal Constants
*******************************************************************************/
/*******************************************************************************
* In-line Function Implementation
*******************************************************************************/
/**
* \addtogroup group_usb_dev_audio_functions
* \{
*/
/*******************************************************************************
* Function Name: Cy_USB_Dev_Audio_RegisterUserCallback
****************************************************************************//**
*
* Registers the user callbacks to handle Audio class requests.
*
* \param requestReceivedHandle
* The pointer to a callback function.
* This function is called when setup packet was received from the USB Host but was
* not recognized. Therefore this might require Audio class processing.
* To remove the callback function, pass a NULL as the function pointer.
*
* \param requestCompletedHandle
* The pointer to a callback function.
* This function is called when the USB Device received data from the USB Host
* as part of current request processing. The requestReceivedHandle function
* must enable notification to trigger this event. This makes sense only when class
* request processing requires a data stage.
* To remove the callback function, pass a NULL as the function pointer.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_context_t allocated
* by the user. The structure is used during the Audio Class operation for
* internal configuration and data retention. The user must not modify anything
* in this structure.
*
*******************************************************************************/
__STATIC_INLINE void Cy_USB_Dev_Audio_RegisterUserCallback(cy_cb_usb_dev_request_received_t requestReceivedHandle,
cy_cb_usb_dev_request_cmplt_t requestCompletedHandle,
cy_stc_usb_dev_audio_context_t *context)
{
Cy_USB_Dev_RegisterClassRequestRcvdCallback(requestReceivedHandle, Cy_USB_Dev_Audio_GetClass(context));
Cy_USB_Dev_RegisterClassRequestCmpltCallback(requestCompletedHandle, Cy_USB_Dev_Audio_GetClass(context));
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_Audio_GetClass
****************************************************************************//**
*
* Returns pointer to the class structure for Audio class.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_context_t allocated
* by the user. The structure is used during the Audio Class operation for
* internal configuration and data retention. The user must not modify anything
* in this structure.
*
* \return
* Status pointer to the class \ref cy_stc_usb_dev_class_t.
*
*******************************************************************************/
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_Audio_GetClass(cy_stc_usb_dev_audio_context_t *context)
{
return &(context->classObj);
}
/** \} group_usb_dev_audio_functions */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_AUDIO_H) */
/* [] END OF FILE */

View File

@ -0,0 +1,273 @@
/***************************************************************************//**
* \file cy_usb_dev_audio_descr.h
* \version 2.10
*
* Provides Audio class-specific descriptor defines.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#if !defined(CY_USB_DEV_AUDIO_DESCR_H)
#define CY_USB_DEV_AUDIO_DESCR_H
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* USB AUDIO
*******************************************************************************/
/** \cond INTERNAL */
/**
* Audio Interface Class, Subclass and Protocol Codes
*/
#define CY_USB_DEV_AUDIO_CLASS (0x01U)
#define CY_USB_DEV_AUDIO_SUBCLASS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_SUBCLASS_AUDIO_CONTROL (0x01U)
#define CY_USB_DEV_AUDIO_SUBCLASS_AUDIO_STREAMING (0x02U)
#define CY_USB_DEV_AUDIO_SUBCLASS_MIDI_STREAMING (0x03U)
#define CY_USB_DEV_AUDIO_PROTOCOL_UNDEFINED (0x00U)
/**
* Audio Class-Specific Descriptor Types
*/
#define CY_USB_DEV_AUDIO_CS_UNDEFINED (0x20U)
#define CY_USB_DEV_AUDIO_CS_DEVICE (0x21U)
#define CY_USB_DEV_AUDIO_CS_CONFIGURATION (0x22U)
#define CY_USB_DEV_AUDIO_CS_STRING (0x23U)
#define CY_USB_DEV_AUDIO_CS_INTERFACE (0x24U)
#define CY_USB_DEV_AUDIO_CS_ENDPOINT (0x25U)
/*******************************************************************************
* USB AUDIO version 1.0
*******************************************************************************/
/**
* Audio Class-Specific AC Interface Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO_AC_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_HEADER (0x01U)
#define CY_USB_DEV_AUDIO_INPUT_TERMINAL (0x02U)
#define CY_USB_DEV_AUDIO_OUTPUT_TERMINAL (0x03U)
#define CY_USB_DEV_AUDIO_MIXER_UNIT (0x04U)
#define CY_USB_DEV_AUDIO_SELECTOR_UNIT (0x05U)
#define CY_USB_DEV_AUDIO_FEATURE_UNIT (0x06U)
#define CY_USB_DEV_AUDIO_PROCESSING_UNIT (0x07U)
#define CY_USB_DEV_AUDIO_EXTENSION_UNIT (0x08U)
/**
* Audio Class-Specific AS Interface Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO_AS_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_AS_GENERAL (0x01U)
#define CY_USB_DEV_AUDIO_FORMAT_TYPE (0x02U)
#define CY_USB_DEV_AUDIO_FORMAT_SPECIFIC (0x03U)
/**
* Processing Unit Process Types
*/
#define CY_USB_DEV_AUDIO_PROCESS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_UP_DOWNMIX_PROCESS (0x01U)
#define CY_USB_DEV_AUDIO_DOLBY_PROLOGIC_PROCESS (0x02U)
#define CY_USB_DEV_AUDIO_3D_STEREO_EXTENDER_PROCESS (0x03U)
#define CY_USB_DEV_AUDIO_REVERBERATION_PROCESS (0x04U)
#define CY_USB_DEV_AUDIO_CHORUS_PROCESS (0x05U)
#define CY_USB_DEV_AUDIO_DYN_RANGE_COMP_PROCESS (0x06U)
/**
* Audio Class-Specific Endpoint Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_EP_GENERAL (0x01U)
/**
* Terminal Control Selectors
*/
#define USB_AUDIO_TE_CONTROL_UNDEFINED (0x00U)
#define USB_AUDIO_COPY_PROTECT_CONTROL (0x01U)
/**
* Feature Unit Control Selectors
*/
#define CY_USB_DEV_AUDIO_FU_CONTROL_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_MUTE_CONTROL (0x01U)
#define CY_USB_DEV_AUDIO_VOLUME_CONTROL (0x02U)
#define CY_USB_DEV_AUDIO_BASS_CONTROL (0x03U)
#define CY_USB_DEV_AUDIO_MID_CONTROL (0x04U)
#define CY_USB_DEV_AUDIO_TREBLE_CONTROL (0x05U)
#define CY_USB_DEV_AUDIO_GRAPHIC_EQUALIZER_CONTROL (0x06U)
#define CY_USB_DEV_AUDIO_AUTOMATIC_GAIN_CONTROL (0x07U)
#define CY_USB_DEV_AUDIO_DELAY_CONTROL (0x08U)
#define CY_USB_DEV_AUDIO_BASS_BOOST_CONTROL (0x09U)
#define CY_USB_DEV_AUDIO_LOUDNESS_CONTROL (0x0AU)
/**
* Endpoint Control Selectors
*/
#define CY_USB_DEV_AUDIO_EP_CONTROL_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO_SAMPLING_FREQ_CONTROL (0x01U)
#define CY_USB_DEV_AUDIO_PITCH_CONTROL (0x02U)
/**
* Descriptor Sizes
*/
#define CY_USB_DEV_AUDIO_AC_HEADER_SIZE(a) (8U + (a))
#define CY_USB_DEV_AUDIO_AC_IN_TERM_LENGTH (0x0CU)
#define CY_USB_DEV_AUDIO_AC_FE_UNIT_LENGTH (0x09U)
#define CY_USB_DEV_AUDIO_AC_OUT_TERM_LENGTH (0x09U)
#define CY_USB_DEV_AUDIO_AS_GEN_IF_LENGTH (0x07U)
#define CY_USB_DEV_AUDIO_AS_FORMAT_I_LENGTH (0x0BU)
/**
* Endpoint Control Selectors (AUDIO Table A-19)
*/
#define CY_USB_DEV_AUDIO_CS_SAMPLING_FREQ_CTRL (0x01U) /**< Audio v1.0: sample frequency control selector */
#define CY_USB_DEV_AUDIO_CS_PITCH_CTRL (0x02U) /**< Audio v1.0: pitch control selector */
/**
* Feature Unit Control Selectors (AUDIO Table A-11)
*/
#define CY_USB_DEV_AUDIO_CS_MUTE_CONTROL (0x01U) /**< Audio v1.0: mute control selector */
#define CY_USB_DEV_AUDIO_CS_VOLUME_CONTROL (0x02U) /**< Audio v1.0: volume control selector */
#define CY_USB_DEV_AUDIO_CS_BASS_CONTROL (0x03U) /**< Audio v1.0: bass control selector */
#define CY_USB_DEV_AUDIO_CS_MID_CONTROL (0x04U) /**< Audio v1.0: mid control selector */
#define CY_USB_DEV_AUDIO_CS_TREBLE_CONTROL (0x05U) /**< Audio v1.0: treble control selector */
#define CY_USB_DEV_AUDIO_CS_GRAPHIC_EQUALIZER_CONTROL (0x06U) /**< Audio v1.0: graphic equalizer control selector */
#define CY_USB_DEV_AUDIO_CS_AUTOMATIC_GAIN_CONTROL (0x07U) /**< Audio v1.0: automatic gain control selector */
#define CY_USB_DEV_AUDIO_CS_DELAY_CONTROL (0x08U) /**< Audio v1.0: delay control selector */
#define CY_USB_DEV_AUDIO_CS_BASS_BOOST_CONTROL (0x09U) /**< Audio v1.0: bass control selector */
#define CY_USB_DEV_AUDIO_CS_LOUDNESS_CONTROL (0x0AU) /**< Audio v1.0: loudness control selector */
/*******************************************************************************
* USB AUDIO version 1.0
*******************************************************************************/
/**
* Audio Interface Protocol Codes
*/
#define CY_USB_DEV_AUDIO2_INTERFACE_PROTOCOL_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_IP_VERSION_02_00 (0x20U)
/**
* A.7 Audio Function Category Codes
*/
#define CY_USB_DEV_AUDIO2_FUNCTION_SUBCLASS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_FUNCTION_DESKTOP_SPEAKER (0x01U)
#define CY_USB_DEV_AUDIO2_FUNCTION_HOME_THEATER (0x02U)
#define CY_USB_DEV_AUDIO2_FUNCTION_MICROPHONE (0x03U)
#define CY_USB_DEV_AUDIO2_FUNCTION_HEADSET (0x04U)
#define CY_USB_DEV_AUDIO2_FUNCTION_TELEPHONE (0x05U)
#define CY_USB_DEV_AUDIO2_FUNCTION_CONVERTER (0x06U)
#define CY_USB_DEV_AUDIO2_FUNCTION_SOUND_RECORDER (0x07U)
#define CY_USB_DEV_AUDIO2_FUNCTION_IO_BOX (0x08U)
#define CY_USB_DEV_AUDIO2_FUNCTION_MUSICAL_INSTRUMENT (0x09U)
#define CY_USB_DEV_AUDIO2_FUNCTION_PRO_AUDIO (0x0AU)
#define CY_USB_DEV_AUDIO2_FUNCTION_AUDIO_VIDEO (0x0BU)
#define CY_USB_DEV_AUDIO2_FUNCTION_CONTROL_PANEL (0x0CU)
#define CY_USB_DEV_AUDIO2_FUNCTION_OTHER (0xFFU)
/**
* A.9 Audio Class-Specific AC Interface Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO2_AC_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_HEADER (0x01U)
#define CY_USB_DEV_AUDIO2_INPUT_TERMINAL (0x02U)
#define CY_USB_DEV_AUDIO2_OUTPUT_TERMINAL (0x03U)
#define CY_USB_DEV_AUDIO2_MIXER_UNIT (0x04U)
#define CY_USB_DEV_AUDIO2_SELECTOR_UNIT (0x05U)
#define CY_USB_DEV_AUDIO2_FEATURE_UNIT (0x06U)
#define CY_USB_DEV_AUDIO2_EFFECT_UNIT (0x07U)
#define CY_USB_DEV_AUDIO2_PROCESSING_UNIT_V2 (0x08U)
#define CY_USB_DEV_AUDIO2_EXTENSION_UNIT_V2 (0x09U)
#define CY_USB_DEV_AUDIO2_CLOCK_SOURCE (0x0AU)
#define CY_USB_DEV_AUDIO2_CLOCK_SELECTOR (0x0BU)
#define CY_USB_DEV_AUDIO2_CLOCK_MULTIPLIER (0x0CU)
#define CY_USB_DEV_AUDIO2_SAMPLE_RATE_CONVERTER (0x0DU)
/**
* Audio Class-Specific AS Interface Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO2_AS_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_AS_GENERAL (0x01U)
#define CY_USB_DEV_AUDIO2_FORMAT_TYPE (0x02U)
#define CY_USB_DEV_AUDIO2_ENCODER (0x03U)
#define CY_USB_DEV_AUDIO2_DECODER (0x04U)
/**
* Audio Class-Specific Endpoint Descriptor Subtypes
*/
#define CY_USB_DEV_AUDIO2_DESCRIPTOR_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_EP_GENERAL (0x01U)
/**
* Clock Source Control Selectors
*/
#define CY_USB_DEV_AUDIO2_CS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_CS_CONTROL_SAM_FREQ (0x01U)
#define CY_USB_DEV_AUDIO2_CS_CONTROL_CLOCK_VALID (0x02U)
/**
* Clock Selector Control Selectors
*/
#define CY_USB_DEV_AUDIO2_CX_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_CX_CLOCK_SELECTOR (0x01U)
/**
* Clock Multiplier Control Selectors
*/
#define CY_USB_DEV_AUDIO2_CM_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_CM_NUMERATOR (0x01U)
#define CY_USB_DEV_AUDIO2_CM_DENOMINTATOR (0x02U)
/**
* Terminal Control Selectors
*/
#define CY_USB_DEV_AUDIO2_TE_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_TE_COPY_PROTECT (0x01U)
#define CY_USB_DEV_AUDIO2_TE_CONNECTOR (0x02U)
#define CY_USB_DEV_AUDIO2_TE_OVERLOAD (0x03U)
#define CY_USB_DEV_AUDIO2_TE_CLUSTER (0x04U)
#define CY_USB_DEV_AUDIO2_TE_UNDERFLOW (0x05U)
#define CY_USB_DEV_AUDIO2_TE_OVERFLOW (0x06U)
#define CY_USB_DEV_AUDIO2_TE_LATENCY (0x07U)
/**
* AudioStreaming Interface Control Selectors
*/
#define CY_USB_DEV_AUDIO2_AS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_AS_ACT_ALT_SETTING (0x01U)
#define CY_USB_DEV_AUDIO2_AS_VAL_ALT_SETTINGS (0x02U)
#define CY_USB_DEV_AUDIO2_AS_AUDIO_DATA_FORMAT (0x03U)
/**
* Endpoint Control Selectors
*/
#define CY_USB_DEV_AUDIO2_EP_CS_UNDEFINED (0x00U)
#define CY_USB_DEV_AUDIO2_EP_CS_PITCH (0x01U)
#define CY_USB_DEV_AUDIO2_EP_CS_DATA_OVERRUN (0x02U)
#define CY_USB_DEV_AUDIO2_EP_CS_DATA_UNDERRUN (0x03U)
/** \endcond */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_AUDIO_DESCR_H) */
/* [] END OF FILE */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,664 @@
/***************************************************************************//**
* \file cy_usb_dev_cdc.h
* \version 2.10
*
* Provides CDC class-specific API declarations.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc
* This section provides API description for the CDC class.
*
* \{
* \defgroup group_usb_dev_cdc_macros Macros
* \defgroup group_usb_dev_cdc_functions Functions
* \defgroup group_usb_dev_cdc_data_structures Data Structures
* \defgroup group_usb_dev_cdc_enums Enumerated Types
* \}
*/
#if !defined(CY_USB_DEV_CDC_H)
#define CY_USB_DEV_CDC_H
#include "cy_usb_dev.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* API Constants
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_macros
* \{
*/
/** Number of supported COM ports */
#define CY_USB_DEV_CDC_COMPORT_NUMBER (2U)
/* CDC Class requests */
#define CY_USB_DEV_CDC_RQST_SET_LINE_CODING (0x20U) /**< SetLineCoding CDC class request */
#define CY_USB_DEV_CDC_RQST_GET_LINE_CODING (0x21U) /**< GetLineCoding CDC class request */
#define CY_USB_DEV_CDC_RQST_SET_CONTROL_LINE_STATE (0x22U) /**< SetControlLineState CDC class request */
/** \} group_usb_dev_cdc_macros */
/*******************************************************************************
* Internal Constants
*******************************************************************************/
/** \cond INTERNAL */
#define CY_USB_DEV_CDC_SERIAL_STATE_SIZE (10U)
#define CY_USB_DEV_CDC_LINE_CODING_CHAR_FORMAT_POS (4U)
#define CY_USB_DEV_CDC_LINE_CODING_SIZE (7U)
#define CY_USB_DEV_CDC_LINE_CODING_PARITY_BITS_POS (5U)
#define CY_USB_DEV_CDC_LINE_CODING_DATA_BITS_POS (6U)
#define CY_USB_DEV_CDC_IS_COM_VALID(com) ((com) <= CY_USB_DEV_CDC_COMPORT_NUMBER)
/** \endcond */
/*******************************************************************************
* Enumerated Types
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_enums
* \{
*/
/** CDC Stop bit */
typedef enum
{
CY_USB_DEV_CDC_STOPBIT_1, /**< 1 stop bit */
CY_USB_DEV_CDC_STOPBITS_1_5, /**< 1.5 stop bits */
CY_USB_DEV_CDC_STOPBITS_2, /**< 2 stop bits */
} cy_en_usb_dev_cdc_stop_bit_t;
/** CDC Parity type */
typedef enum
{
CY_USB_DEV_CDC_PARITY_NONE, /**< None parity */
CY_USB_DEV_CDC_PARITY_ODD, /**< Odd parity */
CY_USB_DEV_CDC_PARITY_EVEN, /**< Even parity */
CY_USB_DEV_CDC_PARITY_MARK, /**< Mark */
CY_USB_DEV_CDC_PARITY_SPACE, /**< Space */
} cy_en_usb_dev_cdc_parity_type_t;
/** \} group_usb_dev_cdc_enums */
/*******************************************************************************
* Type Definitions
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_data_structures
* \{
*/
/** CDC class configuration structure */
typedef struct
{
/** The pointers to the buffers to store received data by COM port 0 and 1
* appropriately. The buffer is mandatory to for \ref Cy_USB_Dev_CDC_GetData
* and \ref Cy_USB_Dev_CDC_GetChar function operation. If these functions
* will not be used by the application pass NULL as a pointer. \n
* Allocate buffer using \ref CY_USB_DEV_ALLOC_ENDPOINT_BUFFER macro to make
* it USBFS driver configuration independent (See \ref group_usb_dev_ep_buf_alloc
* for more information).
*/
uint8_t *buffer[CY_USB_DEV_CDC_COMPORT_NUMBER];
/** Size of provided buffers to for the COM port 0 and 1 appropriately.
* The buffer size must be equal to the maximum packet size of CDC Data
* interface IN endpoint that belongs to the COM port.
* Pass zero size if the pointer to the buffer is NULL.
*/
uint32_t bufferSize[CY_USB_DEV_CDC_COMPORT_NUMBER];
} cy_stc_usb_dev_cdc_config_t;
/** \cond INTERNAL: CDC COM port properties structure */
typedef struct
{
/** Defines whether port is valid for usage */
volatile bool valid;
/** Buffer for byte read organization */
uint8_t *buffer;
/** Size of buffer */
uint32_t bufferSize;
/** Number of occupied bytes in buffer */
uint32_t writeBufIdx;
/** Number of occupied bytes in buffer */
uint32_t readBufIdx;
/** Contains the interface number used to define port number in requests. */
volatile uint8_t interfaceNum;
/**
* Contains the data IN endpoint size. It is initialized after a
* SET_CONFIGURATION request based on a user descriptor. It is used
* in CDC functions to send data to the Host.
*/
volatile uint16_t dataInEpSize;
/**
* Contains the data OUT endpoint size. It is initialized after a
* SET_CONFIGURATION request based on user descriptor. It is used in
* CDC functions to receive data from the Host.
*/
volatile uint16_t dataOutEpSize;
/**
* Contains the IN interrupt endpoint size used for sending serial
* state notification to the Host. It is initialized after a
* SET_CONFIGURATION request based on a user descriptor. It is used
* in the CDC function SendSerialState().
*/
volatile uint16_t commEpSize;
/**
* Contains the current line coding structure. The Host sets it using
* a SET_LINE_CODING request and returns it to the user code using
* the GetDTERate(), GetCharFormat(), GetParityType(), and
* GetDataBits() functions.
*/
volatile uint8_t linesCoding[CY_USB_DEV_CDC_LINE_CODING_SIZE];
/**
* Used as a flag for the IsLineChanged() function, to inform it that
* the host has been sent a request to change line coding or control
* bitmap.
*/
volatile uint8_t linesChanged;
/**
* Contains the current control-signal bitmap. The Host sets it using
* a SET_CONTROL_LINE request and returns it to the user code using
* the GetLineControl() function.
*/
volatile uint8_t linesControlBitmap;
/**
* Contains the 16-bit serial state value that was sent using the
* SendSerialState() function.
*/
volatile uint16_t serialStateBitmap;
/**
* Contains the 16-bit serial state value that was sent using the
* SendSerialState() function.
*/
volatile uint8_t serialStateNotification[CY_USB_DEV_CDC_SERIAL_STATE_SIZE];
/**
* Contains the data IN endpoint number. It is initialized after a
* SET_CONFIGURATION request based on a user descriptor. It is used
* in CDC functions to send data to the host.
*/
volatile uint8_t dataInEp;
/**
* Contains the data OUT endpoint number. It is initialized after a
* SET_CONFIGURATION request based on user descriptor. It is used in
* CDC functions to receive data from the Host.
*/
volatile uint8_t dataOutEp;
/**
* Contains the IN interrupt endpoint number used for sending serial
* state notification to the host. It is initialized after a
* SET_CONFIGURATION request based on a user descriptor. It is used
* in the CDC function SendSerialState().
*/
volatile uint8_t commEp;
} cy_stc_usb_dev_cdc_comport_t;
/** \endcond */
/** CDC class context structure.
* All fields for the CDC context structure are internal. Firmware never reads or
* writes these values. Firmware allocates the structure and provides the
* address of the structure to the middleware in CDC function calls. Firmware
* must ensure that the defined instance of this structure remains in scope while
* the middleware is in use.
*/
typedef struct
{
/** \cond INTERNAL*/
/** COM port description array */
cy_stc_usb_dev_cdc_comport_t port[CY_USB_DEV_CDC_COMPORT_NUMBER];
/** CDC class functions pointers */
cy_stc_usb_dev_class_t classObj;
/** CDC class linked list item */
cy_stc_usb_dev_class_ll_item_t classItem;
/** Device context */
cy_stc_usb_dev_context_t *devContext;
/**
* Called after setupRequest was received (before internal processing).
* Returns status of the event processing.
*/
cy_cb_usb_dev_request_received_t requestReceived;
/**
* Called after setupRequest was received (before internal processing).
* Returns status of the event processing.
*/
cy_cb_usb_dev_request_cmplt_t requestCompleted;
/** \endcond */
} cy_stc_usb_dev_cdc_context_t;
/** \} group_usb_dev_cdc_data_structures */
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_functions
* \{
*/
cy_en_usb_dev_status_t Cy_USB_Dev_CDC_Init(cy_stc_usb_dev_cdc_config_t const *config,
cy_stc_usb_dev_cdc_context_t *context,
cy_stc_usb_dev_context_t *devContext);
cy_en_usb_dev_status_t Cy_USB_Dev_CDC_PutData(uint32_t port, uint8_t const *buffer, uint32_t size,
cy_stc_usb_dev_cdc_context_t *context);
cy_en_usb_dev_status_t Cy_USB_Dev_CDC_PutString(uint32_t port, char_t const *string, int32_t timeout,
cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE cy_en_usb_dev_status_t Cy_USB_Dev_CDC_PutChar(uint32_t port, char_t ch,
cy_stc_usb_dev_cdc_context_t *context);
uint32_t Cy_USB_Dev_CDC_GetCount(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
bool Cy_USB_Dev_CDC_IsDataReady(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
bool Cy_USB_Dev_CDC_IsReady(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
uint32_t Cy_USB_Dev_CDC_GetData(uint32_t port, uint8_t *buffer, uint32_t size,
cy_stc_usb_dev_cdc_context_t *context);
uint32_t Cy_USB_Dev_CDC_GetAll(uint32_t port, uint8_t *buffer, uint32_t maxSize,
cy_stc_usb_dev_cdc_context_t *context);
char_t Cy_USB_Dev_CDC_GetChar(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_IsLineChanged(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetLineControl(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context);
uint32_t Cy_USB_Dev_CDC_GetDTERate(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE cy_en_usb_dev_cdc_stop_bit_t Cy_USB_Dev_CDC_GetCharFormat(uint32_t port,
cy_stc_usb_dev_cdc_context_t const *context);
__STATIC_INLINE cy_en_usb_dev_cdc_parity_type_t Cy_USB_Dev_CDC_GetParity(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context);
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetDataBits(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context);
cy_en_usb_dev_status_t Cy_USB_Dev_CDC_SendSerialState(uint32_t port, uint32_t serialState,
cy_stc_usb_dev_cdc_context_t *context);
bool Cy_USB_Dev_CDC_IsNotificationReady(uint32_t port, cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE void Cy_USB_Dev_CDC_RegisterUserCallbacks(cy_cb_usb_dev_request_received_t requestReceivedHandle,
cy_cb_usb_dev_request_cmplt_t requestCompletedHandle,
cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_CDC_GetClass(cy_stc_usb_dev_cdc_context_t *context);
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetSerialState(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context);
/** \} group_usb_dev_cdc_functions */
/*******************************************************************************
* API Constants
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_macros
* \{
*/
/**
* Indicates that a DTR signal is present. This signal corresponds to V.24
* signal 108/2 and RS232 signal DTR.
*/
#define CY_USB_DEV_CDC_LINE_CONTROL_DTR (0x1U)
/**
* Carrier control for half-duplex modems. This signal corresponds to V.24
* signal 105 and RS232 signal RTS.
*/
#define CY_USB_DEV_CDC_LINE_CONTROL_RTS (0x2U)
#define CY_USB_DEV_CDC_LINE_NOT_CHANGED (0U) /**< No line coding/line control changes */
#define CY_USB_DEV_CDC_LINE_CODING_CHANGED (1U) /**< Line coding changed */
#define CY_USB_DEV_CDC_LINE_CONTROL_CHANGED (2U) /**< Line control changed */
/** \} group_usb_dev_cdc_macros */
/*******************************************************************************
* In-line Function Implementation
*******************************************************************************/
/**
* \addtogroup group_usb_dev_cdc_functions
* \{
*/
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_RegisterUserCallbacks
****************************************************************************//**
*
* Registering user callback to handle CDC class requests that are not supported
* by provided CDC request handler.
*
* \param requestReceivedHandle
* The pointer to a callback function.
* This function is called when setup packet was received from USB Host but was
* not recognized, therefore might require the user class processing.
* To remove callback function pass NULL as function pointer.
*
* \param requestCompletedHandle
* The pointer to a callback function.
* This function is called when USB Device received data from the USB Host
* as part of current request processing. The requestReceivedHandle function
* must enable notification to trigger this event. This makes sense only when CDC
* request processing requires a data stage.
* To remove callback function pass NULL as function pointer.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_context_t allocated
* by the user. The structure is used during the Audio Class operation for
* internal configuration and data retention. The user must not modify anything
* in this structure.
*
*******************************************************************************/
__STATIC_INLINE void Cy_USB_Dev_CDC_RegisterUserCallbacks(cy_cb_usb_dev_request_received_t requestReceivedHandle,
cy_cb_usb_dev_request_cmplt_t requestCompletedHandle,
cy_stc_usb_dev_cdc_context_t *context)
{
context->requestReceived = requestReceivedHandle;
context->requestCompleted = requestCompletedHandle;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetClass
****************************************************************************//**
*
* Returns pointer to the CDC class structure.
* This function is useful to override class event handlers using
* \ref group_usb_dev_functions_class_support.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* The pointer to the CDC class structure.
*
*******************************************************************************/
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_CDC_GetClass(cy_stc_usb_dev_cdc_context_t *context)
{
return &context->classObj;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetSerialState
****************************************************************************//**
*
* Returns the current serial state value for the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* 16-bit serial state value. Refer to revision 1.2 of the CDC PSTN Subclass
* specification for bit field definitions of the 16-bit serial state value.
* Zero in case COM port is invalid.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetSerialState(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
uint32_t retState = (context->port[port].valid) ?
context->port[port].serialStateBitmap : 0U;
return retState;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_IsLineChanged
****************************************************************************//**
*
* Returns the clear-on-read status of the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* * \ref CY_USB_DEV_CDC_LINE_CODING_CHANGED when SET_LINE_CODING request is
* received.
* * \ref CY_USB_DEV_CDC_LINE_CONTROL_CHANGED when CDC_SET_CONTROL_LINE_STATE
* request is received.
* * \ref CY_USB_DEV_CDC_LINE_NOT_CHANGED when there were no request since last
* call.
*
* \note
* This function is not interrupt-protected and to prevent a race condition,
* it should be protected from the USBFS interruption in the place where it
* is called.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_IsLineChanged(uint32_t port, cy_stc_usb_dev_cdc_context_t *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
uint32_t retState = context->port[port].linesChanged;
context->port[port].linesChanged = CY_USB_DEV_CDC_LINE_NOT_CHANGED;
return retState;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetCharFormat
****************************************************************************//**
*
* Returns the number of stop bits for the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Number of stop bits \ref cy_en_usb_dev_cdc_stop_bit_t.
*
*******************************************************************************/
__STATIC_INLINE cy_en_usb_dev_cdc_stop_bit_t Cy_USB_Dev_CDC_GetCharFormat(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
return (cy_en_usb_dev_cdc_stop_bit_t) context->port[port].linesCoding[CY_USB_DEV_CDC_LINE_CODING_CHAR_FORMAT_POS];
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_PutChar
****************************************************************************//**
*
* Sends a single character to the USB Host.
* Call \ref Cy_USB_Dev_CDC_IsReady function to ensure that the COM port
* (CDC Data interface) is ready for sending data to the USB Host before calling
* this function.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param ch
* Character to be sent.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status code of the function execution \ref cy_en_usb_dev_status_t.
*
*******************************************************************************/
__STATIC_INLINE cy_en_usb_dev_status_t Cy_USB_Dev_CDC_PutChar(uint32_t port, char_t ch,
cy_stc_usb_dev_cdc_context_t *context)
{
/* Put data into the aligned buffer to work with 8-bit and 16-bit access type */
uint16_t chBuffer = (uint16_t) ch;
return Cy_USB_Dev_CDC_PutData(port, (uint8_t*) &chBuffer, 1U, context);
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetParity
****************************************************************************//**
*
* Returns the parity type for the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Parity type \ref cy_en_usb_dev_cdc_parity_type_t.
*
*******************************************************************************/
__STATIC_INLINE cy_en_usb_dev_cdc_parity_type_t Cy_USB_Dev_CDC_GetParity(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
return (cy_en_usb_dev_cdc_parity_type_t) context->port[port].linesCoding[CY_USB_DEV_CDC_LINE_CODING_PARITY_BITS_POS];
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetDataBits
****************************************************************************//**
*
* Returns the number of data bits for the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data keeping. The user must not modify
* anything in this structure.
*
* \return
* Number of data bits, which can be 5, 6, 7, 8, or 16.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetDataBits(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
return (uint32_t) context->port[port].linesCoding[CY_USB_DEV_CDC_LINE_CODING_DATA_BITS_POS];
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_CDC_GetLineControl
****************************************************************************//**
*
* Returns the line control bitmap for the COM port.
*
* \param port
* COM port number. Valid ports are 0 and 1.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_cdc_context_t
* allocated by the user. The structure is used during the CDC Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Line control bitmap \ref CY_USB_DEV_CDC_LINE_CONTROL_DTR and
* \ref CY_USB_DEV_CDC_LINE_CONTROL_RTS.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_USB_Dev_CDC_GetLineControl(uint32_t port, cy_stc_usb_dev_cdc_context_t const *context)
{
CY_ASSERT_L1(CY_USB_DEV_CDC_IS_COM_VALID(port));
return (uint32_t) context->port[port].linesControlBitmap;
}
/** \} group_usb_dev_cdc_functions */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_CDC_H) */
/* [] END OF FILE */

View File

@ -0,0 +1,45 @@
/***************************************************************************//**
* \file cy_usb_dev_cdc_descr.h
* \version 2.10
*
* Provides CDC class-specific descriptor defines.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#if !defined(CY_USB_DEV_CDC_DESCR_H)
#define CY_USB_DEV_CDC_DESCR_H
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* API Constants
*******************************************************************************/
/** \cond INTERNAL */
/* CDC class */
#define CY_USB_DEV_CDC_CLASS (0x02U)
#define CY_USB_DEV_CDC_CLASS_DATA (0x0AU)
/** \endcond */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_CDC_DESCR_H) */
/* [] END OF FILE */

View File

@ -0,0 +1,333 @@
/***************************************************************************//**
* \file cy_usb_dev_descr.h
* \version 2.10
*
* Provides device definition structures and descriptors structures.
* The descriptor structures can be used to access particular descriptors.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#if !defined(CY_USB_DEV_DESCR_H)
#define CY_USB_DEV_DESCR_H
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "cy_usb_dev_audio_descr.h"
#include "cy_usb_dev_cdc_descr.h"
#include "cy_usb_dev_hid_descr.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* Type Definitions
*******************************************************************************/
/**
* \addtogroup group_usb_dev_structures_device
* \{
*/
/** USBFS Device endpointDescriptor structure */
typedef struct
{
/** Pointer to the endpointDescriptor Descriptor in the Configuration Descriptor */
const uint8_t *endpointDescriptor;
} cy_stc_usb_dev_endpoint_t;
/** USBFS Device HID structure */
typedef struct
{
/** Pointer to the HID Class Descriptor in the Configuration Descriptor */
const uint8_t *hidDescriptor;
/** Pointer to uint8_t array that stores HID Report Descriptor */
const uint8_t *reportDescriptor;
/** HID Report Descriptor size */
uint16_t reportDescriptorSize;
/** Start position of input report IDs in the array */
uint8_t inputReportPos;
/** Number of input report IDs */
uint8_t numInputReports;
/** Array of indexes for input report IDs */
const uint8_t *inputReportIdx;
/** Number of elements in the array of indexes */
uint8_t inputReportIdxSize;
} cy_stc_usb_dev_hid_t;
/** USBFS Device Alternate Interface structure */
typedef struct
{
/** Pointer to the Interface Descriptor in the Configuration Descriptor */
const uint8_t *interfaceDescriptor;
/** Pointer to array of pointers to structure that stores Endpoints information */
const cy_stc_usb_dev_endpoint_t **endpoints;
/** Number of endpoints that belong to this interface alternates */
uint8_t numEndpoints;
/** Pointer to the HID information structure */
const cy_stc_usb_dev_hid_t *hid;
} cy_stc_usb_dev_alternate_t;
/** USBFS Device Interface structure */
typedef struct
{
/** Number of supported alternate settings */
uint8_t numAlternates;
/** Pointer to array of pointers to structure that stores Interface Alternates information */
const cy_stc_usb_dev_alternate_t **alternates;
/** Mask that represents endpoints that belong to Interface Alternates */
uint16_t endpointsMask;
} cy_stc_usb_dev_interface_t;
/** USBFS Device Configuration structure */
typedef struct
{
/** Number of supported interfaces */
uint8_t numInterfaces;
/** Pointer to uint8_t array that stores Configuration Descriptor */
const uint8_t *configDescriptor;
/** Pointer to array of pointers to structure that store Interface information */
const cy_stc_usb_dev_interface_t **interfaces;
} cy_stc_usb_dev_configuration_t;
/** USBFS Device MS OS String Descriptors structure */
typedef struct
{
/** Pointer to MS OS String descriptor */
const uint8_t *msOsDescriptor;
/** Vendor code to get Extended Compat ID and Properties OS Descriptors */
uint8_t msVendorCode;
/** Pointer to Extended Compat ID OS Descriptor */
const uint8_t *extCompatIdDescriptor;
/** Pointer to Extended Properties OS Descriptor */
const uint8_t *extPropertiesDescriptor;
} cy_stc_usb_dev_ms_os_string_t;
/** USBFS Device String Descriptors structure */
typedef struct
{
/** Number of String Descriptors */
uint8_t numStrings;
/** Defines whether the MS OS String is enabled */
bool enableWindowsOsDescriptor;
/** Defines MS OS Strings structures */
const cy_stc_usb_dev_ms_os_string_t *osStringDescriptors;
/** Pointer to array of pointers to String Descriptors */
const uint8_t **stringDescriptors;
} cy_stc_usb_dev_string_t;
/** USBFS Device structure */
typedef struct
{
/** Pointer to uint8_t array that stores Device Descriptor */
const uint8_t *deviceDescriptor;
/** Pointer to uint8_t array that stores BOS Descriptor */
const uint8_t *bosDescriptor;
/** Pointer to structure that stores Strings Descriptors information */
const cy_stc_usb_dev_string_t *strings;
/** Number of supported configurations */
uint8_t numConfigurations;
/** Pointer to array of pointers to structure that stores Configuration information */
const cy_stc_usb_dev_configuration_t **configurations;
} cy_stc_usb_dev_device_t;
/** \} group_usb_dev_structures_device */
/**
* \addtogroup group_usb_dev_structures_device_descr
* \{
*/
/** Device descriptor */
typedef struct
{
uint8_t bLength; /**< Size of the Descriptor in Bytes */
uint8_t bDescriptorType; /**< Constant Device Descriptor */
uint16_t bcdUSB; /**< USB Specification Number to which the device complies */
uint8_t bDeviceClass; /**< Class Code (Assigned by USB Org):
* If equal to Zero, each interface specifies its own class code
* If equal to 0xFF, the class code is vendor specified.
* Otherwise, field is valid Class Code.
*/
uint8_t bDeviceSubClass; /**< Subclass Code (Assigned by USB Org) */
uint8_t bDeviceProtocol; /**< Protocol Code (Assigned by USB Org) */
uint8_t bMaxPacketSize; /**< Maximum Packet Size for Zero Endpoint. Valid Sizes are 8, 16, 32, 64 */
uint16_t idVendor; /**< Vendor ID (Assigned by USB Org) */
uint16_t idProduct; /**< Product ID (Assigned by Manufacturer) */
uint16_t bcdDevice; /**< Release Number */
uint8_t iManufacturer; /**< Index of Manufacturer String Descriptor */
uint8_t iProduct; /**< Index of Product String Descriptor */
uint8_t iSerialNumber; /**< Index of Serial Number String Descriptor */
uint8_t bNumConfigurations;/**< Number of Possible Configurations */
} cy_stc_usbdev_device_descr_t;
/** Configuration descriptor */
typedef struct
{
uint8_t bLength; /**< Size of Descriptor in Bytes */
uint8_t bDescriptorType; /**< Configuration Descriptor */
uint16_t wTotalLength; /**< Total length in bytes of data returned */
uint8_t bNumInterfaces; /**< Number of Interfaces */
uint8_t bConfigurationValue; /**< Value to use as an argument to select this configuration */
uint8_t iConfiguration; /**< Index of String Descriptor describing this configuration */
uint8_t bmAttributes; /**< Bitmap:
* D7 Reserved, set to 1. (USB 1.0 Bus Powered)
* D6 Self Powered
* D5 Remote Wakeup
* D4..0 Reserved, set to 0.
*/
uint8_t bMaxPower; /**< Maximum Power Consumption in 2 mA units */
} cy_stc_usbdev_config_descr_t;
/** Interface descriptor */
typedef struct
{
uint8_t bLength; /**< Size of Descriptor in Bytes (9 Bytes) */
uint8_t bDescriptorType; /**< Interface Descriptor */
uint8_t bInterfaceNumber; /**< Number of Interface */
uint8_t bAlternateSetting; /**< Value used to select alternative setting */
uint8_t bNumEndpoints; /**< Number of Endpoints used for this interface */
uint8_t bInterfaceClass; /**< Class Code (Assigned by USB Org) */
uint8_t bInterfaceSubClass; /**< Subclass Code (Assigned by USB Org) */
uint8_t bInterfaceProtocol; /**< Protocol Code (Assigned by USB Org) */
uint8_t iInterface; /**< Index of String Descriptor describing this interface */
} cy_stc_usbdev_interface_descr_t;
/** Endpoint descriptor */
typedef struct
{
uint8_t bLength; /**< Size of Descriptor in Bytes */
uint8_t bDescriptorType; /**< Endpoint Descriptor */
uint8_t bEndpointAddress; /**< Endpoint Address:
* Bits 0..3 Endpoint Number.
* Bits 4..6 Reserved. Set to Zero
* Bit 7 Direction 0 = Out, 1 = In (Ignored for Control Endpoints)
*/
uint8_t bmAttributes; /**< Bitmap:
* Bits 0..1 Transfer Type: 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt
* Bits 2..7 are reserved. If Isochronous endpoint,
* Bits 3..2: Synchronization
* Type (Iso Mode): 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous
* Bits 5..4 = Usage Type (Iso Mode): 00 = Data Endpoint, 01 = Feedback Endpoint,
* 10 = Explicit Feedback Data Endpoint, 11 = Reserved
*/
uint16_t wMaxPacketSize; /**< Maximum Packet Size this endpoint is capable of sending or receiving */
uint8_t bInterval; /**< Interval for polling endpoint data transfers. Value in frame counts.
* Ignored for Bulk & Control Endpoints.
* Isochronous must equal 1 and field may range from 1 to 255 for interrupt endpoints.
*/
} cy_stc_usbdev_endpoint_descr_t;
/** \} group_usb_dev_structures_device_descr */
/*******************************************************************************
* Macro for generation code usage
*******************************************************************************/
/**
* \addtogroup group_usb_dev_macros_device_descr
* \{
*/
#define CY_USB_DEV_USB_VERSION_2_0 (0x0200U) /**< USB Specification Release Number 2.0 */
#define CY_USB_DEV_USB_VERSION_2_1 (0x0201U) /**< USB Specification Release Number 2.1 */
/* USB v2.0 spec: Table 9-5. Descriptor Types */
#define CY_USB_DEV_DEVICE_DESCR (1U) /**< Device Descriptor type */
#define CY_USB_DEV_CONFIG_DESCR (2U) /**< Device Configuration Descriptor type */
#define CY_USB_DEV_STRING_DESCR (3U) /**< Device String Descriptor type */
#define CY_USB_DEV_INTERFACE_DESCR (4U) /**< Device Interface Descriptor type */
#define CY_USB_DEV_ENDPOINT_DESCR (5U) /**< Device Endpoint Descriptor type */
#define CY_USB_DEV_DEVICE_QUALIFIER_DESCR (6U) /**< Device Qualifier Descriptor type */
#define CY_USB_DEV_OTHER_SPEED_CFG_DESCR (7U) /**< Device Other Speed Descriptor type */
#define CY_USB_DEV_INTERFACE_POWER_DESCR (8U) /**< Device Interface Power Descriptor type */
#define CY_USB_DEV_BOS_DESCR (15U) /**< Device BOS Descriptor type */
/* MS OS String Descriptors */
#define CY_USB_DEV_MS_OS_STRING_EXT_COMPAT_ID (4U) /**< Extended Compat ID OS Descriptor */
#define CY_USB_DEV_MS_OS_STRING_EXT_PROPERTEIS (5U) /**< Extended Properties OS Descriptor */
/* Standard descriptor lengths */
#define CY_USB_DEV_DEVICE_DESCR_LENGTH (18U) /**< Device Descriptor length */
#define CY_USB_DEV_CONFIG_DESCR_LENGTH (9U) /**< Device Configuration Descriptor length */
#define CY_USB_DEV_INTERFACE_DESCR_LENGTH (9U) /**< Device Interface Descriptor length */
#define CY_USB_DEV_ENDPOINT_DESCR_LENGTH (7U) /**< Device Endpoint Descriptor length */
#define CY_USB_DEV_BOS_DESCR_LENGTH (5U) /**< Device BOS Descriptor length */
/* String Language ID length */
#define CY_USB_DEV_STRING_DESCR_LANG_ID_LENGTH (4U) /**< Device String LANG ID Descriptor length */
/* bmAttributes in endpoint descriptor */
#define CY_USB_DEV_EP_CONTROL (0x00U) /**< Control Transfer type */
#define CY_USB_DEV_EP_ISOCHRONOUS (0x01U) /**< Isochronous Transfer type */
#define CY_USB_DEV_EP_BULK (0x02U) /**< Bulk Transfer type */
#define CY_USB_DEV_EP_INTERRUPT (0x03U) /**< Interrupt Transfer type */
#define CY_USB_DEV_EP_TRANS_TYPE_MASK (0x03U) /**< Transfer type mask */
/* For isochronous endpoints only */
#define CY_USB_DEV_EP_NO_SYNCHRONIZATION (0x00U) /**< No Synchronization of Isochronous endpoint */
#define CY_USB_DEV_EP_ASYNCHRONOUS (0x04U) /**< Asynchronous Isochronous endpoint */
#define CY_USB_DEV_EP_ADAPTIVE (0x08U) /**< Adaptive Isochronous endpoint */
#define CY_USB_DEV_EP_SYNCHRONOUS (0x0CU) /**< Synchronous Isochronous endpoint */
#define CY_USB_DEV_EP_DATA (0x00U) /**< Data Isochronous endpoint */
#define CY_USB_DEV_EP_FEEDBACK (0x10U) /**< Feedback Isochronous endpoint */
#define CY_USB_DEV_EP_IMPLICIT_FEEDBACK (0x20U) /**< Implicit feedback Isochronous endpoint */
/** \} group_usb_dev_macros_device_descr */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_DESCR_H) */
/* [] END OF FILE */

View File

@ -0,0 +1,953 @@
/***************************************************************************//**
* \file cy_usb_dev_hid.c
* \version 2.10
*
* Provides HID class-specific API implementation.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cy_usb_dev_hid.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
/*******************************************************************************
* Internal Macro
*******************************************************************************/
/* Get Idle request response length */
#define HID_IDLE_RATE_LENGTH (1U)
/* Get Protocol request response length */
#define HID_PROTOCOL_LENGTH (1U)
/* Set protocol mask */
#define HID_PROTOCOL_MASK (0x01U)
/* Set default idle rate */
#define HID_IDLE_RATE_INDEFINITE (0U)
/*******************************************************************************
* Internal Functions Prototypes
*******************************************************************************/
static void HandleBusReset(void *classContext, cy_stc_usb_dev_context_t *devContext);
static cy_en_usb_dev_status_t HandleRequest(cy_stc_usb_dev_control_transfer_t *transfer,
void *classContext,
cy_stc_usb_dev_context_t *devContext);
static cy_en_usb_dev_status_t HandleRequestComplete(cy_stc_usb_dev_control_transfer_t *transfer,
void *classContext,
cy_stc_usb_dev_context_t *devContext);
static cy_en_usb_dev_status_t GetDescriptorHidReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid);
static cy_en_usb_dev_status_t GetDescriptorHidClassRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid);
static cy_en_usb_dev_status_t GetReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context);
static cy_en_usb_dev_status_t GetProtocolRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t *context);
static cy_en_usb_dev_status_t GetIdleRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t *context);
static cy_en_usb_dev_status_t SetReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context);
static cy_en_usb_dev_status_t SetReportRequestComplete(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context);
static cy_en_usb_dev_status_t SetProtocolRequest(cy_stc_usb_dev_control_transfer_t const *transfer,
cy_stc_usb_dev_hid_context_t *context);
static void UpdateIdleRateTimer(uint32_t idx, cy_stc_usb_dev_hid_context_t *context);
static cy_en_usb_dev_status_t SetIdleRequest(cy_stc_usb_dev_control_transfer_t const *transfer,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t *context);
static cy_stc_usb_dev_hid_t const * GetHidStruct(uint32_t intf,
cy_stc_usb_dev_context_t *devContext);
static cy_en_usb_dev_status_t GetInputReportIdx(uint32_t reportId, uint32_t *idx,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t const *context);
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_Init
****************************************************************************//**
*
* Initializes the HID class.
* This function must be called to enable USB Device HID functionality.
*
* \param config
* The pointer to the HID configuration
* structure \ref cy_stc_usb_dev_hid_config_t.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \param devContext
* The pointer to the USB Device context structure \ref cy_stc_usb_dev_context_t.
*
* \return
* Status code of the function execution \ref cy_en_usb_dev_status_t.
*
*******************************************************************************/
cy_en_usb_dev_status_t Cy_USB_Dev_HID_Init(cy_stc_usb_dev_hid_config_t const *config,
cy_stc_usb_dev_hid_context_t *context,
cy_stc_usb_dev_context_t *devContext)
{
/* Input parameters verification */
if ((NULL == config) || (NULL == context) || (NULL == devContext))
{
return CY_USB_DEV_BAD_PARAM;
}
/* SETUP data storage */
context->idleRate = config->timers;
context->idleTimer = &config->timers[config->timersNum];
context->timersNum = config->timersNum;
/* Remove custom handlers */
context->handleGetReport = NULL;
context->handleSetReport = NULL;
/* Store device context */
context->devContext = devContext;
/* Register HID handlers */
Cy_USB_Dev_RegisterClassBusResetCallback(&HandleBusReset, Cy_USB_Dev_HID_GetClass(context));
Cy_USB_Dev_RegisterClassRequestRcvdCallback(&HandleRequest, Cy_USB_Dev_HID_GetClass(context));
Cy_USB_Dev_RegisterClassRequestCmpltCallback(&HandleRequestComplete, Cy_USB_Dev_HID_GetClass(context));
return Cy_USB_Dev_RegisterClass(&context->classItem, &context->classObj, context, devContext);
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_UpdateTimer
****************************************************************************//**
*
* Updates the HID Report idle timer and returns the status of the timer. This
* function also reloads the timer if it expires.
*
* \param interface
* Contains the interface number that contains the HID descriptor whose HID timer
* needs to be updated.
*
* \param reportId
* Report ID whose HID timer needs to be updated.
* Pass 0 if report ID is not used.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* The state of the HID timer \ref cy_en_usb_dev_hid_timer_state_t
*
*******************************************************************************/
cy_en_usb_dev_hid_timer_state_t Cy_USB_Dev_HID_UpdateTimer(uint32_t interface,
uint32_t reportId,
cy_stc_usb_dev_hid_context_t *context)
{
cy_en_usb_dev_hid_timer_state_t retState = CY_USB_DEV_HID_TIMER_INDEFINITE;
cy_stc_usb_dev_hid_t const *hidStruct = GetHidStruct(interface, context->devContext);
/* Check that HID exists for given interface */
CY_ASSERT_L1(NULL != hidStruct);
if (NULL != hidStruct)
{
uint32_t idx;
cy_en_usb_dev_status_t locStatus = GetInputReportIdx(reportId, &idx, hidStruct, context);
/* Check that Report ID exists for given interface */
CY_ASSERT_L1(CY_USB_DEV_SUCCESS == locStatus);
if (CY_USB_DEV_SUCCESS == locStatus)
{
/* Protect from race condition between SET_IDLE request and timer update */
uint32_t intrState = Cy_SysLib_EnterCriticalSection();
/* Check if duration is defined */
if (context->idleRate[idx] != HID_IDLE_RATE_INDEFINITE)
{
/* Run timer */
if (context->idleTimer[idx] > 0U)
{
context->idleTimer[idx]--;
retState = CY_USB_DEV_HID_TIMER_RUNNING;
}
else
{
context->idleTimer[idx] = context->idleRate[idx];
retState = CY_USB_DEV_HID_TIMER_EXPIRED;
}
}
Cy_SysLib_ExitCriticalSection(intrState);
}
}
return retState;
}
/*******************************************************************************
* Function Name: HandleBusReset
****************************************************************************//**
*
* Handles Bus Reset event: clears HID protocol and idle rate timers.
*
* \param classContext
* Contains the interface number that contains the HID descriptor whose HID timer
* needs to be updated.
*
* \param devContext
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
*
*******************************************************************************/
static void HandleBusReset(void *classContext, cy_stc_usb_dev_context_t *devContext)
{
/* Suppress a compiler warning about unused variables */
(void) devContext;
cy_stc_usb_dev_hid_context_t *context = (cy_stc_usb_dev_hid_context_t *) classContext;
/* Set protocol to default */
(void) memset((void *) context->protocol, (int32_t) CY_USB_DEV_HID_PROTOCOL_REPORT, (uint32_t) CY_USB_DEV_NUM_INTERFACES_MAX);
/* Set idle rate to default */
(void) memset(context->idleRate, (int32_t) HID_IDLE_RATE_INDEFINITE, (uint32_t) context->timersNum);
(void) memset(context->idleTimer, (int32_t) HID_IDLE_RATE_INDEFINITE, (uint32_t) context->timersNum);
}
/*******************************************************************************
* Function Name: HandleRequest
****************************************************************************//**
*
* Handles HID class requests (SETUP packet received event).
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param classContext
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \param devContext
* The pointer to the context structure \ref cy_stc_usb_dev_context_t allocated
* by the user. The structure is used during the USB Device operation for
* internal configuration and data retention. The user must not modify anything
* in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t HandleRequest(cy_stc_usb_dev_control_transfer_t *transfer,
void *classContext,
cy_stc_usb_dev_context_t *devContext)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
/* Get HID pointer for this interface (all HID requests using wIndex to pass interface) */
cy_stc_usb_dev_hid_t const *hidStruct = GetHidStruct((uint32_t) transfer->setup.wIndex, devContext);
if (NULL == hidStruct)
{
return CY_USB_DEV_REQUEST_NOT_HANDLED;
}
/* Process standard requests */
if (CY_USB_DEV_STANDARD_TYPE == transfer->setup.bmRequestType.type)
{
if (CY_USB_DEV_RQST_GET_DESCRIPTOR == transfer->setup.bRequest)
{
switch (CY_USB_DEV_GET_DESCR_TYPE(transfer->setup.wValue))
{
case CY_USB_DEV_HID_REPORT_DESCRIPTOR:
retStatus = GetDescriptorHidReportRequest(transfer, hidStruct);
break;
case CY_USB_DEV_HID_DESCRIPTOR:
retStatus = GetDescriptorHidClassRequest(transfer, hidStruct);
break;
default:
/* The request was not recognized */
break;
}
}
}
/* Process class-specific requests */
else if (CY_USB_DEV_CLASS_TYPE == transfer->setup.bmRequestType.type)
{
/* Get HID context */
cy_stc_usb_dev_hid_context_t *context = (cy_stc_usb_dev_hid_context_t *) classContext;
if (transfer->direction == CY_USB_DEV_DIR_DEVICE_TO_HOST)
{
switch (transfer->setup.bRequest)
{
case CY_USB_DEV_HID_RQST_GET_REPORT:
retStatus = GetReportRequest(transfer, context);
break;
case CY_USB_DEV_HID_RQST_GET_PROTOCOL:
retStatus = GetProtocolRequest(transfer, context);
break;
case CY_USB_DEV_HID_RQST_GET_IDLE:
retStatus = GetIdleRequest(transfer, hidStruct, context);
break;
default:
/* The request was not recognized */
break;
}
}
else
{
switch (transfer->setup.bRequest)
{
case CY_USB_DEV_HID_RQST_SET_REPORT:
retStatus = SetReportRequest(transfer, context);
break;
case CY_USB_DEV_HID_RQST_SET_PROTOCOL:
retStatus = SetProtocolRequest(transfer, context);
break;
case CY_USB_DEV_HID_RQST_SET_IDLE:
retStatus = SetIdleRequest(transfer, hidStruct, context);
break;
default:
/* The request was not recognized */
break;
}
}
}
else
{
/* The request was not recognized */
}
return (retStatus);
}
/*******************************************************************************
* Function Name: HandleRequestComplete
****************************************************************************//**
*
* Completes handling HID class requests that expects data from the host.
* Involved when data from the host was received.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param classContext
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \param devContext
* The pointer to the context structure \ref cy_stc_usb_dev_context_t allocated
* by the user. The structure is used during the USB Device operation for
* internal configuration and data retention. The user must not modify anything
* in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t HandleRequestComplete(cy_stc_usb_dev_control_transfer_t *transfer,
void *classContext,
cy_stc_usb_dev_context_t *devContext)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
/* Suppress a compiler warning about unused variables */
(void) devContext;
if (CY_USB_DEV_HID_RQST_SET_REPORT == transfer->setup.bRequest)
{
retStatus = SetReportRequestComplete(transfer, (cy_stc_usb_dev_hid_context_t *) classContext);
}
return retStatus;
}
/*******************************************************************************
* Function Name: GetDescriptorHidReportRequest
****************************************************************************//**
*
* Handles GET_DESCRIPOR HID Report request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param hid
* The pointer to the the structure that holds HID Class information.
*
* \return
* Returns \ref CY_USB_DEV_SUCCESS.
* The HandleRequest function checks that HID structure exist for the
* specified interface before calling GetDescriptorHidReportRequest function.
* Therefore GetDescriptorHidReportRequest successfully access to
* the HID structure.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetDescriptorHidReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid)
{
/* SETUP control transfer */
transfer->ptr = (uint8_t *) hid->reportDescriptor;
transfer->remaining = hid->reportDescriptorSize;
return CY_USB_DEV_SUCCESS;
}
/*******************************************************************************
* Function Name: GetDescriptorHidClassRequest
****************************************************************************//**
*
* Handles GET_DESCRIPOR HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param hid
* The pointer to the the structure that holds HID Class information.
*
* \return
* Returns \ref CY_USB_DEV_SUCCESS.
* The HandleRequest function checks that HID structure exist for the
* specified interface before calling GetDescriptorHidClassRequest function.
* Therefore GetDescriptorHidClassRequest successfully access to
* the HID structure.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetDescriptorHidClassRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid)
{
/* SETUP control transfer */
transfer->ptr = (uint8_t *) hid->hidDescriptor;
transfer->remaining = CY_USB_DEV_HID_DESCRIPTOR_LENGTH;
return CY_USB_DEV_SUCCESS;
}
/*******************************************************************************
* Function Name: GetReportRequest
****************************************************************************//**
*
* Handles GET_REPORT HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
if (NULL != context->handleGetReport)
{
uint32_t rptSize;
/* Get from the user report to send */
retStatus = context->handleGetReport(
(uint32_t) transfer->setup.wIndex, /* Interface */
(uint32_t) CY_HI8(transfer->setup.wValue), /* Report Type */
(uint32_t) CY_LO8(transfer->setup.wValue), /* Report ID */
&(transfer->ptr),
&rptSize);
transfer->remaining = (uint16_t) rptSize;
}
return retStatus;
}
/*******************************************************************************
* Function Name: GetProtocolRequest
****************************************************************************//**
*
* Handles GET_PROTOCOL HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetProtocolRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
uint32_t interface = transfer->setup.wIndex;
if (interface < CY_USB_DEV_NUM_INTERFACES_MAX)
{
/* SETUP control transfer */
transfer->ptr = (uint8_t *) &context->protocol[interface];
transfer->remaining = HID_PROTOCOL_LENGTH;
retStatus = CY_USB_DEV_SUCCESS;
}
return retStatus;
}
/*******************************************************************************
* Function Name: GetIdleRequest
****************************************************************************//**
*
* Handles GET_IDLE HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param hid
* The pointer to the the structure that holds HID Class information.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetIdleRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t *context)
{
cy_en_usb_dev_status_t retStatus;
uint32_t idx;
retStatus = GetInputReportIdx((uint32_t) transfer->setup.wValue, &idx, hid, context);
if (CY_USB_DEV_SUCCESS == retStatus)
{
/* SETUP control transfer */
transfer->ptr = &context->idleRate[idx];
transfer->remaining = HID_IDLE_RATE_LENGTH;
}
return retStatus;
}
/*******************************************************************************
* Function Name: SetReportRequest
****************************************************************************//**
*
* Handles SET_REPORT HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t SetReportRequest(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
if (NULL != context->handleSetReport)
{
/* SETUP control transfer */
transfer->remaining = transfer->setup.wLength;
transfer->notify = true;
retStatus = CY_USB_DEV_SUCCESS;
}
return retStatus;
}
/*******************************************************************************
* Function Name: SetReportRequestComplete
****************************************************************************//**
*
* Completes handling SET_REPORT HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t SetReportRequestComplete(cy_stc_usb_dev_control_transfer_t *transfer,
cy_stc_usb_dev_hid_context_t const *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
if (NULL != context->handleSetReport)
{
/* Provide the user with report data */
retStatus = context->handleSetReport(
(uint32_t) transfer->setup.wIndex, /* Interface */
(uint32_t) CY_HI8(transfer->setup.wValue), /* Report Type */
(uint32_t) CY_LO8(transfer->setup.wValue), /* Report ID */
transfer->ptr,
(uint32_t) transfer->size);
}
return retStatus;
}
/*******************************************************************************
* Function Name: SetProtocolRequest
****************************************************************************//**
*
* Handles SET_PROTOCOL HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t SetProtocolRequest(cy_stc_usb_dev_control_transfer_t const *transfer,
cy_stc_usb_dev_hid_context_t *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
uint32_t interface = transfer->setup.wIndex;
if (interface < CY_USB_DEV_NUM_INTERFACES_MAX)
{
context->protocol[interface] = (uint8_t) (transfer->setup.wValue & HID_PROTOCOL_MASK);
/* SETUP control transfer, no data stage */
retStatus = CY_USB_DEV_SUCCESS;
}
return retStatus;
}
/*******************************************************************************
* Function Name: UpdateIdleRateTimer
****************************************************************************//**
*
* Updates Idle Rate timer after SET_IDLE request was received.
*
* \param idx
* Idle Rate timer index.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
*******************************************************************************/
static void UpdateIdleRateTimer(uint32_t idx, cy_stc_usb_dev_hid_context_t *context)
{
/* Reset timer if Idle rate indefinite */
if (HID_IDLE_RATE_INDEFINITE == context->idleRate[idx])
{
context->idleTimer[idx] = 0U;
}
else
{
/* HID spec: Set_Idle request Latency */
if (context->idleTimer[idx] >= context->idleRate[idx])
{
/* Reload the timer: wait new period */
context->idleTimer[idx] = context->idleRate[idx];
}
else
{
if (context->idleTimer[idx] >= 1U)
{
/* If the current period has gone past the newly prescribed
* time duration, then a report will be generated immediately.
* Clear timer to return TIMER_EXPIRED on next HID_UpdateTimer call.
*/
context->idleTimer[idx] = 0U;
}
else
{
/* A new request will be executed as if it were issued
* immediately after the last report, if the new request
* is received at least 4 milliseconds before the end of
* the currently executing period. If the new request is
* received within 4 milliseconds of the end of the
* current period, then the new request will have no
* effect until after the report
*/
/* Do nothing: let HID_UpdateTimer continue to counting
* and return TIMER_EXPIRED status.
*/
}
}
}
}
/*******************************************************************************
* Function Name: SetIdleRequest
****************************************************************************//**
*
* Handles SET_IDLE HID Class request.
*
* \param transfer
* Pointer to structure that holds SETUP packet and information for
* request processing.
*
* \param hid
* The pointer to the the structure that holds HID Class information.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status of request processing: \ref CY_USB_DEV_SUCCESS or
* \ref CY_USB_DEV_REQUEST_NOT_HANDLED.
*
*******************************************************************************/
static cy_en_usb_dev_status_t SetIdleRequest(cy_stc_usb_dev_control_transfer_t const *transfer,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
uint32_t reportId = CY_LO8(transfer->setup.wValue);
uint32_t idx;
/* Get report ID index */
retStatus = GetInputReportIdx(reportId, &idx, hid, context);
if (CY_USB_DEV_SUCCESS == retStatus)
{
if (reportId > 0U)
{
/* Set IdleRate for defined report ID then update idle timers */
context->idleRate[idx] = CY_HI8(transfer->setup.wValue);
UpdateIdleRateTimer(idx, context);
}
else
{
/* Set IdleRate to all Report IDs for this HID interface */
(void) memset(&context->idleRate[idx], (int32_t) CY_HI8(transfer->setup.wValue), (uint32_t) hid->numInputReports);
/* Update idle timers */
for(;idx < hid->numInputReports; ++idx)
{
UpdateIdleRateTimer(idx, context);
}
}
}
/* SETUP control transfer, no data stage */
return retStatus;
}
/*******************************************************************************
* Function Name: GetHidStruct
****************************************************************************//**
*
* Returns the pointer to the structure that holds HID Class information
* for a certain interface.
*
* \param intf
* Interface number.
*
* \param devContext
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t allocated
* by the user.
*
* \return
* The pointer to HID interface structure \ref cy_stc_usb_dev_hid_t.
* If interface protocol is not HID the NULL pointer is returned.
*
*******************************************************************************/
static cy_stc_usb_dev_hid_t const * GetHidStruct(uint32_t intf, cy_stc_usb_dev_context_t *devContext)
{
uint32_t cfg = Cy_USB_Dev_GetConfigurationIdx(devContext);
cy_stc_usb_dev_hid_t const *hidStruct = NULL;
/* Check if interface is valid */
if (intf < devContext->devDescriptors->configurations[cfg]->numInterfaces)
{
uint32_t alt = Cy_USB_Dev_GetAlternateSettings(intf, devContext);
/* Get report descriptor */
hidStruct = devContext->devDescriptors->configurations[cfg]->interfaces[intf]->alternates[alt]->hid;
}
return hidStruct;
}
/*******************************************************************************
* Function Name: GetInputReportIdx
****************************************************************************//**
*
* Finds idle rate timer index for a certain report ID.
*
* \param reportId
* Report ID. If there is no report ID, zero must be passed.
*
* \param idx
* Idle rate timer index.
*
* \param hid
* The pointer to the the structure that holds HID Class information.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Status code of the function execution \ref cy_en_usb_dev_status_t.
*
*******************************************************************************/
static cy_en_usb_dev_status_t GetInputReportIdx(uint32_t reportId, uint32_t *idx,
cy_stc_usb_dev_hid_t const *hid,
cy_stc_usb_dev_hid_context_t const *context)
{
cy_en_usb_dev_status_t retStatus = CY_USB_DEV_REQUEST_NOT_HANDLED;
if (0U == reportId)
{
/* Return start index in idleTimer array */
*idx = hid->inputReportPos;
retStatus = CY_USB_DEV_SUCCESS;
}
else
{
/* Check that input report ID exists */
if (reportId < hid->inputReportIdxSize)
{
/* Get report ID index in timers array */
uint32_t tmpIdx = (uint32_t) hid->inputReportIdx[reportId];
/* Check that index value is valid (0 is free location) */
if ((tmpIdx > 0U) && (tmpIdx <= context->timersNum))
{
/* Return index in idleTimer array for report ID */
*idx = (tmpIdx - 1U);
retStatus = CY_USB_DEV_SUCCESS;
}
}
}
return retStatus;
}
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
/* [] END OF FILE */

View File

@ -0,0 +1,321 @@
/***************************************************************************//**
* \file cy_usb_dev_hid.h
* \version 2.10
*
* Provides HID class-specific API declarations.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid
* This section provides the API description for the HID class.
* \{
* \defgroup group_usb_dev_hid_macros Macros
* \defgroup group_usb_dev_hid_functions Functions
* \defgroup group_usb_dev_hid_data_structures Data Structures
* \defgroup group_usb_dev_hid_enums Enumerated Types
* \}
*/
#if !defined(CY_USB_DEV_HID_H)
#define CY_USB_DEV_HID_H
#include "cy_usb_dev.h"
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* Enumerated Types
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid_enums
* \{
*/
/** Timer state */
typedef enum
{
CY_USB_DEV_HID_TIMER_EXPIRED, /**< Timer expired */
CY_USB_DEV_HID_TIMER_RUNNING, /**< Timer is running */
CY_USB_DEV_HID_TIMER_INDEFINITE, /**< Report is sent when data or state changes */
} cy_en_usb_dev_hid_timer_state_t;
/** \} group_usb_dev_hid_enums */
/*******************************************************************************
* Type Definitions
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid_data_structures
* \{
*/
/** Handler for GET_REPORT request received */
typedef cy_en_usb_dev_status_t (* cy_cb_usbfs_dev_hid_get_report_t)
(uint32_t intf, uint32_t type, uint32_t id,
uint8_t **report, uint32_t *size);
/** Handler for SET_REPORT request completed. The Host sent report data to Device. */
typedef cy_en_usb_dev_status_t (* cy_cb_usbfs_dev_hid_set_report_t)
(uint32_t intf, uint32_t type, uint32_t id,
uint8_t *report, uint32_t size);
/** HID class configuration structure */
typedef struct
{
/** The pointer to the HID idle rate timers array. The array size must be 2
* times greater than number of HID idle rate timers.
*/
uint8_t *timers;
/** Number of HID idle rate timers (equal to number of report IDs, if
* report ID is not used report consumes 1 idle rate timer).
*/
uint8_t timersNum;
} cy_stc_usb_dev_hid_config_t;
/** HID class context structure.
* All fields for the HID context structure are internal. Firmware never reads or
* writes these values. Firmware allocates the structure and provides the
* address of the structure to the middleware in HID function calls. Firmware
* must ensure that the defined instance of this structure remains in scope while
* the middleware is in use.
*/
typedef struct
{
/** \cond INTERNAL */
/** Pointer to device context */
cy_stc_usb_dev_context_t *devContext;
/** Class functions pointers */
cy_stc_usb_dev_class_t classObj;
/** Class linked list item */
cy_stc_usb_dev_class_ll_item_t classItem;
/** HID boot protocol options */
volatile uint8_t protocol[CY_USB_DEV_NUM_INTERFACES_MAX];
/** HID idle rates array */
uint8_t *idleRate;
/** HID idle rate timers array */
uint8_t *idleTimer;
/** Number of HID idle rate timers (equal to number of report IDs) */
uint8_t timersNum;
/** Pointer to function that handles GET_REPORT requests */
cy_cb_usbfs_dev_hid_get_report_t handleGetReport;
/** Pointer to function that handles SET_REPORT requests */
cy_cb_usbfs_dev_hid_set_report_t handleSetReport;
/** \endcond */
} cy_stc_usb_dev_hid_context_t;
/** \} group_usb_dev_hid_data_structures */
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid_functions
* \{
*/
cy_en_usb_dev_status_t Cy_USB_Dev_HID_Init(cy_stc_usb_dev_hid_config_t const *config,
cy_stc_usb_dev_hid_context_t *context,
cy_stc_usb_dev_context_t *devContext);
cy_en_usb_dev_hid_timer_state_t Cy_USB_Dev_HID_UpdateTimer(uint32_t interface,
uint32_t reportId,
cy_stc_usb_dev_hid_context_t *context);
__STATIC_INLINE uint32_t Cy_USB_Dev_HID_GetProtocol(uint32_t interface,
cy_stc_usb_dev_hid_context_t const *context);
__STATIC_INLINE void Cy_USB_Dev_HID_RegisterGetReportCallback(cy_cb_usbfs_dev_hid_get_report_t callback,
cy_stc_usb_dev_hid_context_t *context);
__STATIC_INLINE void Cy_USB_Dev_HID_RegisterSetReportCallback(cy_cb_usbfs_dev_hid_set_report_t callback,
cy_stc_usb_dev_hid_context_t *context);
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_HID_GetClass(cy_stc_usb_dev_hid_context_t *context);
/** \} group_usb_dev_hid_functions */
/*******************************************************************************
* API Constants
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid_macros
* \{
*/
/** Protocol options */
#define CY_USB_DEV_HID_PROTOCOL_BOOT (0U) /**< Boot Protocol */
#define CY_USB_DEV_HID_PROTOCOL_REPORT (1U) /**< Report Protocol */
/** Report types */
#define CY_USB_DEV_HID_REPORT_TYPE_INPUT (1U) /**< Input report type */
#define CY_USB_DEV_HID_REPORT_TYPE_OUTPUT (2U) /**< Output report type */
#define CY_USB_DEV_HID_REPORT_TYPE_FEATURE (3U) /**< Feature report type */
/** HID Class Requests */
#define CY_USB_DEV_HID_RQST_GET_REPORT (0x1U) /**< GET_REPORT HID Class Request */
#define CY_USB_DEV_HID_RQST_GET_IDLE (0x2U) /**< GET_IDLE HID Class Request */
#define CY_USB_DEV_HID_RQST_GET_PROTOCOL (0x3U) /**< GET_PROTOCOL HID Class Request */
#define CY_USB_DEV_HID_RQST_SET_REPORT (0x9U) /**< SET_REPORT HID Class Request */
#define CY_USB_DEV_HID_RQST_SET_IDLE (0xAU) /**< SET_IDLE HID Class Request */
#define CY_USB_DEV_HID_RQST_SET_PROTOCOL (0xBU) /**< SET_PROTOCOL HID Class Request */
/** \} group_usb_dev_hid_functions */
/*******************************************************************************
* In-line Function Implementation
*******************************************************************************/
/**
* \addtogroup group_usb_dev_hid_functions
* \{
*/
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_RegisterGetReportCallback
****************************************************************************//**
*
* Registers a callback function that handles a GET_REPORT request.
* The GET_REPORT request is STALLed if the callback function is not registered
* or returns an error.
* To remove the callback function, pass NULL as the function pointer.
*
* \param callback
* The pointer to a callback function.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
*******************************************************************************/
__STATIC_INLINE void Cy_USB_Dev_HID_RegisterGetReportCallback(cy_cb_usbfs_dev_hid_get_report_t callback,
cy_stc_usb_dev_hid_context_t *context)
{
context->handleGetReport = callback;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_RegisterSetReportCallback
****************************************************************************//**
*
* Registers a callback function that handles SET_REPORT request. This function
* is called when data stage of control transfer was completed (USB Device
* received report data from the USB Host). The SET_REPORT request is STALLed
* if the callback function is not registered or returns an error.
* To remove handler, set the handle parameter to NULL and call this function.
*
* \param callback
* The pointer to a callback function.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
*******************************************************************************/
__STATIC_INLINE void Cy_USB_Dev_HID_RegisterSetReportCallback(cy_cb_usbfs_dev_hid_set_report_t callback,
cy_stc_usb_dev_hid_context_t *context)
{
context->handleSetReport = callback;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_GetClass
****************************************************************************//**
*
* Returns pointer to the HID class structure.
* This function is useful to override class event handlers using
* \ref group_usb_dev_functions_class_support.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* The pointer to the HID class structure.
*
*******************************************************************************/
__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_HID_GetClass(cy_stc_usb_dev_hid_context_t *context)
{
return &context->classObj;
}
/*******************************************************************************
* Function Name: Cy_USB_Dev_HID_GetProtocol
****************************************************************************//**
*
* Returns the HID protocol value for a certain interface.
*
* \param interface
* Interface number.
*
* \param context
* The pointer to the context structure \ref cy_stc_usb_dev_hid_context_t
* allocated by the user. The structure is used during the HID Class operation
* for internal configuration and data retention. The user must not modify
* anything in this structure.
*
* \return
* Supported protocol: \ref CY_USB_DEV_HID_PROTOCOL_BOOT or
* \ref CY_USB_DEV_HID_PROTOCOL_REPORT.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_USB_Dev_HID_GetProtocol(uint32_t interface,
cy_stc_usb_dev_hid_context_t const *context)
{
return ((interface < CY_USB_DEV_NUM_INTERFACES_MAX) ?
context->protocol[interface] : (uint32_t) -1);
}
/** \} group_usb_dev_hid_functions */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_HID_H) */
/* [] END OF FILE */

View File

@ -0,0 +1,54 @@
/***************************************************************************//**
* \file cy_usb_dev_hid_descr.h
* \version 2.10
*
* Provides HID class-specific descriptor defines.
*
********************************************************************************
* \copyright
* (c) 2018-2021, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#if !defined(CY_USB_DEV_HID_DESCR_H)
#define CY_USB_DEV_HID_DESCR_H
#if (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS))
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************************************
* API Constants
*******************************************************************************/
/** \cond INTERNAL */
/* Supported HID version */
#define CY_USB_DEV_HID_VERSION_1_11 (0x0111U)
/* HID Class */
#define CY_USB_DEV_HID_CLASS (3U)
#define CY_USB_DEV_HID_SUBCLASS_NONE (0U)
#define CY_USB_DEV_HID_PROTOCOL_NONE (0U)
/* Descriptors */
#define CY_USB_DEV_HID_DESCRIPTOR (33U)
#define CY_USB_DEV_HID_DESCRIPTOR_LENGTH (9U)
#define CY_USB_DEV_HID_REPORT_DESCRIPTOR (34U)
/** \endcond */
#if defined(__cplusplus)
}
#endif
#endif /* (defined(CY_IP_MXUSBFS) || defined(CY_IP_M0S8USBDSS)) */
#endif /* (CY_USB_DEV_HID_DESCR_H) */
/* [] END OF FILE */

View File

@ -111,17 +111,7 @@ CONFIG_FINSH_USING_DESCRIPTION=y
# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set # CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set
# CONFIG_FINSH_USING_AUTH is not set # CONFIG_FINSH_USING_AUTH is not set
CONFIG_FINSH_ARG_MAX=10 CONFIG_FINSH_ARG_MAX=10
CONFIG_RT_USING_DFS=y # CONFIG_RT_USING_DFS is not set
CONFIG_DFS_USING_POSIX=y
CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=4
CONFIG_DFS_FILESYSTEM_TYPES_MAX=4
CONFIG_DFS_FD_MAX=16
# CONFIG_RT_USING_DFS_MNTTABLE is not set
# CONFIG_RT_USING_DFS_ELMFAT is not set
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
# CONFIG_RT_USING_FAL is not set # CONFIG_RT_USING_FAL is not set
# CONFIG_RT_USING_LWP is not set # CONFIG_RT_USING_LWP is not set
@ -143,13 +133,11 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
CONFIG_RT_USING_PIN=y CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_ADC is not set # CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set # CONFIG_RT_USING_DAC is not set
CONFIG_RT_USING_PWM=y # CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set # CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set # CONFIG_RT_USING_MTD_NAND is not set
# CONFIG_RT_USING_PM is not set # CONFIG_RT_USING_PM is not set
CONFIG_RT_USING_RTC=y # CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_ALARM is not set
# CONFIG_RT_USING_SOFT_RTC is not set
# CONFIG_RT_USING_SDIO is not set # CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SPI is not set # CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set # CONFIG_RT_USING_WDT is not set
@ -176,20 +164,11 @@ CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
# #
# POSIX (Portable Operating System Interface) layer # POSIX (Portable Operating System Interface) layer
# #
CONFIG_RT_USING_POSIX_FS=y # CONFIG_RT_USING_POSIX_FS is not set
CONFIG_RT_USING_POSIX_DEVIO=y # CONFIG_RT_USING_POSIX_DELAY is not set
CONFIG_RT_USING_POSIX_STDIO=y # CONFIG_RT_USING_POSIX_CLOCK is not set
# CONFIG_RT_USING_POSIX_POLL is not set
# CONFIG_RT_USING_POSIX_SELECT is not set
# CONFIG_RT_USING_POSIX_SOCKET is not set
# CONFIG_RT_USING_POSIX_TERMIOS is not set
# CONFIG_RT_USING_POSIX_AIO is not set
# CONFIG_RT_USING_POSIX_MMAN is not set
CONFIG_RT_USING_POSIX_DELAY=y
CONFIG_RT_USING_POSIX_CLOCK=y
# CONFIG_RT_USING_POSIX_TIMER is not set # CONFIG_RT_USING_POSIX_TIMER is not set
CONFIG_RT_USING_PTHREADS=y # CONFIG_RT_USING_PTHREADS is not set
CONFIG_PTHREAD_NUM_MAX=8
# CONFIG_RT_USING_MODULE is not set # CONFIG_RT_USING_MODULE is not set
# #
@ -524,7 +503,6 @@ CONFIG_PTHREAD_NUM_MAX=8
# CONFIG_PKG_USING_REALTEK_AMEBA is not set # CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set # CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_SHT3X is not set # CONFIG_PKG_USING_SHT3X is not set
# CONFIG_PKG_USING_ADT74XX is not set
# CONFIG_PKG_USING_AS7341 is not set # CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set # CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set # CONFIG_PKG_USING_ICM20608 is not set
@ -697,20 +675,22 @@ CONFIG_BSP_USING_UART=y
# CONFIG_BSP_USING_UART3 is not set # CONFIG_BSP_USING_UART3 is not set
# CONFIG_BSP_USING_UART4 is not set # CONFIG_BSP_USING_UART4 is not set
CONFIG_BSP_USING_UART5=y CONFIG_BSP_USING_UART5=y
CONFIG_BSP_USING_PWM=y # CONFIG_BSP_USING_PWM is not set
CONFIG_BSP_USING_PWM0=y # CONFIG_BSP_USING_SPI is not set
CONFIG_BSP_USING_PWM0_CH7=y
# CONFIG_BSP_USING_PWM0_PORT2 is not set
# CONFIG_BSP_USING_PWM0_PORT5 is not set
# CONFIG_BSP_USING_PWM0_PORT7 is not set
CONFIG_BSP_USING_PWM0_PORT9=y
# CONFIG_BSP_USING_PWM0_PORT10 is not set
# CONFIG_BSP_USING_PWM0_PORT12 is not set
# CONFIG_BSP_USING_ADC is not set # CONFIG_BSP_USING_ADC is not set
# CONFIG_BSP_USING_SDMMC is not set
# CONFIG_BSP_USING_QSPI_FLASH is not set # CONFIG_BSP_USING_QSPI_FLASH is not set
# CONFIG_BSP_USING_HW_I2C is not set # CONFIG_BSP_USING_HW_I2C is not set
# CONFIG_BSP_USING_I2C is not set # CONFIG_BSP_USING_I2C is not set
# CONFIG_BSP_USING_USBD is not set
# CONFIG_BSP_USING_RTC is not set
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
# CONFIG_BSP_USING_WDT is not set
# CONFIG_BSP_USING_DAC is not set
# CONFIG_BSP_USING_TIM is not set
# #
# Board extended module Drivers # Board extended module Drivers
# #
# CONFIG_BSP_USING_SLIDER is not set
# CONFIG_BSP_USING_RW007 is not set

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>psoc6-pioneerkit_modus</name> <name>dist_ide_project</name>
<comment></comment> <comment />
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
@ -20,9 +20,9 @@
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.cdt.core.cnature</nature> <nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>com.cypress.studio.app.cymodusnature</nature> <nature>com.cypress.studio.app.cymodusnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures> </natures>
<linkedResources />
</projectDescription> </projectDescription>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.pyocd.launchConfigurationType">
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.adapterName" value="DAP-LINK"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.binFlashStartAddress" value=""/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doContinue" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doFirstReset" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doGdbServerAllocateConsole" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doSecondReset" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.doStartGdbServer" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.enableSemihosting" value="true"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.firstResetType" value="init"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbClientOtherOptions" value=""/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerBusSpeed" value="12000000"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerConnectionAddress" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerDeviceName" value="cy8c64xA_cm4"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerEnableSemihosting" value="false"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerExecutable" value="E:\software\RT-ThreadStudio\repo\Extract\Debugger_Support_Packages\openocd\bin\openocd.exe"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerFlashMode" value="0"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerGdbPortNumber" value="3333"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerOther" value=""/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.gdbServerTelnetPortNumber" value="4444"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.otherInitCommands" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.otherRunCommands" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.programMode" value="HEX"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.pyocd.secondResetType" value="halt"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU PyOCD"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${rtt_gnu_gcc}/arm-none-eabi-gdb.exe"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/rtthread.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="dist_ide_project"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/dist_ide_project"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.cdt.debug.core.sourceLocator"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="GBK"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType">
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="true"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.firstResetType" value="init"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off&#13;&#10;set remotetimeout 15"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${debugger_install_path}/${openocd_debugger_relative_path}openocd/bin/openocd.exe"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-s ../scripts -f interface/kitprog3.cfg -f target/psoc6_2m.cfg -c &quot;psoc6.cpu.cm4 configure -rtos auto -rtos-wipe-on-reset-halt 1&quot; -c &quot;gdb_port 3332&quot; -c &quot;psoc6 sflash_restrictions 1&quot; -c &quot;init; reset init&quot;"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherRunCommands" value="mon psoc6 reset_halt sysresetreq&#13;&#10;flushregs&#13;&#10;mon gdb_sync&#13;&#10;stepi"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.secondResetType" value="run"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value="${workspace_loc:\dist_ide_project\Debug\rtthread.hex}"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value="${workspace_loc:\dist_ide_project\Debug\rtthread.elf}"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="E:\software\RT-ThreadStudio\repo\Extract\ToolChain_Support_Packages\ARM\GNU_Tools_for_ARM_Embedded_Processors\10.2.1\bin\arm-none-eabi-gdb.exe"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/rtthread.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="dist_ide_project"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/dist_ide_project"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="GBK"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>

View File

@ -34,7 +34,7 @@
| **片上外设** | **支持情况** | **备注** | | **片上外设** | **支持情况** | **备注** |
| :----------: | :----------: | :-----------: | | :----------: | :----------: | :-----------: |
| USB 转串口 | 支持 | | | USB 转串口 | 支持 | UART5 |
| GPIO | 支持 | — | | GPIO | 支持 | — |
| UART | 支持 | UART0-5 | | UART | 支持 | UART0-5 |
| I2C | 支持 | 软件+硬件 I2C | | I2C | 支持 | 软件+硬件 I2C |
@ -42,29 +42,26 @@
| WDT | 支持 | — | | WDT | 支持 | — |
| PWM | 支持 | — | | PWM | 支持 | — |
| SPI | 支持 | — | | SPI | 支持 | — |
| HardTimer | 暂不支持 | — | | HardTimer | 支持 | — |
| DAC | 暂不支持 | — | | DAC | 支持 | IDAC |
| Flash | 暂不支持 | — | | Flash | 支持 | 片内 Falsh |
| Touch | 支持 | 触摸滑条 |
| SDIO | 暂不支持 | — | | SDIO | 暂不支持 | — |
| USB Device | 暂不支持 | — | | USB Device | 暂不支持 | — |
| USB Host | 暂不支持 | — | | USB Host | 暂不支持 | — |
## 使用说明 ## 快速上手
- 快速上手 本 BSP 是以 `MDK V5``RT-Thread Studio` 为开发环境编译器ARMClang / GCC接下来介绍如何将系统运行起来。
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 ### 使用 MDK V5 开发
### 快速上手
本 BSP 是以 MDK V5 开发环境编译器ARMClang ),接下来介绍如何将系统运行起来。
#### 硬件连接 #### 硬件连接
使用数据线连接开发板到 PC。 使用数据线连接开发板到 PC。
#### 编译下载 #### 编译下载
1、配置工程 1、配置工程
首先打开 MDK ,若没有安装 `Cypress-PSoC6` 的芯片支持包会提示在线安装,根据提示安装即可。若受网络问题,可以进入 [keil](https://www.keil.com/dd2/pack) 官网下载安装包,离线安装。 首先打开 MDK ,若没有安装 `Cypress-PSoC6` 的芯片支持包会提示在线安装,根据提示安装即可。若受网络问题,可以进入 [keil](https://www.keil.com/dd2/pack) 官网下载安装包,离线安装。
@ -75,17 +72,39 @@
3、下载此工程 3、下载此工程
工程默认配置使用板载 `DAP-LINK` 使用 `SWD` 方式下载程序,使用数据线连接开发板,编译之后直接点击下载按钮即可。 工程默认配置使用板载 `DAP-LINK` 使用 `SWD` 方式下载程序,使用数据线连接开发板,编译之后直接点击下载按钮即可。
#### 运行结果 ### 使用 RT-Thread Studio 开发
#### 导入工程
* 首先打开 `RT-Thread Studio` 开发工具,点加左上角文件—>导入—> RT-Thread Studio项目到工作空间中。
![](./figures/studio1.png)
* 接着选择 `PSoC6 CY8CKIT-062S2-43012` 开发板支持包的目录,进行导入。
![](./figures/studio2.png)
#### 编译下载
* 点击 IDE 左上角的构建选项进行工程的编译。
![](./figures/studio3-build.png)
* 当编译无错误警告时,点击 `Debug``Download` 选项进行调试/下载。
注:若点击下载并下载成功后串口终端无显示信息,请手动按下复位按键进行重启运行。
![](./figures/studio4-download.png)
## 运行结果
下载程序成功之后,系统会自动运行。打开终端工具串口助手,选择波特率为 115200。复位设备后LED 将会以 500HZ 的频率闪烁,而且在终端上可以看到 `RT-Thread` 的输出信息: 下载程序成功之后,系统会自动运行。打开终端工具串口助手,选择波特率为 115200。复位设备后LED 将会以 500HZ 的频率闪烁,而且在终端上可以看到 `RT-Thread` 的输出信息:
注:推荐使用串口调试助手如:`MobaXterm` 注:推荐使用串口调试助手如:`MobaXterm`
``` ```
\ | / \ | /
- RT - Thread Operating System - RT - Thread Operating System
/ | \ 4.1.1 build Jul 25 2022 18:03:35 / | \ 4.1.1 build Jul 25 2022 18:03:35
@ -93,7 +112,7 @@
msh > msh >
``` ```
## 联系人信息 ## 联系人
维护人: 维护人:

View File

@ -204,6 +204,11 @@ menu "On-chip Peripheral Drivers"
endif endif
endif endif
config BSP_USING_USBD
bool "Enable USB Device"
select RT_USING_USB_DEVICE
default n
menuconfig BSP_USING_RTC menuconfig BSP_USING_RTC
bool "Enable RTC" bool "Enable RTC"
select RT_USING_RTC select RT_USING_RTC
@ -255,8 +260,6 @@ menu "On-chip Peripheral Drivers"
bool "Enable TIM2" bool "Enable TIM2"
default n default n
endif endif
endmenu endmenu
menu "Board extended module Drivers" menu "Board extended module Drivers"

View File

@ -30,11 +30,15 @@ startup_path_prefix = SDK_LIB
if rtconfig.PLATFORM == 'gcc': if rtconfig.PLATFORM == 'gcc':
src += [startup_path_prefix + src += [startup_path_prefix +
'/IFX_PSOC6_HAL/TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S'] '/IFX_PSOC6_HAL/TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S']
src += [startup_path_prefix +
'/IFX_PSOC6_HAL/mtb-pdl-cat1/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S']
elif rtconfig.PLATFORM in ['armcc', 'armclang']: elif rtconfig.PLATFORM in ['armcc', 'armclang']:
src += [startup_path_prefix + src += [startup_path_prefix +
'/IFX_PSOC6_HAL/TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S'] '/IFX_PSOC6_HAL/TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S']
src += [startup_path_prefix +
'/IFX_PSOC6_HAL/mtb-pdl-cat1/drivers/source/TOOLCHAIN_ARM/cy_syslib_mdk.S']
CPPDEFINES = ['IFX_PSOC6_43012', 'CY_USING_HAL', 'COMPONENT_CAT1A', 'COMPONENT_CAT1', 'COMPONENT_BSP_DESIGN_MODUS'] CPPDEFINES = ['CY8C624ABZI_S2D44', 'IFX_PSOC6_43012', 'CY_USING_HAL', 'COMPONENT_CAT1A', 'COMPONENT_CAT1', 'COMPONENT_BSP_DESIGN_MODUS']
group = DefineGroup('Drivers', src, depend=[''], CPPPATH=path, CPPDEFINES=CPPDEFINES) group = DefineGroup('Drivers', src, depend=[''], CPPPATH=path, CPPDEFINES=CPPDEFINES)
Return('group') Return('group')

View File

@ -9,7 +9,6 @@
*/ */
#include "board.h" #include "board.h"
#include "drv_uart.h"
void cy_bsp_all_init(void) void cy_bsp_all_init(void)
{ {

View File

@ -16,10 +16,16 @@
#include "drv_common.h" #include "drv_common.h"
#include "drv_gpio.h" #include "drv_gpio.h"
#include "cy_result.h"
#include "cybsp_types.h"
#include "cyhal.h" #include "cyhal.h"
#include "cybsp.h" #include "cybsp.h"
#include "cy_pdl.h"
#include "cy_retarget_io.h" #ifdef BSP_USING_USBD
#include "cy_usb_dev.h"
#include "cy_usb_dev_hid.h"
#include "cycfg_usbdev.h"
#endif
/*FLASH CONFIG*/ /*FLASH CONFIG*/
#define IFX_FLASH_START_ADRESS ((uint32_t)0x10000000) #define IFX_FLASH_START_ADRESS ((uint32_t)0x10000000)
@ -40,6 +46,7 @@
#ifdef __ARMCC_VERSION #ifdef __ARMCC_VERSION
extern int Image$$RW_IRAM1$$ZI$$Limit; extern int Image$$RW_IRAM1$$ZI$$Limit;
#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
#define HEAP_END IFX_SRAM_END
#elif __ICCARM__ #elif __ICCARM__
#pragma section="HEAP" #pragma section="HEAP"
#define HEAP_BEGIN (__segment_end("HEAP")) #define HEAP_BEGIN (__segment_end("HEAP"))
@ -50,8 +57,6 @@
#define HEAP_END (void*)&__HeapLimit #define HEAP_END (void*)&__HeapLimit
#endif #endif
#define HEAP_END IFX_SRAM_END
void cy_bsp_all_init(void); void cy_bsp_all_init(void);
#endif #endif

View File

@ -172,12 +172,41 @@ SECTIONS
*(SORT(.dtors.*)) *(SORT(.dtors.*))
*(.dtors) *(.dtors)
. = ALIGN(4);
/* Read-only code (constants). */ /* Read-only code (constants). */
*(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*) *(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*)
KEEP(*(.eh_frame*)) KEEP(*(.eh_frame*))
} > flash
/* section information for utest */
. = ALIGN(4);
__rt_utest_tc_tab_start = .;
KEEP(*(UtestTcTab))
__rt_utest_tc_tab_end = .;
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
. = ALIGN(4);
/* section information for modules */
. = ALIGN(4);
__rtmsymtab_start = .;
KEEP(*(RTMSymTab))
__rtmsymtab_end = .;
/* section information for initialization */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
} > flash
.ARM.extab : .ARM.extab :
{ {
@ -213,70 +242,24 @@ SECTIONS
__copy_table_end__ = .; __copy_table_end__ = .;
} > flash } > flash
/* setction information for finsh shell begin */
FSymTab :
{
. = ALIGN(4); . = ALIGN(4);
__fsymtab_start = .; .ctors :
KEEP(*(FSymTab))
__fsymtab_end = .;
} > flash
VSymTab :
{ {
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
} > flash
/* section information for utest */
UtestTcTab :
{
. = ALIGN(4);
__rt_utest_tc_tab_start = .;
KEEP(*(UtestTcTab))
__rt_utest_tc_tab_end = .;
}
/* section information for at server */
RtAtCmdTab :
{
. = ALIGN(4);
__rtatcmdtab_start = .;
KEEP(*(UtestTcTab))
__rtatcmdtab_end = .;
}
/* section information for modules */
RTMSymTab :
{
. = ALIGN(4);
__rtmsymtab_start = .;
KEEP(*(UtestTcTab))
__rtmsymtab_end = .;
}
/* section information for initial. */
rti_fn :
{
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
} > flash
rti_fn :
{
. = ALIGN(4);
PROVIDE(__ctors_start__ = .); PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))
__rt_init_end = .;
PROVIDE(__ctors_end__ = .); PROVIDE(__ctors_end__ = .);
} > flash } > flash
init_array :
{
. = ALIGN(4); . = ALIGN(4);
__ctors_start__ = .; .dtors :
KEEP(*(SORT(.init_array*))) {
__ctors_end__ = .; PROVIDE(__dtors_start__ = .);
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
PROVIDE(__dtors_end__ = .);
} > flash } > flash
/* setction information for finsh shell end */
/* To clear multiple BSS sections, /* To clear multiple BSS sections,
* uncomment .zero.table section and, * uncomment .zero.table section and,
@ -422,7 +405,6 @@ SECTIONS
KEEP(*(.cy_sflash_user_data)) KEEP(*(.cy_sflash_user_data))
} > sflash_user_data } > sflash_user_data
/* Supervisory Flash: Normal Access Restrictions (NAR) */ /* Supervisory Flash: Normal Access Restrictions (NAR) */
.cy_sflash_nar : .cy_sflash_nar :
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,6 @@
clean2:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS)
-$(RM) $(OBJS) *.elf
-@echo ' '
*.elf: $(wildcard ../board/linker_scripts/link.ld)

View File

@ -73,7 +73,7 @@
<LExpSel>0</LExpSel> <LExpSel>0</LExpSel>
</OPTXL> </OPTXL>
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>
@ -238,8 +238,8 @@
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\stdlib.c</PathWithFileName> <PathWithFileName>..\..\..\components\libc\compilers\common\cctype.c</PathWithFileName>
<FilenameWithoutPath>stdlib.c</FilenameWithoutPath> <FilenameWithoutPath>cctype.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
@ -250,8 +250,56 @@
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\time.c</PathWithFileName> <PathWithFileName>..\..\..\components\libc\compilers\common\cstdio.c</PathWithFileName>
<FilenameWithoutPath>time.c</FilenameWithoutPath> <FilenameWithoutPath>cstdio.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\cstdlib.c</PathWithFileName>
<FilenameWithoutPath>cstdlib.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>7</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\cstring.c</PathWithFileName>
<FilenameWithoutPath>cstring.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>8</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\ctime.c</PathWithFileName>
<FilenameWithoutPath>ctime.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>9</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\libc\compilers\common\cwchar.c</PathWithFileName>
<FilenameWithoutPath>cwchar.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
@ -265,7 +313,7 @@
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>6</FileNumber> <FileNumber>10</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -277,7 +325,7 @@
</File> </File>
<File> <File>
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>7</FileNumber> <FileNumber>11</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -289,7 +337,7 @@
</File> </File>
<File> <File>
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>8</FileNumber> <FileNumber>12</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -301,7 +349,7 @@
</File> </File>
<File> <File>
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>9</FileNumber> <FileNumber>13</FileNumber>
<FileType>2</FileType> <FileType>2</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -313,7 +361,7 @@
</File> </File>
<File> <File>
<GroupNumber>3</GroupNumber> <GroupNumber>3</GroupNumber>
<FileNumber>10</FileNumber> <FileNumber>14</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -333,7 +381,7 @@
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>11</FileNumber> <FileNumber>15</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -345,7 +393,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>12</FileNumber> <FileNumber>16</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -357,7 +405,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>13</FileNumber> <FileNumber>17</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -369,7 +417,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>14</FileNumber> <FileNumber>18</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -381,7 +429,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>15</FileNumber> <FileNumber>19</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -393,7 +441,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>16</FileNumber> <FileNumber>20</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -405,7 +453,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>17</FileNumber> <FileNumber>21</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -417,7 +465,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>18</FileNumber> <FileNumber>22</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -429,7 +477,7 @@
</File> </File>
<File> <File>
<GroupNumber>4</GroupNumber> <GroupNumber>4</GroupNumber>
<FileNumber>19</FileNumber> <FileNumber>23</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -443,13 +491,13 @@
<Group> <Group>
<GroupName>Drivers</GroupName> <GroupName>Drivers</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>20</FileNumber> <FileNumber>24</FileNumber>
<FileType>2</FileType> <FileType>2</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -461,7 +509,19 @@
</File> </File>
<File> <File>
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>21</FileNumber> <FileNumber>25</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\TOOLCHAIN_ARM\cy_syslib_mdk.S</PathWithFileName>
<FilenameWithoutPath>cy_syslib_mdk.S</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -473,7 +533,7 @@
</File> </File>
<File> <File>
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>22</FileNumber> <FileNumber>27</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -485,7 +545,7 @@
</File> </File>
<File> <File>
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>23</FileNumber> <FileNumber>28</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -497,7 +557,7 @@
</File> </File>
<File> <File>
<GroupNumber>5</GroupNumber> <GroupNumber>5</GroupNumber>
<FileNumber>24</FileNumber> <FileNumber>29</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -509,62 +569,6 @@
</File> </File>
</Group> </Group>
<Group>
<GroupName>Filesystem</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\dfs\src\dfs_posix.c</PathWithFileName>
<FilenameWithoutPath>dfs_posix.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\dfs\src\dfs_fs.c</PathWithFileName>
<FilenameWithoutPath>dfs_fs.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\dfs\src\dfs.c</PathWithFileName>
<FilenameWithoutPath>dfs.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\dfs\src\dfs_file.c</PathWithFileName>
<FilenameWithoutPath>dfs_file.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group> <Group>
<GroupName>Finsh</GroupName> <GroupName>Finsh</GroupName>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -572,8 +576,8 @@
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>7</GroupNumber> <GroupNumber>6</GroupNumber>
<FileNumber>29</FileNumber> <FileNumber>30</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -584,8 +588,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>7</GroupNumber> <GroupNumber>6</GroupNumber>
<FileNumber>30</FileNumber> <FileNumber>31</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -596,20 +600,20 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>7</GroupNumber> <GroupNumber>6</GroupNumber>
<FileNumber>31</FileNumber> <FileNumber>32</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\..\..\components\finsh\msh_file.c</PathWithFileName> <PathWithFileName>..\..\..\components\finsh\msh_parse.c</PathWithFileName>
<FilenameWithoutPath>msh_file.c</FilenameWithoutPath> <FilenameWithoutPath>msh_parse.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>7</GroupNumber> <GroupNumber>6</GroupNumber>
<FileNumber>32</FileNumber> <FileNumber>33</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -628,8 +632,8 @@
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>33</FileNumber> <FileNumber>34</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -640,8 +644,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>34</FileNumber> <FileNumber>35</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -652,8 +656,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>35</FileNumber> <FileNumber>36</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -664,8 +668,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>36</FileNumber> <FileNumber>37</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -676,8 +680,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>37</FileNumber> <FileNumber>38</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -688,8 +692,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>38</FileNumber> <FileNumber>39</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -700,8 +704,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>39</FileNumber> <FileNumber>40</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -712,8 +716,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>40</FileNumber> <FileNumber>41</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -724,8 +728,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>41</FileNumber> <FileNumber>42</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -736,8 +740,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>42</FileNumber> <FileNumber>43</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -748,8 +752,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>43</FileNumber> <FileNumber>44</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -760,8 +764,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>44</FileNumber> <FileNumber>45</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -772,8 +776,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>8</GroupNumber> <GroupNumber>7</GroupNumber>
<FileNumber>45</FileNumber> <FileNumber>46</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -792,19 +796,7 @@
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_02_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_02_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>47</FileNumber> <FileNumber>47</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -816,7 +808,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>48</FileNumber> <FileNumber>48</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -828,7 +820,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>49</FileNumber> <FileNumber>49</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -840,32 +832,20 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>50</FileNumber> <FileNumber>50</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_03_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_03_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>51</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_scb_i2c.c</PathWithFileName> <PathWithFileName>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_scb_i2c.c</PathWithFileName>
<FilenameWithoutPath>cy_scb_i2c.c</FilenameWithoutPath> <FilenameWithoutPath>cy_scb_i2c.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>52</FileNumber> <FileNumber>51</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -876,8 +856,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>53</FileNumber> <FileNumber>52</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -888,8 +868,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>54</FileNumber> <FileNumber>53</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -900,8 +880,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>55</FileNumber> <FileNumber>54</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -912,8 +892,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>56</FileNumber> <FileNumber>55</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -924,8 +904,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>57</FileNumber> <FileNumber>56</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -936,8 +916,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>58</FileNumber> <FileNumber>57</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -948,8 +928,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>59</FileNumber> <FileNumber>58</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -960,8 +940,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>60</FileNumber> <FileNumber>59</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -972,8 +952,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>61</FileNumber> <FileNumber>60</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -984,20 +964,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>62</FileNumber> <FileNumber>61</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_01_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_01_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>63</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1008,8 +976,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>64</FileNumber> <FileNumber>62</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1020,8 +988,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>65</FileNumber> <FileNumber>63</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1032,8 +1000,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>66</FileNumber> <FileNumber>64</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1044,20 +1012,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>67</FileNumber> <FileNumber>65</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_04_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_04_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>68</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1068,8 +1024,20 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>69</FileNumber> <FileNumber>66</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_02_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_02_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>67</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1080,8 +1048,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>70</FileNumber> <FileNumber>68</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1092,20 +1060,20 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>71</FileNumber> <FileNumber>69</FileNumber>
<FileType>2</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\TOOLCHAIN_ARM\cy_syslib_mdk.s</PathWithFileName> <PathWithFileName>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_system.c</PathWithFileName>
<FilenameWithoutPath>cy_syslib_mdk.s</FilenameWithoutPath> <FilenameWithoutPath>cycfg_system.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>72</FileNumber> <FileNumber>70</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1116,8 +1084,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>73</FileNumber> <FileNumber>71</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1128,8 +1096,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>74</FileNumber> <FileNumber>72</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1140,8 +1108,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>75</FileNumber> <FileNumber>73</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1152,8 +1120,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>76</FileNumber> <FileNumber>74</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1164,8 +1132,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>77</FileNumber> <FileNumber>75</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1176,8 +1144,20 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>78</FileNumber> <FileNumber>76</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_04_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_04_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>77</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1188,8 +1168,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>79</FileNumber> <FileNumber>78</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1200,8 +1180,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>80</FileNumber> <FileNumber>79</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1212,8 +1192,8 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>81</FileNumber> <FileNumber>80</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
@ -1224,7 +1204,19 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>81</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_01_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_01_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>82</FileNumber> <FileNumber>82</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1236,7 +1228,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>83</FileNumber> <FileNumber>83</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1248,7 +1240,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>84</FileNumber> <FileNumber>84</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1260,7 +1252,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>85</FileNumber> <FileNumber>85</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1272,7 +1264,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>86</FileNumber> <FileNumber>86</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1284,7 +1276,7 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>87</FileNumber> <FileNumber>87</FileNumber>
<FileType>4</FileType> <FileType>4</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1296,31 +1288,31 @@
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>88</FileNumber> <FileNumber>88</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_system.c</PathWithFileName>
<FilenameWithoutPath>cycfg_system.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>89</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_clocks.c</PathWithFileName> <PathWithFileName>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_clocks.c</PathWithFileName>
<FilenameWithoutPath>cycfg_clocks.c</FilenameWithoutPath> <FilenameWithoutPath>cycfg_clocks.c</FilenameWithoutPath>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<bShared>0</bShared> <bShared>0</bShared>
</File> </File>
<File> <File>
<GroupNumber>9</GroupNumber> <GroupNumber>8</GroupNumber>
<FileNumber>89</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_03_cm0p_sleep.c</PathWithFileName>
<FilenameWithoutPath>psoc6_03_cm0p_sleep.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>90</FileNumber> <FileNumber>90</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>

View File

@ -11,7 +11,6 @@
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<pArmCC>6160000::V6.16::ARMCLANG</pArmCC> <pArmCC>6160000::V6.16::ARMCLANG</pArmCC>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6> <uAC6>1</uAC6>
<TargetOption> <TargetOption>
<TargetCommonOption> <TargetCommonOption>
@ -338,9 +337,9 @@
<v6Rtti>0</v6Rtti> <v6Rtti>0</v6Rtti>
<VariousControls> <VariousControls>
<MiscControls></MiscControls> <MiscControls></MiscControls>
<Define>COMPONENT_CAT1A, RT_USING_LIBC, CY_USING_HAL, __CLK_TCK=RT_TICK_PER_SECOND, COMPONENT_BSP_DESIGN_MODUS, IFX_PSOC6_43012, __RTTHREAD__, COMPONENT_CAT1, RT_USING_ARM_LIBC</Define> <Define>CY_USING_HAL, __STDC_LIMIT_MACROS, COMPONENT_CAT1A, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, RT_USING_ARM_LIBC, IFX_PSOC6_43012, __RTTHREAD__, COMPONENT_CAT1, COMPONENT_BSP_DESIGN_MODUS, CY8C624ABZI_S2D44</Define>
<Undefine></Undefine> <Undefine></Undefine>
<IncludePath>applications;..\..\..\components\libc\compilers\common;..\..\..\components\libc\compilers\common\extension;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\dfs\include;..\..\..\components\finsh;.;..\..\..\include;..\libraries\IFX_PSOC6_HAL\capsense;..\libraries\IFX_PSOC6_HAL\psoc6cm0p;..\libraries\IFX_PSOC6_HAL\retarget-io;..\libraries\IFX_PSOC6_HAL\core-lib\include;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\include;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\include_pvt;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\cmsis\include;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\include;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\COMPONENT_CAT1A\include;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\devices\COMPONENT_CAT1A\include;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\devices\COMPONENT_CAT1B\include;..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012;..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\posix\io\stdio;..\..\..\components\libc\posix\ipc</IncludePath> <IncludePath>applications;..\..\..\components\libc\compilers\common\include;..\..\..\components\libc\compilers\common\extension;..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;board\ports;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\libraries\IFX_PSOC6_HAL\capsense;..\libraries\IFX_PSOC6_HAL\psoc6cm0p;..\libraries\IFX_PSOC6_HAL\retarget-io;..\libraries\IFX_PSOC6_HAL\core-lib\include;..\libraries\IFX_PSOC6_HAL\mtb_shared\serial-flash;..\libraries\IFX_PSOC6_HAL\mtb_shared\usbdev;..\libraries\IFX_PSOC6_HAL\mtb_shared\csdidac;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\cmsis\include;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\include;..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\devices\COMPONENT_CAT1A\include;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\include_pvt;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\include;..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\COMPONENT_CAT1A\include;..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012;..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource;..\..\..\components\libc\posix\io\poll;..\..\..\components\libc\posix\io\stdio;..\..\..\components\libc\posix\ipc</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
<Aads> <Aads>
@ -405,14 +404,34 @@
<FilePath>..\..\..\components\libc\compilers\armlibc\syscalls.c</FilePath> <FilePath>..\..\..\components\libc\compilers\armlibc\syscalls.c</FilePath>
</File> </File>
<File> <File>
<FileName>stdlib.c</FileName> <FileName>cctype.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\stdlib.c</FilePath> <FilePath>..\..\..\components\libc\compilers\common\cctype.c</FilePath>
</File> </File>
<File> <File>
<FileName>time.c</FileName> <FileName>cstdio.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\time.c</FilePath> <FilePath>..\..\..\components\libc\compilers\common\cstdio.c</FilePath>
</File>
<File>
<FileName>cstdlib.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\cstdlib.c</FilePath>
</File>
<File>
<FileName>cstring.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\cstring.c</FilePath>
</File>
<File>
<FileName>ctime.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\ctime.c</FilePath>
</File>
<File>
<FileName>cwchar.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\libc\compilers\common\cwchar.c</FilePath>
</File> </File>
</Files> </Files>
</Group> </Group>
@ -504,6 +523,11 @@
<FileType>2</FileType> <FileType>2</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_CM4\TOOLCHAIN_ARM\startup_psoc6_02_cm4.S</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_CM4\TOOLCHAIN_ARM\startup_psoc6_02_cm4.S</FilePath>
</File> </File>
<File>
<FileName>cy_syslib_mdk.S</FileName>
<FileType>2</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\TOOLCHAIN_ARM\cy_syslib_mdk.S</FilePath>
</File>
<File> <File>
<FileName>board.c</FileName> <FileName>board.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -526,31 +550,6 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>Filesystem</GroupName>
<Files>
<File>
<FileName>dfs_posix.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\dfs\src\dfs_posix.c</FilePath>
</File>
<File>
<FileName>dfs_fs.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\dfs\src\dfs_fs.c</FilePath>
</File>
<File>
<FileName>dfs.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\dfs\src\dfs.c</FilePath>
</File>
<File>
<FileName>dfs_file.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\components\dfs\src\dfs_file.c</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>Finsh</GroupName> <GroupName>Finsh</GroupName>
<Files> <Files>
@ -565,9 +564,9 @@
<FilePath>..\..\..\components\finsh\msh.c</FilePath> <FilePath>..\..\..\components\finsh\msh.c</FilePath>
</File> </File>
<File> <File>
<FileName>msh_file.c</FileName> <FileName>msh_parse.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\..\..\components\finsh\msh_file.c</FilePath> <FilePath>..\..\..\components\finsh\msh_parse.c</FilePath>
</File> </File>
<File> <File>
<FileName>cmd.c</FileName> <FileName>cmd.c</FileName>
@ -649,11 +648,6 @@
<Group> <Group>
<GroupName>Libraries</GroupName> <GroupName>Libraries</GroupName>
<Files> <Files>
<File>
<FileName>psoc6_02_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_02_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cy_sysint.c</FileName> <FileName>cy_sysint.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -669,11 +663,6 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\retarget-io\cy_retarget_io.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\retarget-io\cy_retarget_io.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_03_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_03_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cy_scb_i2c.c</FileName> <FileName>cy_scb_i2c.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -729,11 +718,6 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\source\cyhal_gpio.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\source\cyhal_gpio.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_01_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_01_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cyhal_system.c</FileName> <FileName>cyhal_system.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -754,16 +738,16 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\source\cyhal_utils.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-hal-cat1\source\cyhal_utils.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_04_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_04_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cy_ipc_drv.c</FileName> <FileName>cy_ipc_drv.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_ipc_drv.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_ipc_drv.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_02_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_02_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cyhal_hwmgr.c</FileName> <FileName>cyhal_hwmgr.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -775,9 +759,9 @@
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_syslib.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_syslib.c</FilePath>
</File> </File>
<File> <File>
<FileName>cy_syslib_mdk.s</FileName> <FileName>cycfg_system.c</FileName>
<FileType>2</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\TOOLCHAIN_ARM\cy_syslib_mdk.s</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_system.c</FilePath>
</File> </File>
<File> <File>
<FileName>cycfg_peripherals.c</FileName> <FileName>cycfg_peripherals.c</FileName>
@ -809,6 +793,11 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_sysclk.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_sysclk.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_04_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_04_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cyhal_syspm.c</FileName> <FileName>cyhal_syspm.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -829,6 +818,11 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_systick.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\mtb-pdl-cat1\drivers\source\cy_systick.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_01_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_01_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cycfg.c</FileName> <FileName>cycfg.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
@ -859,16 +853,16 @@
<FileType>4</FileType> <FileType>4</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\lib\cy_capsense.lib</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\lib\cy_capsense.lib</FilePath>
</File> </File>
<File>
<FileName>cycfg_system.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_system.c</FilePath>
</File>
<File> <File>
<FileName>cycfg_clocks.c</FileName> <FileName>cycfg_clocks.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_clocks.c</FilePath> <FilePath>..\libraries\IFX_PSOC6_HAL\TARGET_CY8CKIT-062S2-43012\COMPONENT_BSP_DESIGN_MODUS\GeneratedSource\cycfg_clocks.c</FilePath>
</File> </File>
<File>
<FileName>psoc6_03_cm0p_sleep.c</FileName>
<FileType>1</FileType>
<FilePath>..\libraries\IFX_PSOC6_HAL\psoc6cm0p\COMPONENT_CM0P_SLEEP\psoc6_03_cm0p_sleep.c</FilePath>
</File>
<File> <File>
<FileName>cy_ipc_pipe.c</FileName> <FileName>cy_ipc_pipe.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>

View File

@ -46,7 +46,7 @@
#define RT_USING_DEVICE #define RT_USING_DEVICE
#define RT_USING_CONSOLE #define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128 #define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1" #define RT_CONSOLE_DEVICE_NAME "uart5"
#define RT_VER_NUM 0x40101 #define RT_VER_NUM 0x40101
#define ARCH_ARM #define ARCH_ARM
#define RT_USING_CPU_FFS #define RT_USING_CPU_FFS
@ -72,12 +72,6 @@
#define MSH_USING_BUILT_IN_COMMANDS #define MSH_USING_BUILT_IN_COMMANDS
#define FINSH_USING_DESCRIPTION #define FINSH_USING_DESCRIPTION
#define FINSH_ARG_MAX 10 #define FINSH_ARG_MAX 10
#define RT_USING_DFS
#define DFS_USING_POSIX
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 4
#define DFS_FILESYSTEM_TYPES_MAX 4
#define DFS_FD_MAX 16
/* Device Drivers */ /* Device Drivers */
@ -198,7 +192,7 @@
#define BSP_USING_GPIO #define BSP_USING_GPIO
#define BSP_USING_UART #define BSP_USING_UART
#define BSP_USING_UART1 #define BSP_USING_UART5
/* Board extended module Drivers */ /* Board extended module Drivers */

View File

@ -46,7 +46,7 @@ if PLATFORM == 'gcc':
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -Dgcc' CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.ld'
CPATH = '' CPATH = ''
LPATH = '' LPATH = ''

View File

@ -0,0 +1,22 @@
import os
import sys
import shutil
cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
import rtconfig
print("=> copy ifx bsp library")
library_dir = os.path.join(dist_dir, 'libraries')
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

View File

@ -0,0 +1,143 @@
#
# File : upgrade.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2021, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Change Logs:
# Date Author Notes
# 2021-10-11 Meco Man First version
#
# 本文件用于在HAL库更新之后
# 1.对gcc的汇编启动文件中main替换为entry函数
# 2.将启动文件heap降为0(Keil IAR)
# 3.将GCC的堆大小扩展到0x400与Keil IAR保持一致
#使用方法运行脚本将bsp/stm32的绝对路径传给脚本即可C:\Users\92036\Desktop\rt-thread\bsp\stm32
import os
import re
#将'bl main' 替换为 'bl entry'
def main2entry(path):
oldline = ''
newline = ''
for root, dirs, files in os.walk(path): #递归扫描里面的所有文件
for file in files:
if os.path.splitext(file)[1] == '.s': #找.s文件
file_path = os.path.join(root,file)
flag_need_replace = False
with open(file_path,'r+',) as f:
while True:
line = f.readline()
if line == '':
break
elif ('bl' in line) and ('main' in line): #发现'bl main'
oldline = line # bl main
newline = line.replace('main', 'entry') #将main替换为entry形成新的字符串
flag_need_replace = True #标记该文件需要做entry替换
break
if (flag_need_replace == True): #若该文件需要将main替换为entry
f.seek(0)
content = f.read()
f.seek(0)
f.truncate()
newcontent = content.replace(oldline, newline)
f.write(newcontent)
#将启动文件的heap降为0
def heap2zero(path):
oldline = ''
newline = ''
for root, dirs, files in os.walk(path): #递归扫描里面的所有文件
for file in files:
file_path = os.path.join(root,file)
if os.path.splitext(file)[1] == '.s': #找.s文件
with open(file_path,'r+',) as f:
flag_need_replace = False
while True:
line = f.readline()
if line == '':
break
re_result = re.match('\s*Heap_Size\s+EQU\s+0[xX][0-9a-fA-F]+', line) #MDK的表示方法
if re_result != None:
oldline = line
newline = re.sub('0[xX][0-9a-fA-F]+','0x00000000', oldline)
flag_need_replace = True
break
if flag_need_replace == True:
f.seek(0)
content = f.read()
f.seek(0)
f.truncate()
newcontent = content.replace(oldline, newline)
f.write(newcontent)
elif os.path.splitext(file)[1] == '.icf': #找.icf文件(IAR)
with open(file_path,'r+',) as f:
flag_need_replace = False
while True:
line = f.readline()
if line == '':
break
re_result = re.match('\s*define\s+symbol\s+__ICFEDIT_size_heap__\s*=\s*0[xX][0-9a-fA-F]+', line) #IAR的表示方法
if re_result != None:
oldline = line
newline = re.sub('0[xX][0-9a-fA-F]+','0x000', oldline)
flag_need_replace = True
break
if flag_need_replace == True:
f.seek(0)
content = f.read()
f.seek(0)
f.truncate()
newcontent = content.replace(oldline, newline)
f.write(newcontent)
elif os.path.splitext(file)[1] == '.lds': #找.lds文件(GCC)
with open(file_path,'r+',) as f:
flag_need_replace = False
while True:
line = f.readline()
if line == '':
break
re_result = re.match('\s*_system_stack_size\s*=\s*0[xX][0-9a-fA-F]+', line) #GCC的表示方法, 将默认的栈大小增加到0x400
if re_result != None:
oldline = line
newline = re.sub('0[xX][0-9a-fA-F]+','0x400', oldline)
flag_need_replace = True
break
if flag_need_replace == True:
f.seek(0)
content = f.read()
f.seek(0)
f.truncate()
newcontent = content.replace(oldline, newline)
f.write(newcontent)
folder_path = input('please input path:')
main2entry(folder_path)
heap2zero(folder_path)