Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
py_free-物联智能
rt-thread
提交
2ee400f6
R
rt-thread
项目概览
py_free-物联智能
/
rt-thread
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2ee400f6
编写于
7月 26, 2022
作者:
R
Rbb666
提交者:
guo
7月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add RTC device
上级
ac92106a
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
349 addition
and
368 deletion
+349
-368
bsp/cypress/libraries/HAL_Drivers/SConscript
bsp/cypress/libraries/HAL_Drivers/SConscript
+3
-0
bsp/cypress/libraries/HAL_Drivers/drv_rtc.c
bsp/cypress/libraries/HAL_Drivers/drv_rtc.c
+164
-0
bsp/cypress/libraries/HAL_Drivers/drv_rtc.h
bsp/cypress/libraries/HAL_Drivers/drv_rtc.h
+0
-0
bsp/cypress/libraries/HAL_Drivers/drv_uart.c
bsp/cypress/libraries/HAL_Drivers/drv_uart.c
+24
-9
bsp/cypress/libraries/HAL_Drivers/drv_uart.h
bsp/cypress/libraries/HAL_Drivers/drv_uart.h
+2
-0
bsp/cypress/libraries/IFX_PSOC6_HAL/SConscript
bsp/cypress/libraries/IFX_PSOC6_HAL/SConscript
+4
-0
bsp/cypress/libraries/IFX_PSOC6_HAL/mtb-hal-cat1/include/cyhal_rtc.h
.../libraries/IFX_PSOC6_HAL/mtb-hal-cat1/include/cyhal_rtc.h
+10
-42
bsp/cypress/libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_rtc.c
...s/libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_rtc.c
+80
-274
bsp/cypress/psoc6-cy8cproto-4343w/README.md
bsp/cypress/psoc6-cy8cproto-4343w/README.md
+45
-43
bsp/cypress/psoc6-cy8cproto-4343w/board/Kconfig
bsp/cypress/psoc6-cy8cproto-4343w/board/Kconfig
+17
-0
bsp/cypress/psoc6-cy8cproto-4343w/figures/mdk_package.png
bsp/cypress/psoc6-cy8cproto-4343w/figures/mdk_package.png
+0
-0
未找到文件。
bsp/cypress/libraries/HAL_Drivers/SConscript
浏览文件 @
2ee400f6
...
...
@@ -38,6 +38,9 @@ if GetDepend(['BSP_USING_SPI']):
if
GetDepend
([
'BSP_USING_ADC'
]):
src
+=
[
'drv_adc.c'
]
if
GetDepend
(
'BSP_USING_RTC'
):
src
+=
[
'drv_rtc.c'
]
if
GetDepend
([
'RT_USING_WDT'
]):
src
+=
[
'drv_wdt.c'
]
...
...
bsp/cypress/libraries/HAL_Drivers/drv_rtc.c
0 → 100644
浏览文件 @
2ee400f6
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-07-25 Rbb666 first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <sys/time.h>
#include "drv_common.h"
#ifdef BSP_USING_RTC
//#define DRV_DEBUG
#define LOG_TAG "drv.rtc"
#include <drv_log.h>
cyhal_rtc_t
rtc_obj
;
static
rt_rtc_dev_t
ifx32_rtc_dev
;
static
int
get_day_of_week
(
int
day
,
int
month
,
int
year
)
{
int
ret
;
int
k
=
0
;
int
j
=
0
;
if
(
month
<
CY_RTC_MARCH
)
{
month
+=
CY_RTC_MONTHS_PER_YEAR
;
year
--
;
}
k
=
(
year
%
100
);
j
=
(
year
/
100
);
ret
=
(
day
+
(
13
*
(
month
+
1
)
/
5
)
+
k
+
(
k
/
4
)
+
(
j
/
4
)
+
(
5
*
j
))
%
7
;
ret
=
((
ret
+
6
)
%
7
);
return
ret
;
}
static
rt_err_t
set_rtc_time_stamp
(
time_t
time_stamp
)
{
struct
tm
tm
=
{
0
};
struct
tm
new_time
=
{
0
};
gmtime_r
(
&
time_stamp
,
&
tm
);
if
(
tm
.
tm_year
<
100
)
{
return
-
RT_ERROR
;
}
new_time
.
tm_sec
=
tm
.
tm_sec
;
new_time
.
tm_min
=
tm
.
tm_min
;
new_time
.
tm_hour
=
tm
.
tm_hour
;
new_time
.
tm_mday
=
tm
.
tm_mday
;
new_time
.
tm_mon
=
tm
.
tm_mon
;
new_time
.
tm_year
=
tm
.
tm_year
;
new_time
.
tm_wday
=
get_day_of_week
(
tm
.
tm_mday
,
tm
.
tm_mon
,
tm
.
tm_year
);
if
(
cyhal_rtc_write
(
&
rtc_obj
,
&
new_time
)
!=
RT_EOK
)
{
return
-
RT_ERROR
;
}
LOG_D
(
"set rtc time."
);
return
RT_EOK
;
}
static
rt_err_t
ifx_rtc_get_timeval
(
struct
timeval
*
tv
)
{
struct
tm
tm_new
=
{
0
};
struct
tm
date_time
=
{
0
};
cyhal_rtc_read
(
&
rtc_obj
,
&
date_time
);
tm_new
.
tm_sec
=
date_time
.
tm_sec
;
tm_new
.
tm_min
=
date_time
.
tm_min
;
tm_new
.
tm_hour
=
date_time
.
tm_hour
;
tm_new
.
tm_mday
=
date_time
.
tm_mday
;
tm_new
.
tm_mon
=
date_time
.
tm_mon
;
tm_new
.
tm_year
=
date_time
.
tm_year
;
tv
->
tv_sec
=
timegm
(
&
tm_new
);
return
RT_EOK
;
}
static
rt_err_t
_rtc_init
(
void
)
{
if
(
cyhal_rtc_init
(
&
rtc_obj
)
!=
RT_EOK
)
{
LOG_E
(
"rtc init failed."
);
return
-
RT_ERROR
;
}
return
RT_EOK
;
}
static
rt_err_t
_rtc_get_secs
(
time_t
*
sec
)
{
struct
timeval
tv
;
ifx_rtc_get_timeval
(
&
tv
);
*
(
time_t
*
)
sec
=
tv
.
tv_sec
;
LOG_D
(
"RTC: get rtc_time %d"
,
*
sec
);
return
RT_EOK
;
}
static
rt_err_t
_rtc_set_secs
(
time_t
*
sec
)
{
rt_err_t
result
=
RT_EOK
;
if
(
set_rtc_time_stamp
(
*
sec
))
{
result
=
-
RT_ERROR
;
}
LOG_D
(
"RTC: set rtc_time %d"
,
*
sec
);
return
result
;
}
static
const
struct
rt_rtc_ops
_rtc_ops
=
{
_rtc_init
,
_rtc_get_secs
,
_rtc_set_secs
,
RT_NULL
,
RT_NULL
,
ifx_rtc_get_timeval
,
RT_NULL
,
};
/**
* @brief RTC initialization function.
*
* @return RT_EOK indicates successful initialization, other value indicates failed;
*/
static
int
rt_hw_rtc_init
(
void
)
{
rt_err_t
result
=
RT_EOK
;
ifx32_rtc_dev
.
ops
=
&
_rtc_ops
;
if
(
rt_hw_rtc_register
(
&
ifx32_rtc_dev
,
"rtc"
,
RT_DEVICE_FLAG_RDWR
,
RT_NULL
)
!=
RT_EOK
)
{
LOG_E
(
"rtc init failed"
);
result
=
RT_ERROR
;
}
else
{
LOG_D
(
"rtc init success"
);
}
return
result
;
}
INIT_DEVICE_EXPORT
(
rt_hw_rtc_init
);
#endif
bsp/cypress/libraries/HAL_Drivers/drv_rtc.h
0 → 100644
浏览文件 @
2ee400f6
bsp/cypress/libraries/HAL_Drivers/drv_uart.c
浏览文件 @
2ee400f6
...
...
@@ -67,7 +67,6 @@ static void uart_isr(struct rt_serial_device *serial)
struct
ifx_uart
*
uart
=
(
struct
ifx_uart
*
)
serial
->
parent
.
user_data
;
RT_ASSERT
(
uart
!=
RT_NULL
);
#ifdef BSP_USING_UART5
if
((
uart
->
config
->
usart_x
->
INTR_RX_MASKED
&
SCB_INTR_RX_MASKED_NOT_EMPTY_Msk
)
!=
0
)
{
/* Clear UART "RX fifo not empty interrupt" */
...
...
@@ -75,7 +74,6 @@ static void uart_isr(struct rt_serial_device *serial)
rt_hw_serial_isr
(
serial
,
RT_SERIAL_EVENT_RX_IND
);
}
#endif
}
#ifdef BSP_USING_UART0
...
...
@@ -162,16 +160,28 @@ void uart5_isr_callback(void)
*/
static
rt_err_t
ifx_configure
(
struct
rt_serial_device
*
serial
,
struct
serial_configure
*
cfg
)
{
struct
ifx_uart
*
uart
=
(
struct
ifx_uart
*
)
serial
->
parent
.
user_data
;
RT_ASSERT
(
serial
!=
RT_NULL
);
struct
ifx_uart
*
uart
=
(
struct
ifx_uart
*
)
serial
->
parent
.
user_data
;
RT_ASSERT
(
uart
!=
RT_NULL
);
cy_en_scb_uart_status_t
result
;
const
cyhal_uart_cfg_t
uart_config
=
{
.
data_bits
=
8
,
.
stop_bits
=
1
,
.
parity
=
CYHAL_UART_PARITY_NONE
,
.
rx_buffer
=
NULL
,
.
rx_buffer_size
=
0
};
/* Initialize retarget-io to use the debug UART port */
result
=
cy_retarget_io_init
(
uart
->
config
->
tx_pin
,
uart
->
config
->
rx_pin
,
CY_RETARGET_IO_BAUDRATE
);
result
=
cyhal_uart_init
(
uart
->
config
->
uart_obj
,
uart
->
config
->
tx_pin
,
uart
->
config
->
rx_pin
,
NC
,
NC
,
NULL
,
&
uart_config
);
if
(
result
==
CY_RSLT_SUCCESS
)
{
result
=
cyhal_uart_set_baud
(
uart
->
config
->
uart_obj
,
cfg
->
baud_rate
,
NULL
);
}
RT_ASSERT
(
result
!=
RT_ERROR
);
...
...
@@ -229,10 +239,13 @@ static int ifx_uarths_getc(struct rt_serial_device *serial)
{
int
ch
;
rt_uint8_t
read_data
;
RT_ASSERT
(
serial
!=
RT_NULL
);
struct
ifx_uart
*
uart
=
(
struct
ifx_uart
*
)
serial
->
parent
.
user_data
;
RT_ASSERT
(
uart
!=
RT_NULL
);
ch
=
-
1
;
if
(
RT_EOK
==
cyhal_uart_getc
(
&
cy_retarget_io_
uart_obj
,
(
uint8_t
*
)
&
read_data
,
1
))
if
(
RT_EOK
==
cyhal_uart_getc
(
uart
->
config
->
uart_obj
,
(
uint8_t
*
)
&
read_data
,
1
))
{
ch
=
read_data
&
0xff
;
}
...
...
@@ -258,15 +271,17 @@ void rt_hw_uart_init(void)
int
index
;
rt_size_t
obj_num
=
sizeof
(
uart_obj
)
/
sizeof
(
struct
ifx_uart
);
struct
serial_configure
config
=
RT_SERIAL_CONFIG_DEFAULT
;
struct
serial_configure
serial_
config
=
RT_SERIAL_CONFIG_DEFAULT
;
rt_err_t
result
=
0
;
for
(
index
=
0
;
index
<
obj_num
;
index
++
)
{
uart_obj
[
index
].
config
=
&
uart_config
[
index
];
uart_obj
[
index
].
serial
.
ops
=
&
_uart_ops
;
uart_obj
[
index
].
serial
.
config
=
config
;
uart_obj
[
index
].
serial
.
config
=
serial_
config
;
uart_obj
[
index
].
config
->
uart_obj
=
rt_malloc
(
sizeof
(
cyhal_uart_t
));
RT_ASSERT
(
uart_obj
[
index
].
config
->
uart_obj
!=
RT_NULL
);
/* register uart device */
result
=
rt_hw_serial_register
(
&
uart_obj
[
index
].
serial
,
uart_obj
[
index
].
config
->
name
,
...
...
bsp/cypress/libraries/HAL_Drivers/drv_uart.h
浏览文件 @
2ee400f6
...
...
@@ -21,6 +21,8 @@
struct
ifx_uart_config
{
cyhal_uart_t
*
uart_obj
;
const
char
*
name
;
rt_uint32_t
tx_pin
;
rt_uint32_t
rx_pin
;
...
...
bsp/cypress/libraries/IFX_PSOC6_HAL/SConscript
浏览文件 @
2ee400f6
...
...
@@ -95,6 +95,10 @@ if GetDepend(['RT_USING_SPI']):
if
GetDepend
([
'RT_USING_I2C'
]):
src
+=
[
'mtb-hal-cat1/source/cyhal_i2c.c'
]
if
GetDepend
(
'BSP_USING_RTC'
):
src
+=
[
'mtb-pdl-cat1/drivers/source/cy_rtc.c'
]
src
+=
[
'mtb-hal-cat1/source/cyhal_rtc.c'
]
if
GetDepend
([
'RT_USING_WDT'
]):
src
+=
[
'mtb-pdl-cat1/drivers/source/cy_wdt.c'
]
src
+=
[
'mtb-hal-cat1/source/cyhal_wdt.c'
]
...
...
bsp/cypress/libraries/IFX_PSOC6_HAL/mtb-hal-cat1/include/cyhal_rtc.h
浏览文件 @
2ee400f6
...
...
@@ -9,9 +9,7 @@
*
********************************************************************************
* \copyright
* Copyright 2018-2021 Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation
*
* Copyright 2018-2021 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -72,6 +70,12 @@
extern
"C"
{
#endif
/** \cond INTERNAL */
/** Generate a result code specific to the HAL driver */
#define CYHAL_RSLT_CREATE(type, driver, code) \
(CY_RSLT_CREATE(type, CY_RSLT_MODULE_ABSTRACTION_HAL, ((uint16_t)driver | (uint16_t)code)))
/** \endcond */
/** \addtogroup group_hal_results_rtc RTC HAL Results
* RTC specific return codes
* \ingroup group_hal_results
...
...
@@ -80,10 +84,10 @@ extern "C" {
/** RTC not initialized */
#define CY_RSLT_RTC_NOT_INITIALIZED \
(CY
_RSLT_CREATE_EX(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_HAL
, CYHAL_RSLT_MODULE_RTC, 0))
(CY
HAL_RSLT_CREATE(CY_RSLT_TYPE_ERROR
, CYHAL_RSLT_MODULE_RTC, 0))
/** Bad argument */
#define CY_RSLT_RTC_BAD_ARGUMENT \
(CY
_RSLT_CREATE_EX(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_HAL
, CYHAL_RSLT_MODULE_RTC, 1))
(CY
HAL_RSLT_CREATE(CY_RSLT_TYPE_ERROR
, CYHAL_RSLT_MODULE_RTC, 1))
/**
* \}
...
...
@@ -145,23 +149,6 @@ typedef struct
typedef
void
(
*
cyhal_rtc_event_callback_t
)(
void
*
callback_arg
,
cyhal_rtc_event_t
event
);
/** Initialize the RTC peripheral
*
* Power up the RTC in preparation for access. This function must be called
* before any other RTC functions are called. This does not change the state
* of the RTC. It just enables access to it.
* @note Before calling this, make sure all necessary System Clocks are setup
* correctly. Generally this means making sure the RTC has access to a crystal
* oscillator for optimal accuracy and operation in low power.
* @note Previously set time configurations are retained. This will only reset
* the time if no prior configuration can be determined.
*
* @param[out] obj Pointer to an RTC object. The caller must allocate the memory
* for this object but the init function will initialize its contents.
* @return The status of the init request
*/
cy_rslt_t
cyhal_rtc_init
(
cyhal_rtc_t
*
obj
);
/** Initialize the RTC peripheral using a configurator generated configuration struct
*
* Power up the RTC in preparation for access. This function must be called
* before any other RTC functions are called. This does not change the state
...
...
@@ -174,10 +161,9 @@ cy_rslt_t cyhal_rtc_init(cyhal_rtc_t *obj);
*
* @param[out] obj Pointer to an RTC object. The caller must allocate the memory
* for this object but the init function will initialize its contents.
* @param[in] cfg Configuration structure generated by a configurator.
* @return The status of the init request
*/
cy_rslt_t
cyhal_rtc_init
_cfg
(
cyhal_rtc_t
*
obj
,
const
cyhal_rtc_configurator_t
*
cfg
);
cy_rslt_t
cyhal_rtc_init
(
cyhal_rtc_t
*
obj
);
/** Deinitialize RTC
*
...
...
@@ -213,25 +199,7 @@ cy_rslt_t cyhal_rtc_read(cyhal_rtc_t *obj, struct tm *time);
*/
cy_rslt_t
cyhal_rtc_write
(
cyhal_rtc_t
*
obj
,
const
struct
tm
*
time
);
/** Write the specified time and date values to the RTC peripheral
* @param[in] obj RTC object
* @param[in] sec Second to set (0-59)
* @param[in] min Minute to set (0-59)
* @param[in] hour Hour to set (0-23)
* @param[in] day Day of month to set (1-31)
* @param[in] month Month to set (1-12)
* @param[in] year 4-digit year to set
* @return The status of the write request
*/
cy_rslt_t
cyhal_rtc_write_direct
(
cyhal_rtc_t
*
obj
,
uint32_t
sec
,
uint32_t
min
,
uint32_t
hour
,
uint32_t
day
,
uint32_t
month
,
uint32_t
year
);
/** Set the start and end time for Day Light Savings
*
* Calling this function will allow alarms to account for daylight saving time.
* This means that the RTC will be adjusted when a daylight saving time
* transition occurs, meaning times passed to \ref cyhal_rtc_set_alarm()
* will be interpreted as being in DST/not in DST as appropriate.
*
* @param[in] obj RTC object
* @param[in] start When Day Light Savings time should start
...
...
bsp/cypress/libraries/IFX_PSOC6_HAL/mtb-hal-cat1/source/cyhal_rtc.c
浏览文件 @
2ee400f6
此差异已折叠。
点击以展开。
bsp/cypress/psoc6-cy8cproto-4343w/README.md
浏览文件 @
2ee400f6
# Cypress
CY8CKIT-062-BLE PSoC 6 BLE Pioneer Kit
说明
# Cypress
Psoc6-CY8CKIT-062S2-43012
说明
## 简介
本文档为
Cypress为PSoC6 BLE Pioneer Kit
开发板提供的 BSP (板级支持包) 说明。
本文档为
`RT-Thread`
为
`PSoC6 CY8CKIT-062S2-43012`
开发板提供的 BSP (板级支持包) 说明。
主要内容如下:
...
...
@@ -10,89 +10,91 @@
-
BSP 快速上手
-
进阶使用方法
通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用
RT-Thread
驱动更多板载资源。
通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用
`RT-Thread`
驱动更多板载资源。
## 开发板介绍
CY8CKIT-062-BLE PSoC6 BLE Pioneer Kit 是赛普拉斯推出的一款32位双核CPU子系统( ARM Cortex-M4 和 ARM Cortex-M0)的开发板,具有单周期乘法的150-MHz Arm Cortex-M4F CPU (浮点和
存储器保护单元),100-MHz Cortex M0+ CPU,带单周期乘法和MPU,可以充分发挥 PSoC6 双核芯片性能。
`PSoC6 CY8CKIT-062S2-43012`
是赛普拉斯推出的一款32位双核CPU子系统( ARM Cortex-M4 和 ARM Cortex-M0)的开发板,具有单周期乘法的150-MHz Arm Cortex-M4F CPU (浮点和存储器保护单元),100-MHz Cortex M0+ CPU,带单周期乘法和MPU,可以充分发挥 PSoC6 双核芯片性能。
开发板外观详细信息:
https://www.cypress.com/file/390496/download
开发板外观详细信息:
[
CY8CPROTO-062-4343W - Infineon Technologies
](
https://www.infineon.com/cms/en/product/evaluation-boards/cy8cproto-062-4343w/
)
该开发板核心
**板载资源**
如下:
该开发板常用
**板载资源**
如下:
-
MCU:CY8C6347BZI-BLD53,Cortex-M4主频 150MHz,Cortex-M0主频 100MHz,1 MB 应用闪存,32 KB EEPROM 区域和32 KB 安全闪存 ,288 KB 集成SRAM
MCU手册更多详细信息请参考文档 https://www.cypress.com/file/457541/download
-
开发环境:ModusToolbox 2.0
PSoC® Creator™ 下载链接 https://www.cypress.com/products/modustoolbox-software-environment
-
MCU:CY8C624ABZI-S2D44,Cortex-M4主频 150MHz,Cortex-M0主频 100MHz,2MB Flash 和 1MB SRAM
MCU手册更多详细信息请参考文档
[
PSoC 6 MCU: CY8C62x8, CY8C62xA Datasheet (infineon.com)
](
https://www.infineon.com/dgdl/Infineon-PSOC_6_MCU_CY8C62X8_CY8C62XA-DataSheet-v17_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ee7d03a70b1
)
-
板载资源:microSD card , 64-Mb Quad-SPI NOR flash, CYW43012 Wi-Fi + Bluetooth Combo Chip
-
开发环境:ModusToolbox 2.0/MDK V5
PSoC® Creator™ 下载链接
[
ModusToolbox™ Software - Infineon Technologies
](
https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software/
)
-
开发板:CY8CKIT-062-BLE PSoC 6 BLE Pioneer Kit
开发板更多详细信息请参考文档 https://www.cypress.com/file/390496/download
## 外设支持
本 BSP 目前对外设的支持情况详细信息请参考文档 https://www.cypress.com/file/390496/download
本 BSP 目前对外设的支持情况如下:
|
**片上外设**
|
**支持情况**
|
**备注**
|
| :----------: | :----------: | :-----------: |
| USB 转串口 | 支持 | — |
| GPIO | 支持 | — |
| UART | 支持 | UART0-5 |
| I2C | 支持 | 软件+硬件 I2C |
| RTC | 支持 | — |
| WDT | 支持 | — |
| PWM | 支持 | — |
| SPI | 支持 | — |
| HardTimer | 暂不支持 | — |
| DAC | 暂不支持 | — |
| Flash | 暂不支持 | — |
| SDIO | 暂不支持 | — |
| USB Device | 暂不支持 | — |
| USB Host | 暂不支持 | — |
## 使用说明
使用说明分为如下两个章节:
-
快速上手
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
-
进阶使用
本章节是为需要在 RT-Thread 操作系统上使用赛普拉斯开发板资源的开发者准备的。
### 快速上手
本 BSP
以 ModusToolbox 2.0开发环境(GCC),
介绍如何将系统运行起来。
本 BSP
是以 MDK V5 开发环境(编译器:ARMClang ),接下来
介绍如何将系统运行起来。
#### 硬件连接
使用
Type-C数据线连接开发板到 PC.
使用
数据线连接开发板到 PC。
#### 编译下载
1, 安装ModusToolbox 2.0时请使用默认路径
2, 打开ModusToolbox 2.0时workspace选择工程所在目录下(例如workspace: C:
\G
it
\r
t-thread
\b
sp
\c
ypress)
1、配置工程:
3, 在Project Explorer的空白处右键,点击import,General->Existing Projects into Workspace ->next,点击Browse选择
此BSP所在目录加载工程->Finish
首先打开 MDK ,若没有安装
`Cypress-PSoC6`
的芯片支持包会提示在线安装,根据提示安装即可。若受网络问题,可以进入
[
keil
](
https://www.keil.com/dd2/pack
)
官网下载安装包,离线安装。
4, 下载lib:在左下角Quick Panel的Tools栏,点击library Manager-> BSPs下面勾选CY8CKIT-062-BLE (若已勾选可以不用再选)
-> Libraries里PSoC6 Base Libraries下面全部勾选core-lib,psoc6cm0p,psoc6hal,psoc6make,psoc6pdl -> 点击apply 进行下载
![
mdk_package
](
./figures/mdk_package.png
)
5, 编译此工程
2、 编译此工程:在安装好芯片支持包后,在
`MDK`
工程中进行编译。
6, 下载此工程
3、下载此工程:
工程默认配置使用
SWD方式下载程序,Type-C
数据线连接开发板,编译之后直接点击下载按钮即可。
工程默认配置使用
板载
`DAP-LINK`
使用
`SWD`
方式下载程序,使用
数据线连接开发板,编译之后直接点击下载按钮即可。
#### 运行结果
下载程序成功之后,系统会自动运行。打开终端工具串口
小助手,复位设备后,可以看到 RT-Thread 的输出信息:
下载程序成功之后,系统会自动运行。打开终端工具串口
助手,选择波特率为 115200。复位设备后,LED 将会以 500HZ 的频率闪烁,而且在终端上可以看到
`RT-Thread`
的输出信息:
注:推荐使用串口调试助手如:
sscom
注:推荐使用串口调试助手如:
`MobaXterm`
```
\ | /
- RT - Thread Operating System
/ | \ 4.0.3 build Jan 6 2020
2006 - 2019 Copyright by rt-thread team
hello rt-thread
msh >hello rt-thread
hello rt-thread
```
/ | \ 4.1.1 build Jul 25 2022 18:03:35
2006 - 2022 Copyright by RT-Thread team
msh >
```
## 联系人信息
维护人:
-
[
amyqian379
](
https://github.com/amyqian379
)
\ No newline at end of file
-
[
Rbb666
](
https://github.com/Rbb666
)
\ No newline at end of file
bsp/cypress/psoc6-cy8cproto-4343w/board/Kconfig
浏览文件 @
2ee400f6
...
...
@@ -196,6 +196,23 @@ menu "On-chip Peripheral Drivers"
endif
endif
menuconfig BSP_USING_RTC
bool "Enable RTC"
select RT_USING_RTC
default n
if BSP_USING_RTC
choice
prompt "Select clock source"
default BSP_RTC_USING_LSE
config BSP_RTC_USING_LSE
bool "RTC USING LSE"
config BSP_RTC_USING_LSI
bool "RTC USING LSI"
endchoice
endif
config BSP_USING_WDT
bool "Enable Watchdog Timer"
select RT_USING_WDT
...
...
bsp/cypress/psoc6-cy8cproto-4343w/figures/mdk_package.png
0 → 100644
浏览文件 @
2ee400f6
50.9 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录