yangsong8-a1 opened a new pull request, #22154:
URL: https://github.com/apache/nuttx/pull/22154
## Summary
Add an upper-half character driver for SENT (Single Edge Nibble
Transmission, SAE J2716) receivers.
- include/nuttx/sent/sent.h: frame types (short serial, enhanced 4/8-bit
id, fast channel), the lower-half interface (activate, trigger_spc,
control) and sent_register().
- drivers/sent/sent.c: open/close (activate the lower half on first
open, deactivate on last close), read (whole struct sent_frame_s
entries from a ring buffer that the lower half fills through the
push_frame callback), poll, and ioctl (SENTIOC_TRIGGER_SPC, other
commands go to the lower half's control).
- New ioctl base _SENTIOCBASE (0x4c00).
There is no lower-half driver in this PR.
## Impact
New files only, plus the drivers/ Kconfig/Make/CMake entries and the
ioctl base. CONFIG_SENT defaults to n.
## Testing
Ubuntu 22.04, host gcc. sim:nsh with SENT, CMake and Make, no new
warnings.
A temporary test program (not part of this PR) on sim:nsh implements a
dummy lower half, registers /dev/sent0, pushes three fast-channel frames
through the callback that activate() received, and reads them back:
sent_register: 0
activate: on
open: 3
read empty: -1
poll empty: 0
poll after push: 1 revents 0x1
read: 48 bytes (3 frames)
type 3 status 1 data 0x123450 crc 0xa ts 1000
type 3 status 1 data 0x123451 crc 0xa ts 1001
type 3 status 1 data 0x123452 crc 0xa ts 1002
SENTIOC_TRIGGER_SPC: 0 spc count 1
control: cmd 0x4c02 arg 7
other ioctl: 0
activate: off
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]