|
Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
|
IRQ TX requests and independently budgeted byte/event reception. More...
Go to the source code of this file.
Data Structures | |
| struct | nx_uart_rx_event_t |
| Timestamp belongs to provider clock; precision is hardware-specific. More... | |
| struct | nx_uart_tx_request_t |
| Caller-owned TX descriptor; initialize base before first prepare. More... | |
| struct | nx_uart_ops_t |
| Shared read-only methods using one provider state. More... | |
| struct | nx_uart_port |
| Immutable interface pointing to caller-owned state. More... | |
Macros | |
| #define | NX_UART_EVENT_PARITY 1u |
| #define | NX_UART_EVENT_FRAMING 2u |
| #define | NX_UART_EVENT_OVERRUN 4u |
| #define | NX_UART_EVENT_NOISE 8u |
| #define | NX_UART_EVENT_LOSS 16u |
| #define | NX_UART_EVENT_NO_BYTE 32u |
Typedefs | |
| typedef struct nx_uart_port | nx_uart_port_t |
Enumerations | |
| enum | nx_uart_rx_profile_t { NX_UART_RX_BYTES , NX_UART_RX_EVENTS , NX_UART_RX_BLOCKS } |
Functions | |
| nx_result_t | nx_uart_tx_prepare (nx_uart_tx_request_t *request, const uint8_t *data, size_t length, nx_time_us_t deadline) |
| Prepare an unborrowed IRQ TX descriptor without copying data. | |
| nx_result_t | nx_uart_port_submit (const nx_uart_port_t *port, nx_uart_tx_request_t *request) |
| Submit one direct request to a single-executor UART. | |
| nx_result_t | nx_uart_port_start_admitted (const nx_uart_port_t *port, nx_uart_tx_request_t *request) |
| Start an adapter-admitted QUEUED request without readmission. | |
| nx_result_t | nx_uart_port_cancel (const nx_uart_port_t *port, nx_uart_tx_request_t *request) |
| Request cancellation; acceptance does not mean settlement. | |
| void | nx_uart_port_service (const nx_uart_port_t *port) |
| Observe time/hardware completion and drain one active request. | |
| nx_result_t | nx_uart_port_read_events (const nx_uart_port_t *port, nx_uart_rx_event_t *events, size_t capacity, size_t *count) |
| Read buffered RX events from the selected event profile. | |
| nx_result_t | nx_uart_port_read_bytes (const nx_uart_port_t *port, uint8_t *bytes, size_t capacity, size_t *count) |
| Read buffered bytes from the selected byte profile. | |
| nx_result_t | nx_uart_port_stop (const nx_uart_port_t *port) |
| Close admission and drain TX before releasing hardware. | |
| nx_result_t | nx_uart_port_attach_wake (const nx_uart_port_t *port, const nx_irq_wake_t *wake, uint8_t syscall_ceiling) |
| Attach or detach one explicit IRQ wake target. | |
| nx_result_t | nx_uart_port_rx_start (const nx_uart_port_t *port, nx_stream_t *stream) |
| Start the selected RX block mode using exact caller storage. | |
| nx_result_t | nx_uart_port_rx_stop (const nx_uart_port_t *port) |
| Stop RX block production without revoking consumer loans. | |
IRQ TX requests and independently budgeted byte/event reception.
Definition in file uart.h.
| typedef struct nx_uart_port nx_uart_port_t |
| enum nx_uart_rx_profile_t |
| nx_result_t nx_uart_port_attach_wake | ( | const nx_uart_port_t * | port, |
| const nx_irq_wake_t * | wake, | ||
| uint8_t | syscall_ceiling ) |
Attach or detach one explicit IRQ wake target.
| [in] | port | Initialized provider, controlled by one task executor. |
| [in] | wake | Immutable live target or NULL to detach. |
| [in] | syscall_ceiling | Optional additional unshifted kernel-safe priority floor; cannot weaken generated policy. PRIMASK kernel targets require zero. Ignored without kernel calls. |
| nx_result_t nx_uart_port_cancel | ( | const nx_uart_port_t * | port, |
| nx_uart_tx_request_t * | request ) |
Request cancellation; acceptance does not mean settlement.
| [in,out] | port | Same single execution owner as submit/service. |
| [in,out] | request | Active live descriptor; cross-task callers use a stable adapter slot and expected epoch instead of this pointer. |
| nx_result_t nx_uart_port_read_bytes | ( | const nx_uart_port_t * | port, |
| uint8_t * | bytes, | ||
| size_t | capacity, | ||
| size_t * | count ) |
Read buffered bytes from the selected byte profile.
| [in,out] | port | Initialized byte-profile port; one consumer. |
| [out] | bytes | Caller-owned destination; not retained. |
| [in] | capacity | Destination capacity in bytes. |
| [out] | count | Bytes copied; valid even when OVERFLOW is returned. |
| nx_result_t nx_uart_port_read_events | ( | const nx_uart_port_t * | port, |
| nx_uart_rx_event_t * | events, | ||
| size_t | capacity, | ||
| size_t * | count ) |
Read buffered RX events from the selected event profile.
| [in,out] | port | Initialized event-profile port; one consumer. |
| [out] | events | Caller-owned destination; not retained. |
| [in] | capacity | Destination event count. |
| [out] | count | Events copied, including explicit loss/error flags. |
| nx_result_t nx_uart_port_rx_start | ( | const nx_uart_port_t * | port, |
| nx_stream_t * | stream ) |
Start the selected RX block mode using exact caller storage.
| [in] | port | Block-capable provider, one task execution owner. |
| [in,out] | stream | Initialized block stream retained until RX stops and all acquired consumer blocks are released. |
| nx_result_t nx_uart_port_rx_stop | ( | const nx_uart_port_t * | port | ) |
Stop RX block production without revoking consumer loans.
| [in] | port | Same executor as RX start; storage stays live on BUSY. |
| void nx_uart_port_service | ( | const nx_uart_port_t * | port | ) |
Observe time/hardware completion and drain one active request.
| [in,out] | port | Single task/loop execution owner. |
| nx_result_t nx_uart_port_start_admitted | ( | const nx_uart_port_t * | port, |
| nx_uart_tx_request_t * | request ) |
Start an adapter-admitted QUEUED request without readmission.
| [in,out] | port | Single-executor initialized port. |
| [in,out] | request | QUEUED descriptor already borrowed by adapter. |
| nx_result_t nx_uart_port_stop | ( | const nx_uart_port_t * | port | ) |
Close admission and drain TX before releasing hardware.
| [in,out] | port | Owner; producers must already have quiesced. |
| nx_result_t nx_uart_port_submit | ( | const nx_uart_port_t * | port, |
| nx_uart_tx_request_t * | request ) |
Submit one direct request to a single-executor UART.
| [in,out] | port | Initialized idle port owned by this execution context. |
| [in,out] | request | READY descriptor; borrowed only on NX_SUCCESS. |
| nx_result_t nx_uart_tx_prepare | ( | nx_uart_tx_request_t * | request, |
| const uint8_t * | data, | ||
| size_t | length, | ||
| nx_time_us_t | deadline ) |
Prepare an unborrowed IRQ TX descriptor without copying data.
| [in,out] | request | Fresh initialized or consumed SETTLED request. |
| [in] | data | Nonempty payload retained unchanged through SETTLED. |
| [in] | length | Positive byte count. |
| [in] | deadline | Absolute deadline in nx_time_now_us clock domain. |