-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp/cvitek] new pinmux design #9188
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
Conversation
注意,这个 PR 包含了两个 commit,merge 时请务必保留两个 commit,不要压缩。设计为两个 commit 也是为了方便以后回溯。 |
fixed #8934 |
bsp/cvitek/drivers/drv_pinmux.c
Outdated
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.
这个文件缺少版权头吧?这个应该是源文件强制的。
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.
这个文件缺少版权头吧?这个应该是源文件强制的。
accept
bsp/cvitek/drivers/drv_pinmux.h
Outdated
/* | ||
* @whitelist: pin name whilelist which is allowed to set. Ignore check if NULL. | ||
* NOTE: whitelist should be a string list ended with NULL. | ||
* RETURN: | ||
* - RT_EOK | ||
* - else: something wrong occurred and config is abandoned. | ||
*/ |
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.
建议与 src 目录代码保持一致,使用 doxygen
语法注释 API。这样也可以自动生成文档。
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.
建议与 src 目录代码保持一致,使用
doxygen
语法注释 API。这样也可以自动生成文档。
accept
The contents of the SOC type part in the Kconfig configuration are retained, and other parts related to I2C pin multiplexing selection have been rolled back. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> Reviewed-by: Yuanjie He <943313837@qq.com> Reviewed-by: Shell <smokewood@qq.com>
In the new design, we require the user to manually enter the PinName (as a string) in menuconfig instead of being given menu items to select. The original method will lead to too many menu item-related macros being defined in the code, causing ifdef and other codes scatter everywhere in the driver code, which is inconvenient to maintain. The new design adds a pinmux driver module to manage the multiplexing of pins. This patch provides this driver module. P.S., the reason why users are allowed to specify pinname in a string instead of the pin number is mainly because the technical manual provided by the SOC manufacturer does not have numbers for some pins, only names. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> Reviewed-by: Yuanjie He <943313837@qq.com> Reviewed-by: Shell <smokewood@qq.com>
注意,这个 PR 包含了两个 commit,merge 时请务必保留两个 commit,不要压缩。设计为两个 commit 也是为了方便以后回溯。
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
原先的管脚复用配置机制设计不好,会导致我们在 Kconfig 中写大量 board 区分代码,导致 Kconfig 文件过大。现修改为新的配置方式。具体见 commit 的描述。
你的解决方案是什么 (what is your solution)
具体见 commit 的描述。
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up