-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[TOPIC-GPIO] gpio: Update mcux igpio driver to use new gpio api #19247
[TOPIC-GPIO] gpio: Update mcux igpio driver to use new gpio api #19247
Conversation
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.
Code is OKAY.
Tested on i.mx 1050 rt, works as expected.
Has anybody run the 2-pin test #19249 on this? Hack it to specify usable pins and do pinmux if necessary. |
aa9956e
to
f6eb55b
Compare
f6eb55b
to
f5fb3d4
Compare
Rebased to incorporate #19248. Still need to run the 2-pin test |
} else if (pin < 32) { | ||
shift = 2 * (pin - 16); | ||
base->ICR2 = (base->ICR2 & ~(3 << shift)) | (icr << shift); | ||
} else { |
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 is an assert in the API that guarantees that pin number is smaller than the maximum port width. Since the maximum port width in case of mcux driver is 32 we could skip the else
.
Need to be rebased on updated topic-gpio branch. |
f5fb3d4
to
40a3037
Compare
40a3037
to
256e985
Compare
Rebased to pick up 2-pin test, which now passes. The problem I had earlier was fixed by locking interrupts in |
@@ -0,0 +1,13 @@ | |||
/* | |||
* Copyright (c) 2019 Nordic Semiconductor ASA |
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.
change copyright
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.
I kept the Nordic copyright because I copied the file from another board
#ifdef CONFIG_BOARD_MIMXRT1050_EVK | ||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_06_GPIO1_IO22, 0); | ||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_07_GPIO1_IO23, 0); | ||
|
||
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_06_GPIO1_IO22, | ||
IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | | ||
IOMUXC_SW_PAD_CTL_PAD_HYS_MASK | | ||
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | | ||
IOMUXC_SW_PAD_CTL_PAD_DSE(6)); | ||
|
||
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_07_GPIO1_IO23, | ||
IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | | ||
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | | ||
IOMUXC_SW_PAD_CTL_PAD_DSE(6)); | ||
#endif |
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.
i moved this to board's pinmux initialization
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.
Yes this is ugly here, but I also don't want to make it the default pinmux configuration for the board. I think it's more likely these pins will be used for UART.
@MaureenHelm |
Updates the mcux igpio driver and all associated boards to use new device tree compatible gpio configuration flags. Implements new port get/set/clear/toggle and pin_interrupt_configure functions recently added to the gpio api. Assumes the gpio api layer handles translating logical flags to physical flags. Removes port configuration support since that feature is deprecated in the new gpio api. Tested with: - samples/basic/blinky - samples/basic/button - tests/drivers/gpio/gpio_api_1pin On boards: - mimxrt1015_evk - mimxrt1020_evk - mimxrt1050_evk - mimxrt1060_evk - mimxrt1064_evk Signed-off-by: Maureen Helm <[email protected]>
Fixes the user button label in the device tree to match the board's silkscreen. Signed-off-by: Maureen Helm <[email protected]>
Enables the 2-pin gpio test on the mimxrt1050_evk board by adding a dts overlay and configuring pinmuxes on the arduino header. Signed-off-by: Maureen Helm <[email protected]>
256e985
to
16396f7
Compare
Done |
Updates the mcux igpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.
Note that the driver now handles configuring by port inefficiently,
making separate register writes for each pin in the port. However, port
configuration is deprecated in the new gpio api and will soon be
removed.
Tested with:
On boards:
Signed-off-by: Maureen Helm [email protected]