-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp][Infineon]修复psoc6-evaluationkit-062S2调用rt_adc_disable()时报错的问题 #10329
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
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
62 changes: 62 additions & 0 deletions
62
bsp/Infineon/libraries/HAL_Drivers/config/cy8c62/adc_config.h
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,62 @@ | ||
| /* | ||
| * Copyright (c) 2006-2025, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-05-28 RTT the first version | ||
| */ | ||
| #ifndef __ADC_CONFIG_H__ | ||
| #define __ADC_CONFIG_H__ | ||
|
|
||
| #include <rtthread.h> | ||
| #include <rtdevice.h> | ||
| #include "drv_common.h" | ||
| #include "cyhal.h" | ||
| #include "cybsp.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #if defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) | ||
|
|
||
| cyhal_adc_t adc_obj; | ||
| cyhal_adc_channel_t adc_chan_obj; | ||
|
|
||
| const cyhal_adc_config_t adc_config = { | ||
| .continuous_scanning = false, // Continuous Scanning is disabled | ||
| .average_count = 1, // Average count disabled | ||
| .vref = CYHAL_ADC_REF_VDDA, // VREF for Single ended channel set to VDDA | ||
| .vneg = CYHAL_ADC_VNEG_VSSA, // VNEG for Single ended channel set to VSSA | ||
| .resolution = 12u, // 12-bit resolution | ||
| .ext_vref = NC, // No connection | ||
| .bypass_pin = NC // No connection | ||
| }; | ||
|
|
||
| struct ifx_adc | ||
| { | ||
| struct rt_adc_device ifx_adc_device; | ||
| cyhal_adc_channel_t *adc_ch; | ||
| char *name; | ||
| }; | ||
|
|
||
| const cyhal_gpio_t adc_gpio[6] = {P10_0, P10_1, P10_2, P10_3, P10_4, P10_5}; | ||
|
|
||
| #ifndef ADC1_CONFIG | ||
| #define ADC1_CONFIG \ | ||
| { \ | ||
| .adc_ch = &adc_chan_obj, \ | ||
| .name = "adc1", \ | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __ADC_CONFIG_H__ */ |
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,49 @@ | ||
| /* | ||
| * Copyright (c) 2006-2025, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-05-28 RTT the first version | ||
| */ | ||
| #ifndef __DRV_CONFIG_H__ | ||
| #define __DRV_CONFIG_H__ | ||
|
|
||
| #include "board.h" | ||
| #include <rtthread.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #if defined(SOC_CY8C624ALQI_S2D42) || defined(SOC_CY8C6347BZI_BLD53) || defined(SOC_CY8C6247BZI_D54) || defined(SOC_CY8C6244LQI_S4D92) | ||
|
|
||
| #ifdef BSP_USING_ADC | ||
| #include "cy8c62/adc_config.h" | ||
| #endif | ||
|
|
||
| #endif /* SOC_CY8C624ALQI_S2D42 */ | ||
|
|
||
| #if defined(SOC_XMC7100D_F144K4160AA) | ||
|
|
||
| #ifdef BSP_USING_ADC | ||
| #include "xmc7100/adc_config.h" | ||
| #endif | ||
|
|
||
| #endif /* SOC_XMC7100D_F144K4160AA */ | ||
|
|
||
| #if defined(SOC_XMC7200D_E272K8384AA) | ||
|
|
||
| #ifdef BSP_USING_ADC | ||
| #include "xmc7200/adc_config.h" | ||
| #endif | ||
|
|
||
| #endif /* SOC_XMC7200D_E272K8384AA */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __DRV_CONFIG_H__ */ |
62 changes: 62 additions & 0 deletions
62
bsp/Infineon/libraries/HAL_Drivers/config/xmc7100/adc_config.h
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,62 @@ | ||
| /* | ||
| * Copyright (c) 2006-2025, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-05-28 RTT the first version | ||
| */ | ||
| #ifndef __ADC_CONFIG_H__ | ||
| #define __ADC_CONFIG_H__ | ||
|
|
||
| #include <rtthread.h> | ||
| #include <rtdevice.h> | ||
| #include "drv_common.h" | ||
| #include "cyhal.h" | ||
| #include "cybsp.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #if defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) | ||
|
|
||
| cyhal_adc_t adc_obj; | ||
| cyhal_adc_channel_t adc_chan_obj; | ||
|
|
||
| const cyhal_adc_config_t adc_config = { | ||
| .continuous_scanning = false, // Continuous Scanning is disabled | ||
| .average_count = 1, // Average count disabled | ||
| .vref = CYHAL_ADC_REF_VDDA, // VREF for Single ended channel set to VDDA | ||
| .vneg = CYHAL_ADC_VNEG_VSSA, // VNEG for Single ended channel set to VSSA | ||
| .resolution = 12u, // 12-bit resolution | ||
| .ext_vref = NC, // No connection | ||
| .bypass_pin = NC // No connection | ||
| }; | ||
|
|
||
| struct ifx_adc | ||
| { | ||
| struct rt_adc_device ifx_adc_device; | ||
| cyhal_adc_channel_t *adc_ch; | ||
| char *name; | ||
| }; | ||
|
|
||
| const cyhal_gpio_t adc_gpio[8] = {P6_0, P11_0, P11_1, P11_2, P12_4, P13_7, P14_2, P14_3}; | ||
|
|
||
| #ifndef ADC1_CONFIG | ||
| #define ADC1_CONFIG \ | ||
| { \ | ||
| .adc_ch = &adc_chan_obj, \ | ||
| .name = "adc1", \ | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __ADC_CONFIG_H__ */ |
62 changes: 62 additions & 0 deletions
62
bsp/Infineon/libraries/HAL_Drivers/config/xmc7200/adc_config.h
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,62 @@ | ||
| /* | ||
| * Copyright (c) 2006-2025, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-05-28 RTT the first version | ||
| */ | ||
| #ifndef __ADC_CONFIG_H__ | ||
| #define __ADC_CONFIG_H__ | ||
|
|
||
| #include <rtthread.h> | ||
| #include <rtdevice.h> | ||
| #include "drv_common.h" | ||
| #include "cyhal.h" | ||
| #include "cybsp.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #if defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) | ||
|
|
||
| cyhal_adc_t adc_obj; | ||
| cyhal_adc_channel_t adc_chan_obj; | ||
|
|
||
| const cyhal_adc_config_t adc_config = { | ||
| .continuous_scanning = false, // Continuous Scanning is disabled | ||
| .average_count = 1, // Average count disabled | ||
| .vref = CYHAL_ADC_REF_VDDA, // VREF for Single ended channel set to VDDA | ||
| .vneg = CYHAL_ADC_VNEG_VSSA, // VNEG for Single ended channel set to VSSA | ||
| .resolution = 12u, // 12-bit resolution | ||
| .ext_vref = NC, // No connection | ||
| .bypass_pin = NC // No connection | ||
| }; | ||
|
|
||
| struct ifx_adc | ||
| { | ||
| struct rt_adc_device ifx_adc_device; | ||
| cyhal_adc_channel_t *adc_ch; | ||
| char *name; | ||
| }; | ||
|
|
||
| const cyhal_gpio_t adc_gpio[8] = {P14_0, P14_1, P14_2, P14_3, P14_4, P14_5, P14_6, P14_7}; | ||
|
|
||
| #ifndef ADC1_CONFIG | ||
| #define ADC1_CONFIG \ | ||
| { \ | ||
| .adc_ch = &adc_chan_obj, \ | ||
| .name = "adc1", \ | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* __ADC_CONFIG_H__ */ | ||
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
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.
这几个IO在psoc6平台上都是通用的吗?
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.
SOC_CY8C624ALQI_S2D42, SOC_CY8C6347BZI_BLD53, SOC_CY8C6247BZI_D54, SOC_CY8C6244LQI_S4D92这几个芯片的ADC引脚是一样的