[components][pin.c]add rt_pin_get#3863
Closed
yangjie11 wants to merge 7 commits into
Closed
Conversation
armink
reviewed
Aug 31, 2020
| rt_err_t (*pin_detach_irq)(struct rt_device *device, rt_int32_t pin); | ||
| rt_err_t (*pin_irq_enable)(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled); | ||
|
|
||
| rt_base_t (*pin_get)(char *name); |
Member
|
这样修改,需要连带着所有BSP都确认,并完成连带的修改 |
Contributor
Author
|
好的,我确认了所有的BSP,drv_gpio驱动中的rt_pin_ops实例均是static类型,在初始化的时候会自动初始化为0,驱动可以不用做修改 。但有一个BSP例外,我commit上来。 |
Member
|
涉及到 rt_pin_ops 的bsp包括: allwinner_tina/drivers/drv_gpio.c:533:static const struct rt_pin_ops ops =
apollo2/board/gpio.c:207:const static struct rt_pin_ops am_pin_ops =
at32/Libraries/rt_drivers/drv_gpio.c:491:const static struct rt_pin_ops _at32_pin_ops =
beaglebone/drivers/gpio.c:82:static struct rt_pin_ops am33xx_pin_ops =
essemi/es32f0334/drivers/drv_gpio.c:403:const static struct rt_pin_ops _es32f0_pin_ops =
essemi/es32f369x/drivers/drv_gpio.c:403:const static struct rt_pin_ops _es32f3_pin_ops =
essemi/es32f0271/drivers/drv_gpio.c:445:const static struct rt_pin_ops _es32f0_pin_ops =
essemi/es8p508x/drivers/drv_gpio.c:377:const static struct rt_pin_ops _es8p_pin_ops =
essemi/es32f0654/drivers/drv_gpio.c:403:const static struct rt_pin_ops _es32f0_pin_ops =
gd32303e-eval/drivers/drv_gpio.c:492:const static struct rt_pin_ops _gd32_pin_ops =
gd32e230k-start/drivers/drv_gpio.c:383:const static struct rt_pin_ops _gd32_pin_ops =
gd32vf103v-eval/drivers/drv_gpio.c:422:const static struct rt_pin_ops _gd32vf_pin_ops =
imxrt/libraries/drivers/drv_gpio.c:583:const static struct rt_pin_ops imxrt_pin_ops =
imxrt/libraries/drivers/drv_gpio.c:597: ret = rt_device_pin_register("pin", &imxrt_pin_ops, RT_NULL);
k210/driver/drv_gpio.c:246:const static struct rt_pin_ops drv_pin_ops =
lpc54114-lite/drivers/drv_gpio.c:284:const static struct rt_pin_ops _lpc_pin_ops =
lpc55sxx/Libraries/drivers/drv_pin.c:47:static struct rt_pin_ops lpc_pin_ops;
ls1cdev/drivers/drv_gpio.c:117:const static struct rt_pin_ops _ls1c_pin_ops =
ls2kdev/drivers/drv_gpio.c:215:static struct rt_pin_ops loongson_pin_ops = {
mm32l3xx/drivers/drv_gpio.c:404:const static struct rt_pin_ops _mm32_pin_ops =
nrf5x/libraries/drivers/drv_gpio.c:348:const static struct rt_pin_ops _nrf5x_pin_ops =
nuclei/libraries/gd32vf103/HAL_Drivers/drv_gpio.c:438:const static struct rt_pin_ops _gd32_pin_ops =
nuvoton/libraries/m480/rtt_port/drv_gpio.c:40:static struct rt_pin_ops nu_gpio_ops =
raspberry-pi/raspi3-64/driver/drv_gpio.c:290:static const struct rt_pin_ops ops =
raspberry-pi/raspi4-64/driver/drv_gpio.c:98:static const struct rt_pin_ops ops =
raspberry-pi/raspi3-32/driver/drv_gpio.c:289:static const struct rt_pin_ops ops =
raspberry-pi/raspi4-32/driver/drv_gpio.c:339:static const struct rt_pin_ops ops =
rv32m1_vega/ri5cy/driver/drv_gpio.c:491:static const struct rt_pin_ops vega_pin_ops =
stm32/libraries/HAL_Drivers/drv_gpio.c:641:const static struct rt_pin_ops _stm32_pin_ops =
swm320-lq100/drivers/drv_gpio.c:330:const static struct rt_pin_ops swm320_pin_ops =
tm4c123bsp/libraries/Drivers/drv_gpio.c:148:const static struct rt_pin_ops _tm4c123_pin_ops =
w60x/drivers/drv_pin.c:149:struct rt_pin_ops _wm_pin_ops =请完成相关bsp修改。 |
Member
@BernardXiong 意思是要把所有的 rt_pin_ops 都做相应的修改,赋值为 RT_NULL 吗? 可是这些变量都是 static 类型的,默认都是 0,不做处理应该也是一样的啊? |
Member
是的,都处理。 另外,不存侥幸心理,需要有明确的初始化。 |
Contributor
Author
|
@BernardXiong 重新提了pr |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
拉取/合并请求描述:(PR description)
[
PIN框架增加 rt_pin_get接口,
驱动已支持stm32,支持恩智浦lpc54114,
已在stm32l475/lpc54114上测试通过,
]
以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use web browser to visit PR, and check items one by one, and ticked them if no problem.
当前拉取/合并请求的状态 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