-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: nrf: Add UART and UARTE configure function. #11577
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
drivers: nrf: Add UART and UARTE configure function. #11577
Conversation
6a8a597 to
f16d3fa
Compare
Codecov Report
@@ Coverage Diff @@
## master #11577 +/- ##
=======================================
Coverage 48.21% 48.21%
=======================================
Files 279 279
Lines 43303 43303
Branches 10370 10370
=======================================
Hits 20878 20878
Misses 18279 18279
Partials 4146 4146Continue to review full report at Codecov.
|
f16d3fa to
31ea7cb
Compare
917e492 to
3e36b2f
Compare
20b7aea to
2a46ae6
Compare
|
@anangl All should be fixed now |
901d7b8 to
1342b9c
Compare
367c564 to
198391e
Compare
|
@anangl Fixed |
anangl
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.
Almost there. A few minor corrections needed.
Add UART configure function for UART and UARTE shims. Signed-off-by: Mieszko Mierunski <[email protected]>
198391e to
e5bf097
Compare
anangl
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.
Beautiful. As much as it was possible. ;-)
Thanks for your tenacity.
jakub-uC
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.
Minor change proposals -not a merge blocker.
| } | ||
|
|
||
| if (baudrate_set(dev, cfg->baudrate) != 0) { | ||
| return -ENOTSUP; |
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 that value -EINVAL is better here.
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.
API specifies that -ENOTSUP will be returned if configuration is not supported by driver. Same applies to other places
| parity = NRF_UART_PARITY_INCLUDED; | ||
| break; | ||
| default: | ||
| return -ENOTSUP; |
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.
-EINVAL
| #ifndef DT_NORDIC_NRF_UART_UART_0_CTS_PIN | ||
| #error Flow control for UART0 is enabled, but CTS pin is not defined. | ||
| #endif | ||
| #if defined(DT_NORDIC_NRF_UART_UART_0_RTS_PIN) && \ |
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.
Please use IS_ENABLED macro.
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.
Functions called in lines below use value of this define, I can use #if with IS_ENABLED but I don't think it will improve anything. Using if() is not possible here
| } | ||
| break; | ||
| default: | ||
| return -ENOTSUP; |
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.
-EINVAL
| } | ||
|
|
||
| if (baudrate_set(dev, cfg->baudrate) != 0) { | ||
| return -ENOTSUP; |
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.
-EINVAL
|
@carlescufi Please take a look |
Add UART configure function for UART and UARTE shims.
Signed-off-by: Mieszko Mierunski [email protected]