Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
uart_rs485.h File Reference

Optional single-owner RS485 direction and wire-tail adapter. More...

#include "nexus/io/gpio.h"
#include "nexus/io/uart.h"

Go to the source code of this file.

Data Structures

struct  nx_uart_rs485_config_t
 Immutable selected electrical/timing facts, no task or heap. More...
struct  nx_uart_rs485_state_t
 Caller-owned opt-in adapter, zero-initialize before init. More...

Typedefs

typedef nx_result_t(* nx_uart_tx_validate_fn) (void *context, const nx_uart_tx_request_t *request)
 Exact transport's side-effect-free TX admission validator.

Functions

nx_result_t nx_uart_rs485_initialize (nx_uart_rs485_state_t *state, const nx_uart_rs485_config_t *config)
 Bind exclusive transport and establish inactive DE.

Variables

const nx_uart_ops_t nx_uart_rs485_ops

Detailed Description

Optional single-owner RS485 direction and wire-tail adapter.

Author
Nexus Team

Definition in file uart_rs485.h.

Typedef Documentation

◆ nx_uart_tx_validate_fn

typedef nx_result_t(* nx_uart_tx_validate_fn) (void *context, const nx_uart_tx_request_t *request)

Exact transport's side-effect-free TX admission validator.

Parameters
[in]contextThe immutable transport face's exact context.
[in]requestLive READY or QUEUED descriptor, never retained.
Returns
Same rejectable checks used by the transport submit/start.
Note
Reads clock/hardware facts but never writes GPIO/MMIO, admits, starts or retains a reference. One executor owns adapter and transport; no external direct TX is permitted.

Definition at line 25 of file uart_rs485.h.

Function Documentation

◆ nx_uart_rs485_initialize()

nx_result_t nx_uart_rs485_initialize ( nx_uart_rs485_state_t * state,
const nx_uart_rs485_config_t * config )

Bind exclusive transport and establish inactive DE.

Parameters
[in,out]stateFresh zero-initialized caller control.
[in]configImmutable lifetime binding; one authorized DE bit, real board polarity, setup/hold in nx_time_now_us domain.
Returns
Success or INVALID/CONTEXT/STATE/GPIO failure, no TX loan.
Note
Task-only, no wait. No physical transceiver is inferred. Setup starts after successful DE assertion; hold starts after acquire-observed true transport settlement. Transfer deadline includes setup and wire completion; mandatory drain/hold may extend the borrow beyond that deadline. Rejected TX leaves DE and transport unchanged. Failed drain or DE withdrawal keeps QUARANTINED outer storage and DE ownership until service retry.

Variable Documentation

◆ nx_uart_rs485_ops

const nx_uart_ops_t nx_uart_rs485_ops
extern