Skip to content

Commit 6e9899a

Browse files
authored
[project][driver]Fix spi_drv & Add can_drv & Add IPC demo
1 parent ab43b01 commit 6e9899a

File tree

107 files changed

+19174
-8023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+19174
-8023
lines changed

.github/workflows/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
- {RTT_BSP: "Edgi_Talk_M33_Blink_LED"}
5858
- {RTT_BSP: "Edgi_Talk_CherryUSB/Edgi_Talk_M33_USB_D"}
5959
- {RTT_BSP: "Edgi_Talk_CherryUSB/Edgi_Talk_M33_USB_H"}
60+
- {RTT_BSP: "Edgi_Talk_IPC/Edgi_Talk_M33_IPC"}
61+
- {RTT_BSP: "Edgi_Talk_IPC/Edgi_Talk_M55_IPC"}
6062
- {RTT_BSP: "Edgi_Talk_M55_Blink_LED"}
6163
- {RTT_BSP: "Edgi_Talk_CherryUSB/Edgi_Talk_M55_USB_D"}
6264
- {RTT_BSP: "Edgi_Talk_CherryUSB/Edgi_Talk_M55_USB_H"}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ $ sdk-bsp-psoc_e84-edgi-talk
3333
│ │ ├── Edgi_Talk_M33_USB_H
3434
│ │ ├── Edgi_Talk_M55_USB_D
3535
│ │ └── Edgi_Talk_M55_USB_H
36+
│ ├── Edgi_Talk_IPC
37+
│ │ ├── Edgi_Talk_M33_IPC
38+
│ │ └── Edgi_Talk_M55_IPC
3639
│ ├── Edgi-Talk_CoreMark
3740
│ ├── Edgi-Talk_CDC_Echo
3841
│ ├── Edgi-Talk_HyperRam

README_zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ $ sdk-bsp-psoc_e84-edgi-talk
3333
│ │ ├── Edgi_Talk_M33_USB_H
3434
│ │ ├── Edgi_Talk_M55_USB_D
3535
│ │ └── Edgi_Talk_M55_USB_H
36+
│ ├── Edgi_Talk_IPC
37+
│ │ ├── Edgi_Talk_M33_IPC
38+
│ │ └── Edgi_Talk_M55_IPC
3639
│ ├── Edgi_Talk_CoreMark
3740
│ ├── Edgi_Talk_CDC_Echo
3841
│ ├── Edgi_Talk_HyperRam

libraries/HAL_Drivers/SConscript

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ if GetDepend(['RT_USING_DAC']):
6666
if GetDepend(['BSP_USING_TIM']):
6767
src += ['drv_hwtimer.c']
6868

69+
if GetDepend(['RT_USING_CAN']):
70+
src += ['drv_canfd.c']
71+
72+
if GetDepend(['BSP_USING_IPC']):
73+
src += ['drv_ipc.c']
74+
6975
path = [cwd]
7076
path += [cwd + '/config']
7177

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/******************************************************************************
2+
* Copyright 2020-2026 The RT-Thread Development Team. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*****************************************************************************/
16+
17+
#ifndef __CANFD_CONFIG_H__
18+
#define __CANFD_CONFIG_H__
19+
20+
#include <rtthread.h>
21+
#include "board.h"
22+
#include "cy_canfd.h"
23+
#include "cy_sysint.h"
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
#ifdef BSP_USING_CANFD0
30+
extern const cy_stc_canfd_config_t CYBSP_CAN_FD_CH_0_config;
31+
32+
static cy_stc_sysint_t CANFD0_IRQ_cfg =
33+
{
34+
.intrSrc = canfd_0_interrupts0_0_IRQn,
35+
.intrPriority = 3u,
36+
};
37+
#endif
38+
39+
#ifdef BSP_USING_CANFD1
40+
extern const cy_stc_canfd_config_t CANFD1_config;
41+
42+
static cy_stc_sysint_t CANFD1_IRQ_cfg =
43+
{
44+
.intrSrc = canfd_1_interrupts0_0_IRQn,
45+
.intrPriority = 3u,
46+
};
47+
#endif
48+
49+
/* CANFD0 */
50+
#if defined(BSP_USING_CANFD0)
51+
#ifndef CANFD0_CONFIG
52+
#define CANFD0_CONFIG \
53+
{ \
54+
.name = "canfd0", \
55+
.base = CANFD0, \
56+
.channel = 0u, \
57+
.channel_mask = (1u << 0), \
58+
.mram_delay_us = 6u, \
59+
.irq = canfd_0_interrupts0_0_IRQn, \
60+
.irq_cfg = &CANFD0_IRQ_cfg, \
61+
.isr = RT_NULL, \
62+
.canfd_config = &CYBSP_CAN_FD_CH_0_config, \
63+
.test_mode = CY_CANFD_TEST_MODE_DISABLE, \
64+
.enable_brs = true, \
65+
.tx_buffer_index = 0u, \
66+
}
67+
#endif
68+
#endif /* BSP_USING_CANFD0 */
69+
70+
/* CANFD1 */
71+
#if defined(BSP_USING_CANFD1)
72+
#ifndef CANFD1_CONFIG
73+
#define CANFD1_CONFIG \
74+
{ \
75+
.name = "canfd1", \
76+
.base = CANFD1, \
77+
.channel = 0u, \
78+
.channel_mask = (1u << 0), \
79+
.mram_delay_us = 6u, \
80+
.irq = canfd_1_interrupts0_0_IRQn, \
81+
.irq_cfg = &CANFD1_IRQ_cfg, \
82+
.isr = RT_NULL, \
83+
.canfd_config = &CANFD1_config, \
84+
.test_mode = CY_CANFD_TEST_MODE_DISABLE, \
85+
.enable_brs = true, \
86+
.tx_buffer_index = 0u, \
87+
}
88+
#endif
89+
#endif /* BSP_USING_CANFD1 */
90+
91+
#ifdef __cplusplus
92+
}
93+
#endif
94+
95+
#endif /* __CANFD_CONFIG_H__ */

0 commit comments

Comments
 (0)