-
Notifications
You must be signed in to change notification settings - Fork 7.6k
NXP S32 introduce support SENT #80117
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
NXP S32 introduce support SENT #80117
Conversation
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
ec62630
to
b483917
Compare
d00b883
to
23b01d3
Compare
23b01d3
to
55d6a35
Compare
@congnguyenhuu I'd suggest you to open an RFC (request for comments) and link it to this pr in order to involve community to review the proposal and reach consensus: https://docs.zephyrproject.org/latest/contribute/proposals_and_rfcs.html |
55d6a35
to
ec00dc8
Compare
c79ca4d
to
f2e3c0c
Compare
close/reopen to clear false bot block |
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.
Pull Request Overview
This PR introduces support for the Single Edge Nibble Transmission (SENT) driver on NXP S32Z devices, including a new driver implementation, device tree bindings, test cases, samples, and documentation updates.
- Added NXP S32 SENT receiver driver and API (
drivers/sent/…
) - Introduced DTS bindings and board overlays for SENT controllers and channels
- Added tests (
tests/drivers/sent/…
), sample application (samples/drivers/sent/…
), and documentation
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
drivers/sent/sent_nxp_s32.c | New NXP S32 SENT driver source implementation |
include/zephyr/drivers/sent/sent.h | SENT public API headers |
dts/bindings/sent/sent-controller.yaml | Device tree binding for SENT controller |
tests/drivers/sent/sent_api/src/main.c | API test cases for start/stop/register |
Comments suppressed due to low confidence (3)
tests/drivers/sent/sent_api/src/main.c:105
- The tests verify callback registration but do not exercise actual frame reception or callback invocation. Consider adding a mock or simulated SENT frame to validate the user callback path.
err = sent_register_callback(sent_dev, SENT_CHANNEL, callback_configs);
drivers/sent/sent_nxp_s32.c:366
- [nitpick] The term
channel_map
may be misleading since it holds hardware register addresses. Consider renaming tochannel_hw_offsets
or adding a clarifying comment.
.channel_map = {DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(n, DT_REG_ADDR, (,))}, \
doc/hardware/peripherals/sent.rst:17
- [nitpick] The documentation lists only the generic
CONFIG_SENT
option. It could be helpful to reference the NXP S32-specific driver (e.g.,CONFIG_SENT_NXP_S32
) and point to the sample application.
* :kconfig:option:`CONFIG_SENT`
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: Single Edge Nibble Transmission (SENT) Controller |
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.
description: Single Edge Nibble Transmission (SENT) Controller | |
description: SENT (Single Edge Nibble Transmission) Controller |
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 updated
dts/bindings/sent/nxp,s32-sent.yaml
Outdated
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: NXP S32 Single Edge Nibble Transmission (SENT) Receiver Controller |
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.
description: NXP S32 Single Edge Nibble Transmission (SENT) Receiver Controller | |
description: NXP S32 SENT (Single Edge Nibble Transmission) Receiver Controller |
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 updated
include/zephyr/drivers/sent/sent.h
Outdated
SENT_SHORT_SERIAL_FRAME, | ||
SENT_ENHANCED_SERIAL_FRAME_4_BIT_ID, | ||
SENT_ENHANCED_SERIAL_FRAME_8_BIT_ID, | ||
SENT_FAST_FRAME |
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.
Enum fields need Doxygen docs
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 updated
include/zephyr/drivers/sent/sent.h
Outdated
enum sent_frame_type type; | ||
|
||
union { | ||
struct { | ||
uint8_t id; | ||
uint16_t data; | ||
} serial; | ||
|
||
struct { | ||
uint8_t data_nibbles[SENT_MAX_DATA_NIBBLES]; | ||
} fast; | ||
}; | ||
|
||
uint32_t timestamp; | ||
uint8_t crc; |
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.
Missing Doxygen docs or mark as INTERNAL_HIDDEN if it's meant to be an opaque type from an API standpoint
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 updated to add doxygen
include/zephyr/drivers/sent/sent.h
Outdated
sent_rx_frame_callback_t callback; | ||
struct sent_frame *frame; | ||
uint32_t max_num_frame; | ||
void *user_data; |
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.
Missing docs
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 updated
include/zephyr/drivers/sent/sent.h
Outdated
* @retval 0 if successful. | ||
* @retval -EINVAL if an invalid channel is given. |
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.
* @retval 0 if successful. | |
* @retval -EINVAL if an invalid channel is given. | |
* @retval 0 success. | |
* @retval -EINVAL invalid channel. |
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 updated
#define FAST_CRC_DISABLE 0 | ||
#define FAST_CRC_LEGACY_IMPLEMENTATION 1 | ||
#define FAST_CRC_RECOMMENDED_IMPLEMENTATION 2 | ||
#define FAST_CRC_STATUS_INCLUDE 4 | ||
|
||
#define SHORT_CRC_LEGACY_IMPLEMENTATION 0 | ||
#define SHORT_CRC_RECOMMENDED_IMPLEMENTATION 1 |
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.
Missing Doxygen comments
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 updated
samples/drivers/sent/README.rst
Outdated
Overview | ||
******** | ||
|
||
The sample application shows how to use the Single Edge Nibble Transmission (SENT) driver: |
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.
Make "SENT (...)" a link to the SENT doc page
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 updated
samples/drivers/sent/README.rst
Outdated
Requirements | ||
************ | ||
|
||
This sample requires a SENT sensor to be connected. |
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.
This sample requires a SENT sensor to be connected. | |
This sample requires a SENT sensor to be connected and exposed as ``sent-node`` Devicetree alias. |
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 updated to This sample requires a SENT sensor to be connected and exposed as ``sent0`` Devicetree alias.
|
||
/ { | ||
aliases { | ||
sent-node = &sent1; |
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's a bit unconventional to use the -node
suffix here IMO. Convention would be to call this sent0
, I think.
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.
agree
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 updated to call sent0
zassert_equal(err, 0, "Failed to start rx (err %d)", err); | ||
|
||
err = sent_start_listening(sent_dev, SENT_CHANNEL); | ||
zassert_not_equal(err, 0, "Started rx while started"); |
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 would suggest using z_assert_ok() / z_assert_not_ok() instead for all these kinds of asserts
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 updated
b49122f
e069738
to
b49122f
Compare
twister-build is failing, it fixes by PR #92238 |
This driver allows to communication (receive data) with SENT device Signed-off-by: Cong Nguyen Huu <[email protected]>
enable support SENT Signed-off-by: Cong Nguyen Huu <[email protected]>
Create test, sample for SENT driver Signed-off-by: Cong Nguyen Huu <[email protected]>
b49122f
to
d1d740a
Compare
|
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.
Great work with the docs, much appreciated!
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.
Great work with the docs, much appreciated!
Introduce support Single Edge Nibble Transmission (SENT) driver using peripheral SENT receiver on S32Z. This driver allows to communication (read data) with SENT device.
The test result: SENT-RECEIVER-TESTING-RESULT.pptx
RFC: #83983