-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[TOPIC-GPIO] drivers: Update TI cc32xx and cc13x2/cc26x2 gpio drivers to use new gpio api #19626
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
drivers/gpio/gpio_cc32xx.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.
It looks really weird to truncate the mask to 8 bits, but not truncate the value. Please truncate both or neither.
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 think the truncation would occur regardless, but I agree I should be consistent with the type-casting.
drivers/gpio/gpio_cc32xx.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.
From the prototype of GPIOPinWrite it appears that only 8 pins are supported (ucPins and ucVal are both unsigned char. Shouldn't there be a check on wiether the pin parameter is valid?
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.
Thanks, good point. I will add a check.
|
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
|
Updated based on comments from @pabigot |
|
Thanks @mnkp. Updated based on your comments. |
|
Reworked flag comparison regarding |
|
@vanti |
|
Rebased and removed usage of |
mnkp
left a comment
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.
LGTM, however there is one blocking comment.
Maybe we should squash "drivers: gpio: cc32xx: add assertions to check number of pins" into "TOPIC-GPIO] gpio: Update cc32xx gpio driver to use new gpio api" since the change is part of the new API?
@mnkp I don't think it should be squashed. The assertions were not just added to conform to the new API; they were added across the board for existing functions as well (e.g. read, write, enable_callback). It is a bisectable change that enhances the robustness of the driver code in general. |
Updates the cc32xx gpio 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. Tested with: samples/basic/blinky samples/basic/button tests/drivers/gpio/gpio_api_1pin tests/drivers/gpio/gpio_basic_api On boards: cc3220sf_launchxl cc3235sf_launchxl Signed-off-by: Vincent Wan <[email protected]>
Updates the cc13x2/cc26x2 gpio 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. Tested with: samples/basic/blinky samples/basic/button tests/drivers/gpio/gpio_api_1pin tests/drivers/gpio/gpio_basic_api On board: cc1352r1_launchxl Signed-off-by: Vincent Wan <[email protected]>
Adding overlays so that users can run this test on the following boards: - cc3220sf_launchxl - cc3235sf_launchxl - cc1352r1_launchxl Instructions on pins to connect are included in the overlay files. Signed-off-by: Vincent Wan <[email protected]>
On the TI CC32xx, the GPIO peripheral supports only 8 pins per port. We should add assertions where appropriate to verify this. Signed-off-by: Vincent Wan <[email protected]>
Updates the gpio drivers 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.
Tested with:
samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api (overlays added for the tested boards)
On board:
cc3220sf_launchxl
cc3235sf_launchxl
cc1352r1_launchxl