-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Enable nxp high speed comparator (hscmp) driver #100629
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
SOC_LPC55S36 has 119 IRQs. Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
add HSCMP clock support. Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Add high-speed comparator support Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
enable hscmp for lpc55s36 Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
enable gpio_loopback for lpcxpresso55s36 Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
6eab01c to
36b1f3f
Compare
|
| return ret; | ||
| } | ||
|
|
||
| ret = reset_line_deassert(config->reset.dev, config->reset.id); |
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.
assert & deassert can be combined to reset_line_toggle https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/drivers/reset.h#L342-L351
| base->CCR1 &= ~HSCMP_CCR1_COUT_SEL_MASK; | ||
| if (config->filter_count != 0U) { | ||
| base->CCR1 |= HSCMP_CCR1_FILT_CNT(config->filter_count); | ||
| base->CCR1 |= HSCMP_CCR1_FILT_PER(config->filter_period); |
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.
If no special hardware limitation, suggest combine to one register write, because register writing needs more time.
| base->CCR2 = ((base->CCR2 & ~(HSCMP_CCR2_CMP_HPMD_MASK | HSCMP_CCR2_CMP_NPMD_MASK | | ||
| HSCMP_CCR2_HYSTCTR_MASK | HSCMP_CCR2_PSEL_MASK | HSCMP_CCR2_MSEL_MASK)) | | ||
| HSCMP_CCR2_PSEL(config->positive_mux_is_dac ? 5U : config->positive_mux_input) | | ||
| HSCMP_CCR2_MSEL(config->negative_mux_is_dac ? 5U : config->negative_mux_input) | |
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.
can use some meaningful value instead of 5?



enable nxp hscmp driver
enable hscmp for lpc55s36
test with gpio_loopback
test result:
Logs