|
Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
|
Classic CAN value frames and caller-owned mailbox requests. More...
Go to the source code of this file.
Data Structures | |
| struct | nx_can_frame_t |
| Classic 2.0A/B value frame; DLC is always 0..8, never CAN FD. More... | |
| struct | nx_can_tx_request_t |
| Caller-owned frame copied at prepare; base must first be initialized. More... | |
| struct | nx_can_event_t |
| Value receive fact or ordered loss boundary. More... | |
| struct | nx_can_state_t |
| Latched controller state, independent of receive-ring fullness. More... | |
| struct | nx_can_ops_t |
| Shared immutable operations; execution owner serializes task methods. More... | |
| struct | nx_can_port_t |
| Immutable face; lookup does not allocate, start or acquire hardware. More... | |
Macros | |
| #define | NX_CAN_LOSS_SOFTWARE 1U |
| #define | NX_CAN_LOSS_HARDWARE_LOWER_BOUND 2U |
| #define | NX_CAN_LOSS_SATURATED 4U |
| #define | NX_CAN_DLC_NORMALIZED 8U |
Enumerations | |
| enum | nx_can_format_t { NX_CAN_STANDARD , NX_CAN_EXTENDED } |
| enum | nx_can_frame_kind_t { NX_CAN_DATA , NX_CAN_REMOTE } |
| enum | nx_can_event_kind_t { NX_CAN_EVENT_FRAME , NX_CAN_EVENT_LOSS } |
Functions | |
| nx_result_t | nx_can_tx_prepare (nx_can_tx_request_t *request, const nx_can_frame_t *frame, nx_time_us_t deadline) |
| Validate and copy a classic frame into unborrowed request storage. | |
| nx_result_t | nx_can_port_submit (const nx_can_port_t *port, nx_can_tx_request_t *request) |
| Admit one frame into one of three hardware mailboxes. | |
| nx_result_t | nx_can_port_cancel (const nx_can_port_t *port, nx_can_tx_request_t *request) |
| Request abort without revoking a borrowed request. | |
| nx_result_t | nx_can_port_service (const nx_can_port_t *port) |
| Process latched completions and absolute timeout/drain deadlines. | |
| nx_result_t | nx_can_port_read_events (const nx_can_port_t *port, nx_can_event_t *events, size_t capacity, size_t *count) |
| Consume value events without overwriting earlier unconsumed facts. | |
| nx_result_t | nx_can_port_state (const nx_can_port_t *port, nx_can_state_t *state) |
| Copy authoritative error/admission state, even when RX is full. | |
| nx_result_t | nx_can_port_stop (const nx_can_port_t *port) |
| Close admission, abort TX and detach IRQ/RX publishers. | |
| nx_result_t | nx_can_port_recover (const nx_can_port_t *port) |
| Explicitly reenter initialization after bus-off and complete drain. | |
| nx_result_t | nx_can_port_attach_wake (const nx_can_port_t *port, const nx_irq_wake_t *wake, uint8_t syscall_ceiling) |
| Borrow an optional wake target after checking all four actual IRQs. | |
Classic CAN value frames and caller-owned mailbox requests.
Definition in file can.h.
| enum nx_can_event_kind_t |
| enum nx_can_format_t |
| enum nx_can_frame_kind_t |
| nx_result_t nx_can_port_attach_wake | ( | const nx_can_port_t * | port, |
| const nx_irq_wake_t * | wake, | ||
| uint8_t | syscall_ceiling ) |
Borrow an optional wake target after checking all four actual IRQs.
| [in] | port | Serialized task owner, started and masks clear. |
| [in] | wake | Immutable target kept alive until successful stop/detach. |
| [in] | syscall_ceiling | Additional numerical BASEPRI ceiling. |
| nx_result_t nx_can_port_cancel | ( | const nx_can_port_t * | port, |
| nx_can_tx_request_t * | request ) |
Request abort without revoking a borrowed request.
| [in] | port | Stable face owned by the serialized task executor. |
| [in,out] | request | Live request previously accepted by this instance. |
| nx_result_t nx_can_port_read_events | ( | const nx_can_port_t * | port, |
| nx_can_event_t * | events, | ||
| size_t | capacity, | ||
| size_t * | count ) |
Consume value events without overwriting earlier unconsumed facts.
| [in] | port | Stable instance; one task consumer owns this operation. |
| [out] | events | Caller capacity; no retained output reference. |
| [in] | capacity | Nonzero number of event records. |
| [out] | count | Number copied; EMPTY means zero available. |
| nx_result_t nx_can_port_recover | ( | const nx_can_port_t * | port | ) |
Explicitly reenter initialization after bus-off and complete drain.
| [in] | port | Started owner with no active/quarantined TX slots. |
| nx_result_t nx_can_port_service | ( | const nx_can_port_t * | port | ) |
Process latched completions and absolute timeout/drain deadlines.
| [in] | port | Serialized task-owner face with incoming masks clear. |
| nx_result_t nx_can_port_state | ( | const nx_can_port_t * | port, |
| nx_can_state_t * | state ) |
Copy authoritative error/admission state, even when RX is full.
| [in] | port | Live instance and storage. |
| [out] | state | Unretained value output. |
| nx_result_t nx_can_port_stop | ( | const nx_can_port_t * | port | ) |
Close admission, abort TX and detach IRQ/RX publishers.
| [in] | port | Serialized owner; external observers must also join. |
| nx_result_t nx_can_port_submit | ( | const nx_can_port_t * | port, |
| nx_can_tx_request_t * | request ) |
Admit one frame into one of three hardware mailboxes.
| [in] | port | Stable immutable face and private storage. |
| [in,out] | request | READY value request, kept alive until SETTLED. |
| nx_result_t nx_can_tx_prepare | ( | nx_can_tx_request_t * | request, |
| const nx_can_frame_t * | frame, | ||
| nx_time_us_t | deadline ) |
Validate and copy a classic frame into unborrowed request storage.
| [in,out] | request | Initialized READY or consumed SETTLED storage. |
| [in] | frame | Value copied here; remote data bytes are ignored. |
| [in] | deadline | Absolute provider-clock deadline, including admission. |