-
Notifications
You must be signed in to change notification settings - Fork 11
Fix spi_drv & Add can_drv #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /****************************************************************************** | ||
| * Copyright 2020-2026 The RT-Thread Development Team. All Rights Reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| *****************************************************************************/ | ||
|
|
||
| #ifndef __CANFD_CONFIG_H__ | ||
| #define __CANFD_CONFIG_H__ | ||
|
|
||
| #include <rtthread.h> | ||
| #include "board.h" | ||
| #include "cy_canfd.h" | ||
| #include "cy_sysint.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #ifdef BSP_USING_CANFD0 | ||
| extern const cy_stc_canfd_config_t CYBSP_CAN_FD_CH_0_config; | ||
|
|
||
| static cy_stc_sysint_t CANFD0_IRQ_cfg = | ||
| { | ||
| .intrSrc = canfd_0_interrupts0_0_IRQn, | ||
| .intrPriority = 3u, | ||
| }; | ||
| #endif | ||
|
|
||
| #ifdef BSP_USING_CANFD1 | ||
| extern const cy_stc_canfd_config_t CANFD1_config; | ||
|
|
||
| static cy_stc_sysint_t CANFD1_IRQ_cfg = | ||
| { | ||
| .intrSrc = canfd_1_interrupts0_0_IRQn, | ||
| .intrPriority = 3u, | ||
| }; | ||
| #endif | ||
|
|
||
| /* CANFD0 */ | ||
| #if defined(BSP_USING_CANFD0) | ||
| #ifndef CANFD0_CONFIG | ||
| #define CANFD0_CONFIG \ | ||
| { \ | ||
| .name = "canfd0", \ | ||
| .base = CANFD0, \ | ||
| .channel = 0u, \ | ||
| .channel_mask = (1u << 0), \ | ||
| .mram_delay_us = 6u, \ | ||
| .irq = canfd_0_interrupts0_0_IRQn, \ | ||
| .irq_cfg = &CANFD0_IRQ_cfg, \ | ||
| .isr = RT_NULL, \ | ||
| .canfd_config = &CYBSP_CAN_FD_CH_0_config, \ | ||
| .test_mode = CY_CANFD_TEST_MODE_DISABLE, \ | ||
| .enable_brs = true, \ | ||
| .tx_buffer_index = 0u, \ | ||
| } | ||
| #endif | ||
| #endif /* BSP_USING_CANFD0 */ | ||
|
|
||
| /* CANFD1 */ | ||
| #if defined(BSP_USING_CANFD1) | ||
| #ifndef CANFD1_CONFIG | ||
| #define CANFD1_CONFIG \ | ||
| { \ | ||
| .name = "canfd1", \ | ||
| .base = CANFD1, \ | ||
| .channel = 0u, \ | ||
| .channel_mask = (1u << 0), \ | ||
| .mram_delay_us = 6u, \ | ||
| .irq = canfd_1_interrupts0_0_IRQn, \ | ||
| .irq_cfg = &CANFD1_IRQ_cfg, \ | ||
| .isr = RT_NULL, \ | ||
| .canfd_config = &CANFD1_config, \ | ||
| .test_mode = CY_CANFD_TEST_MODE_DISABLE, \ | ||
| .enable_brs = true, \ | ||
| .tx_buffer_index = 0u, \ | ||
| } | ||
| #endif | ||
| #endif /* BSP_USING_CANFD1 */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __CANFD_CONFIG_H__ */ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BSP_USING_CANFD1configuration references an externCANFD1_config, but there is no definition for it in the repo (onlyCYBSP_CAN_FD_CH_0_configis generated). Enabling CANFD1 will fail to link. Either generate/provide a CANFD1 config symbol or remove/guard the CANFD1 option/macros until the second instance is supported.