mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
1 parent
38154c4656
commit
9a8249bbba
56 files changed
+12875
-562
No files matched your search
@@ -37,6 +37,7 @@ jobs:
|
||||
- {RTT_BSP: "at91/at91sam9g45", 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: "cypress/psoc6-cy8cproto-4343w", 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/gd32105c-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
|
||||
@@ -38,6 +38,9 @@ if GetDepend(['BSP_USING_SPI']):
|
||||
if GetDepend(['BSP_USING_ADC']):
|
||||
src += ['drv_adc.c']
|
||||
|
||||
if GetDepend(['BSP_USING_USBD']):
|
||||
src += ['drv_usbd.c']
|
||||
|
||||
if GetDepend('BSP_USING_RTC'):
|
||||
src += ['drv_rtc.c']
|
||||
|
||||
@@ -46,6 +49,9 @@ if GetDepend('BSP_USING_ON_CHIP_FLASH'):
|
||||
|
||||
if GetDepend(['RT_USING_WDT']):
|
||||
src += ['drv_wdt.c']
|
||||
|
||||
if GetDepend(['RT_USING_DAC']):
|
||||
src += ['drv_dac.c']
|
||||
|
||||
if GetDepend(['BSP_USING_TIM']):
|
||||
src += ['drv_hwtimer.c']
|
||||
|
||||
@@ -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 */
|
||||
@@ -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__*/
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <rtdevice.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#include "cy_retarget_io.h"
|
||||
#include "cyhal_gpio.h"
|
||||
#include "cyhal_irq_psoc.h"
|
||||
|
||||
#define GPIO_INTERRUPT_PRIORITY (7u)
|
||||
|
||||
@@ -12,51 +12,50 @@
|
||||
#include "drv_uart.h"
|
||||
|
||||
#include "uart_config.h"
|
||||
#include "cy_retarget_io.h"
|
||||
#include "cyhal_scb_common.h"
|
||||
|
||||
enum
|
||||
{
|
||||
#ifdef BSP_USING_UART0
|
||||
#ifdef BSP_USING_UART0
|
||||
UART0_INDEX,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART1
|
||||
#endif
|
||||
#ifdef BSP_USING_UART1
|
||||
UART1_INDEX,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART2
|
||||
#endif
|
||||
#ifdef BSP_USING_UART2
|
||||
UART2_INDEX,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART3
|
||||
#endif
|
||||
#ifdef BSP_USING_UART3
|
||||
UART3_INDEX,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART4
|
||||
#endif
|
||||
#ifdef BSP_USING_UART4
|
||||
UART4_INDEX,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART5
|
||||
#endif
|
||||
#ifdef BSP_USING_UART5
|
||||
UART5_INDEX,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct ifx_uart_config uart_config[] =
|
||||
{
|
||||
#ifdef BSP_USING_UART0
|
||||
#ifdef BSP_USING_UART0
|
||||
UART0_CONFIG,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART1
|
||||
#endif
|
||||
#ifdef BSP_USING_UART1
|
||||
UART1_CONFIG,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART2
|
||||
#endif
|
||||
#ifdef BSP_USING_UART2
|
||||
UART2_CONFIG,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART3
|
||||
#endif
|
||||
#ifdef BSP_USING_UART3
|
||||
UART3_CONFIG,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART4
|
||||
#endif
|
||||
#ifdef BSP_USING_UART4
|
||||
UART4_CONFIG,
|
||||
#endif
|
||||
#ifdef BSP_USING_UART5
|
||||
#endif
|
||||
#ifdef BSP_USING_UART5
|
||||
UART5_CONFIG,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct ifx_uart uart_obj[sizeof(uart_config) / sizeof(uart_config[0])] = {0};
|
||||
@@ -196,20 +195,20 @@ static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case RT_DEVICE_CTRL_CLR_INT:
|
||||
case RT_DEVICE_CTRL_CLR_INT:
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case RT_DEVICE_CTRL_SET_INT:
|
||||
/* Unmasking only the RX fifo not empty interrupt bit */
|
||||
uart->config->usart_x->INTR_RX_MASK = SCB_INTR_RX_MASK_NOT_EMPTY_Msk;
|
||||
case RT_DEVICE_CTRL_SET_INT:
|
||||
/* Unmasking only the RX fifo not empty interrupt bit */
|
||||
uart->config->usart_x->INTR_RX_MASK = SCB_INTR_RX_MASK_NOT_EMPTY_Msk;
|
||||
|
||||
/* Interrupt Settings for UART */
|
||||
Cy_SysInt_Init(uart->config->UART_SCB_IRQ_cfg, uart->config->userIsr);
|
||||
/* Interrupt Settings for UART */
|
||||
Cy_SysInt_Init(uart->config->UART_SCB_IRQ_cfg, uart->config->userIsr);
|
||||
|
||||
/* Enable the interrupt */
|
||||
NVIC_EnableIRQ(uart->config->intrSrc);
|
||||
break;
|
||||
/* Enable the interrupt */
|
||||
NVIC_EnableIRQ(uart->config->intrSrc);
|
||||
break;
|
||||
}
|
||||
|
||||
return (RT_EOK);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <rtdevice.h>
|
||||
|
||||
#include "board.h"
|
||||
#include "cycfg_peripherals.h"
|
||||
|
||||
#define uart_isr_callback(name) name##_isr_callback
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
|
||||
#ifdef BSP_USING_UART0
|
||||
/* 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,
|
||||
.intrPriority = (7u),
|
||||
|
||||
@@ -19,8 +19,7 @@ src = Split('''
|
||||
mtb-hal-cat1/source/cyhal_utils_psoc.c
|
||||
mtb-hal-cat1/source/cyhal_utils.c
|
||||
mtb-hal-cat1/source/cyhal_lptimer.c
|
||||
mtb-hal-cat1/source/cyhal_irq_psoc.c
|
||||
mtb-hal-cat1/include_pvt/cyhal_hw_types.h
|
||||
mtb-hal-cat1/source/cyhal_irq_psoc.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-pdl-cat1/devices/COMPONENT_CAT1A/source/cy_device.c
|
||||
@@ -37,8 +36,7 @@ src = Split('''
|
||||
mtb-pdl-cat1/drivers/source/cy_ipc_sema.c
|
||||
mtb-pdl-cat1/drivers/source/cy_ipc_drv.c
|
||||
mtb-pdl-cat1/drivers/source/cy_trigmux.c
|
||||
mtb-pdl-cat1/drivers/source/cy_prot.c
|
||||
mtb-pdl-cat1/drivers/source/TOOLCHAIN_ARM/cy_syslib_mdk.s
|
||||
mtb-pdl-cat1/drivers/source/cy_prot.c
|
||||
TARGET_CY8CKIT-062S2-43012/cybsp.c
|
||||
TARGET_CY8CKIT-062S2-43012/COMPONENT_CM4/system_psoc6_cm4.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']):
|
||||
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'):
|
||||
src += ['mtb-pdl-cat1/drivers/source/cy_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-hal-cat1/source/cyhal_wdt.c']
|
||||
|
||||
if GetDepend(['RT_USING_DAC']):
|
||||
src += ['mtb_shared/csdidac/cy_csdidac.c']
|
||||
|
||||
if GetDepend(['RT_USING_HWTIMER']):
|
||||
src += ['mtb-hal-cat1/source/cyhal_timer.c']
|
||||
|
||||
@@ -129,13 +140,14 @@ path = [cwd + '/capsense',
|
||||
cwd + '/retarget-io',
|
||||
cwd + '/core-lib/include',
|
||||
cwd + '/mtb_shared/serial-flash',
|
||||
cwd + '/mtb-hal-cat1/include',
|
||||
cwd + '/mtb-hal-cat1/include_pvt',
|
||||
cwd + '/mtb_shared/usbdev',
|
||||
cwd + '/mtb_shared/csdidac',
|
||||
cwd + '/mtb-pdl-cat1/cmsis/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_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/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource']
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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 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.
|
||||
@@ -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.
|
||||
@@ -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
@@ -0,0 +1 @@
|
||||
<version>2.10.0.248</version>
|
||||
@@ -0,0 +1 @@
|
||||
/docs
|
||||
@@ -0,0 +1 @@
|
||||
test/*
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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.
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -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 */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -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 */
|
||||
@@ -111,17 +111,7 @@ CONFIG_FINSH_USING_DESCRIPTION=y
|
||||
# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set
|
||||
# CONFIG_FINSH_USING_AUTH is not set
|
||||
CONFIG_FINSH_ARG_MAX=10
|
||||
CONFIG_RT_USING_DFS=y
|
||||
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_DFS is not set
|
||||
# CONFIG_RT_USING_FAL 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_ADC 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_NAND is not set
|
||||
# CONFIG_RT_USING_PM is not set
|
||||
CONFIG_RT_USING_RTC=y
|
||||
# CONFIG_RT_USING_ALARM is not set
|
||||
# CONFIG_RT_USING_SOFT_RTC is not set
|
||||
# CONFIG_RT_USING_RTC is not set
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI 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
|
||||
#
|
||||
CONFIG_RT_USING_POSIX_FS=y
|
||||
CONFIG_RT_USING_POSIX_DEVIO=y
|
||||
CONFIG_RT_USING_POSIX_STDIO=y
|
||||
# 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_FS is not set
|
||||
# CONFIG_RT_USING_POSIX_DELAY is not set
|
||||
# CONFIG_RT_USING_POSIX_CLOCK is not set
|
||||
# CONFIG_RT_USING_POSIX_TIMER is not set
|
||||
CONFIG_RT_USING_PTHREADS=y
|
||||
CONFIG_PTHREAD_NUM_MAX=8
|
||||
# CONFIG_RT_USING_PTHREADS 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_SHT2X 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_STM32_SDIO 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_UART4 is not set
|
||||
CONFIG_BSP_USING_UART5=y
|
||||
CONFIG_BSP_USING_PWM=y
|
||||
CONFIG_BSP_USING_PWM0=y
|
||||
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_PWM is not set
|
||||
# CONFIG_BSP_USING_SPI 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_HW_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
|
||||
#
|
||||
# CONFIG_BSP_USING_SLIDER is not set
|
||||
# CONFIG_BSP_USING_RW007 is not set
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>psoc6-pioneerkit_modus</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<name>dist_ide_project</name>
|
||||
<comment />
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>com.cypress.studio.app.cymodusnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>com.cypress.studio.app.cymodusnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources />
|
||||
</projectDescription>
|
||||
@@ -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="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
||||
<stringAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING" value="GBK"/>
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||
</launchConfiguration>
|
||||
@@ -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 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 "psoc6.cpu.cm4 configure -rtos auto -rtos-wipe-on-reset-halt 1" -c "gdb_port 3332" -c "psoc6 sflash_restrictions 1" -c "init; reset init""/>
|
||||
<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 flushregs mon gdb_sync 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="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/>
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||
</launchConfiguration>
|
||||
@@ -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>
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
| :----------: | :----------: | :-----------: |
|
||||
| USB 转串口 | 支持 | — |
|
||||
| USB 转串口 | 支持 | UART5 |
|
||||
| GPIO | 支持 | — |
|
||||
| UART | 支持 | UART0-5 |
|
||||
| I2C | 支持 | 软件+硬件 I2C |
|
||||
@@ -42,29 +42,26 @@
|
||||
| WDT | 支持 | — |
|
||||
| PWM | 支持 | — |
|
||||
| SPI | 支持 | — |
|
||||
| HardTimer | 暂不支持 | — |
|
||||
| DAC | 暂不支持 | — |
|
||||
| Flash | 暂不支持 | — |
|
||||
| HardTimer | 支持 | — |
|
||||
| DAC | 支持 | IDAC |
|
||||
| Flash | 支持 | 片内 Falsh |
|
||||
| Touch | 支持 | 触摸滑条 |
|
||||
| SDIO | 暂不支持 | — |
|
||||
| USB Device | 暂不支持 | — |
|
||||
| USB Host | 暂不支持 | — |
|
||||
|
||||
## 使用说明
|
||||
## 快速上手
|
||||
|
||||
- 快速上手
|
||||
本 BSP 是以 `MDK V5` 和 `RT-Thread Studio` 为开发环境(编译器:ARMClang / GCC),接下来介绍如何将系统运行起来。
|
||||
|
||||
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
|
||||
|
||||
|
||||
### 快速上手
|
||||
|
||||
本 BSP 是以 MDK V5 开发环境(编译器:ARMClang ),接下来介绍如何将系统运行起来。
|
||||
### 使用 MDK V5 开发
|
||||
|
||||
#### 硬件连接
|
||||
|
||||
使用数据线连接开发板到 PC。
|
||||
|
||||
#### 编译下载
|
||||
|
||||
1、配置工程:
|
||||
|
||||
首先打开 MDK ,若没有安装 `Cypress-PSoC6` 的芯片支持包会提示在线安装,根据提示安装即可。若受网络问题,可以进入 [keil](https://www.keil.com/dd2/pack) 官网下载安装包,离线安装。
|
||||
@@ -75,17 +72,39 @@
|
||||
|
||||
3、下载此工程:
|
||||
|
||||
|
||||
工程默认配置使用板载 `DAP-LINK` 使用 `SWD` 方式下载程序,使用数据线连接开发板,编译之后直接点击下载按钮即可。
|
||||
|
||||
#### 运行结果
|
||||
### 使用 RT-Thread Studio 开发
|
||||
|
||||
#### 导入工程
|
||||
|
||||
* 首先打开 `RT-Thread Studio` 开发工具,点加左上角文件—>导入—> RT-Thread Studio项目到工作空间中。
|
||||
|
||||

|
||||
|
||||
* 接着选择 `PSoC6 CY8CKIT-062S2-43012` 开发板支持包的目录,进行导入。
|
||||
|
||||

|
||||
|
||||
#### 编译下载
|
||||
|
||||
* 点击 IDE 左上角的构建选项进行工程的编译。
|
||||
|
||||

|
||||
|
||||
* 当编译无错误警告时,点击 `Debug` 或 `Download` 选项进行调试/下载。
|
||||
|
||||
注:若点击下载并下载成功后串口终端无显示信息,请手动按下复位按键进行重启运行。
|
||||
|
||||

|
||||
|
||||
## 运行结果
|
||||
|
||||
下载程序成功之后,系统会自动运行。打开终端工具串口助手,选择波特率为 115200。复位设备后,LED 将会以 500HZ 的频率闪烁,而且在终端上可以看到 `RT-Thread` 的输出信息:
|
||||
|
||||
注:推荐使用串口调试助手如:`MobaXterm`
|
||||
|
||||
```
|
||||
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.1.1 build Jul 25 2022 18:03:35
|
||||
@@ -93,7 +112,7 @@
|
||||
msh >
|
||||
```
|
||||
|
||||
## 联系人信息
|
||||
## 联系人
|
||||
|
||||
维护人:
|
||||
|
||||
|
||||
@@ -204,6 +204,11 @@ menu "On-chip Peripheral Drivers"
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_USBD
|
||||
bool "Enable USB Device"
|
||||
select RT_USING_USB_DEVICE
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_RTC
|
||||
bool "Enable RTC"
|
||||
select RT_USING_RTC
|
||||
@@ -242,7 +247,7 @@ menu "On-chip Peripheral Drivers"
|
||||
bool "Enable DAC2"
|
||||
default n
|
||||
endif
|
||||
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
@@ -255,8 +260,6 @@ menu "On-chip Peripheral Drivers"
|
||||
bool "Enable TIM2"
|
||||
default n
|
||||
endif
|
||||
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
@@ -30,11 +30,15 @@ startup_path_prefix = SDK_LIB
|
||||
if rtconfig.PLATFORM == 'gcc':
|
||||
src += [startup_path_prefix +
|
||||
'/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']:
|
||||
src += [startup_path_prefix +
|
||||
'/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)
|
||||
|
||||
Return('group')
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "drv_uart.h"
|
||||
|
||||
void cy_bsp_all_init(void)
|
||||
{
|
||||
|
||||
@@ -16,10 +16,16 @@
|
||||
#include "drv_common.h"
|
||||
#include "drv_gpio.h"
|
||||
|
||||
#include "cy_result.h"
|
||||
#include "cybsp_types.h"
|
||||
#include "cyhal.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*/
|
||||
#define IFX_FLASH_START_ADRESS ((uint32_t)0x10000000)
|
||||
@@ -40,6 +46,7 @@
|
||||
#ifdef __ARMCC_VERSION
|
||||
extern int Image$$RW_IRAM1$$ZI$$Limit;
|
||||
#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
|
||||
#define HEAP_END IFX_SRAM_END
|
||||
#elif __ICCARM__
|
||||
#pragma section="HEAP"
|
||||
#define HEAP_BEGIN (__segment_end("HEAP"))
|
||||
@@ -50,8 +57,6 @@
|
||||
#define HEAP_END (void*)&__HeapLimit
|
||||
#endif
|
||||
|
||||
#define HEAP_END IFX_SRAM_END
|
||||
|
||||
void cy_bsp_all_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,12 +172,41 @@ SECTIONS
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* Read-only code (constants). */
|
||||
*(.rodata .rodata.* .constdata .constdata.* .conststring .conststring.*)
|
||||
|
||||
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 :
|
||||
{
|
||||
@@ -213,70 +242,24 @@ SECTIONS
|
||||
|
||||
__copy_table_end__ = .;
|
||||
} > flash
|
||||
/* setction information for finsh shell begin */
|
||||
FSymTab :
|
||||
|
||||
. = ALIGN(4);
|
||||
.ctors :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__fsymtab_start = .;
|
||||
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__ = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__rt_init_end = .;
|
||||
PROVIDE(__ctors_end__ = .);
|
||||
} > flash
|
||||
init_array :
|
||||
|
||||
. = ALIGN(4);
|
||||
.dtors :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__ctors_start__ = .;
|
||||
KEEP(*(SORT(.init_array*)))
|
||||
__ctors_end__ = .;
|
||||
} > flash
|
||||
/* setction information for finsh shell end */
|
||||
PROVIDE(__dtors_start__ = .);
|
||||
KEEP(*(SORT(.dtors.*)))
|
||||
KEEP(*(.dtors))
|
||||
PROVIDE(__dtors_end__ = .);
|
||||
} > flash
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
@@ -422,7 +405,6 @@ SECTIONS
|
||||
KEEP(*(.cy_sflash_user_data))
|
||||
} > sflash_user_data
|
||||
|
||||
|
||||
/* Supervisory Flash: Normal Access Restrictions (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 |
@@ -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)
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -46,7 +46,7 @@
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart5"
|
||||
#define RT_VER_NUM 0x40101
|
||||
#define ARCH_ARM
|
||||
#define RT_USING_CPU_FFS
|
||||
@@ -72,12 +72,6 @@
|
||||
#define MSH_USING_BUILT_IN_COMMANDS
|
||||
#define FINSH_USING_DESCRIPTION
|
||||
#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 */
|
||||
|
||||
@@ -198,7 +192,7 @@
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_UART
|
||||
#define BSP_USING_UART1
|
||||
#define BSP_USING_UART5
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ if PLATFORM == 'gcc':
|
||||
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
|
||||
CFLAGS = DEVICE + ' -Dgcc'
|
||||
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 = ''
|
||||
LPATH = ''
|
||||
|
||||
@@ -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'))
|
||||
@@ -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)
|
||||
Reference in new issue
Block a user