Skip to content
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

Add PWM pulse capture driver for S32K344 #62695

Merged
merged 4 commits into from
Sep 29, 2023

Conversation

Dat-NguyenDuy
Copy link
Contributor

This introduces PWM pulse capture driver over eMIOS peripheral for S32K344

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 15, 2023

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@b4a3786 zephyrproject-rtos/hal_nxp@ad142f5 (master) zephyrproject-rtos/hal_nxp@b4a37865..ad142f56

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@Dat-NguyenDuy Dat-NguyenDuy force-pushed the s32k3-pwm-capture branch 2 times, most recently from db01a08 to 69d2d42 Compare September 18, 2023 02:00
@Dat-NguyenDuy Dat-NguyenDuy force-pushed the s32k3-pwm-capture branch 2 times, most recently from 3df256c to 8f9d42f Compare September 28, 2023 14:54
@manuargue
Copy link
Member

The CI failures are due to #63238, you'll need to rebase once the fix is in

Copy link
Member

@manuargue manuargue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. @mmahadevan108 do you think we can get the HAL pr merged while we gather more feedback on this?

@mmahadevan108
Copy link
Collaborator

@Dat-NguyenDuy . Kindly rebase to pull in the HAL SHA

@mmahadevan108
Copy link
Collaborator

mmahadevan108 commented Sep 28, 2023

@Dat-NguyenDuy , please also provided details on how this PR was tested.

@Dat-NguyenDuy Dat-NguyenDuy force-pushed the s32k3-pwm-capture branch 2 times, most recently from 6e6b552 to 13e7c67 Compare September 29, 2023 06:55
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Sep 29, 2023
@Dat-NguyenDuy
Copy link
Contributor Author

@Dat-NguyenDuy . Kindly rebase to pull in the HAL SHA

I rebased

@Dat-NguyenDuy
Copy link
Contributor Author

Dat-NguyenDuy commented Sep 29, 2023

@Dat-NguyenDuy , please also provided details on how this PR was tested.

i tested with 13e7c67

manuargue
manuargue previously approved these changes Sep 29, 2023
Copy link
Member

@manuargue manuargue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my comments addressed

@Dat-NguyenDuy
Copy link
Contributor Author

Dat-NguyenDuy commented Sep 29, 2023

Rebased to fix conflict. But there would have build fails because of this PR was merged in hal_nxp zephyrproject-rtos/hal_nxp#273. But unfortunately the one in zephyr is still under review #62755

This enables and declares interrupt handlers for eMIOS,
the handlers defined and implemented at HAL, the driver
takes the name for each id from interrupt-names devicetree

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
This prepares support pwm capture APIs by extended current pwm
shim driver but use a differrence hal component:

- Introduce a Kconfig options that will be set when PWM pulse
  generation API is used, it is also used to select the hal
  component. Guarding current code inside this Kconfig option

- Increase #pwm-cells to 3, flags is supported for PWM capture

- Do not require duty-cycle and polarity be set in dt, PWM
  capture doesn't need it.

- Rename emum value for pwm-mode to keep only key information

- Add preprocessor in case no channel is configured for generate
  PWM output, to avoid warning when build

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
manuargue
manuargue previously approved these changes Sep 29, 2023
@mmahadevan108
Copy link
Collaborator

@Dat-NguyenDuy , we have reverted the pinctlrl PR that. Can you please update your west.yml SHA.

This introduces pwm capture shim driver for NXP S32 EMIOS,
the driver uses SAIC mode that is supported for all channels,
to capture the counter value on each edge for period/pulse
measurement

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
Enable PWM loopback testing for mr_canhubk3

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
@carlescufi carlescufi merged commit 2aded40 into zephyrproject-rtos:main Sep 29, 2023
22 checks passed
@Dat-NguyenDuy Dat-NguyenDuy deleted the s32k3-pwm-capture branch September 29, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: PWM Pulse Width Modulation manifest manifest-hal_nxp platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants