6#ifndef NEXUS_USB_DEVICE_H
7#define NEXUS_USB_DEVICE_H
166 uint64_t epoch, uint8_t address);
177 uint8_t syscall_ceiling);
Caller-owned admission, borrow, settlement and stable cancellation.
nx_result_t
Operation result; success at submission means admission only.
Optional immutable wake target borrowed by an IRQ provider.
Caller-owned request metadata, without payload or callbacks.
Controller identity remains separate from endpoint identities.
nx_result_t(* address)(void *, uint64_t, uint8_t)
nx_result_t(* service)(void *)
nx_result_t(* read_events)(void *, nx_usb_event_t *, size_t, size_t *)
nx_result_t(* attach_wake)(void *, const nx_irq_wake_t *, uint8_t)
nx_result_t(* stop)(void *)
nx_result_t(* state)(void *, nx_usb_device_state_t *)
const nx_usb_device_ops_t * ops
Shared readonly packet methods; context is a selected endpoint.
nx_result_t(* stall)(void *, bool)
nx_result_t(* submit)(void *, nx_usb_request_t *)
nx_result_t(* cancel)(void *, nx_usb_request_t *)
const nx_usb_endpoint_ops_t * ops
nx_time_us_t timestamp_us
uint64_t nx_time_us_t
Microseconds in one boot/clock domain; no wall-clock semantics.
nx_result_t nx_usb_device_service(const nx_usb_device_port_t *port)
Task-only bounded progress; deadline never depends on USB SOF.
nx_result_t nx_usb_device_state(const nx_usb_device_port_t *port, nx_usb_device_state_t *state)
Task-only authoritative snapshot, independent of event-ring space.
nx_result_t nx_usb_device_stop(const nx_usb_device_port_t *port)
Disconnect, disable, drain, detach IRQs, then release clock consumer.
nx_result_t nx_usb_device_attach_wake(const nx_usb_device_port_t *port, const nx_irq_wake_t *wake, uint8_t syscall_ceiling)
Attach/detach a borrowed task/IRQ-compatible wake hint.
nx_result_t nx_usb_endpoint_cancel(const nx_usb_endpoint_port_t *port, nx_usb_request_t *request)
Request endpoint disable/drain without revoking a buffer loan.
nx_result_t nx_usb_endpoint_submit(const nx_usb_endpoint_port_t *port, nx_usb_request_t *request)
Admit one packet, never a hidden queue or complete USB transaction.
nx_result_t nx_usb_in_prepare(nx_usb_request_t *request, const uint8_t *bytes, size_t length, nx_usb_stage_t stage, uint64_t epoch, nx_time_us_t deadline)
Prepare one IN packet without reading or borrowing its bytes.
nx_result_t nx_usb_endpoint_stall(const nx_usb_endpoint_port_t *port, bool stalled)
Set/clear STALL only after the endpoint has no live transfer.
nx_result_t nx_usb_device_address(const nx_usb_device_port_t *port, uint64_t epoch, uint8_t address)
Stage SET_ADDRESS for the matching zero-data standard SETUP.
nx_result_t nx_usb_device_read_events(const nx_usb_device_port_t *port, nx_usb_event_t *events, size_t capacity, size_t *count)
Consume bounded value events; output is never retained.
nx_result_t nx_usb_out_prepare(nx_usb_request_t *request, uint8_t *bytes, size_t capacity, nx_usb_stage_t stage, uint64_t epoch, nx_time_us_t deadline)
Prepare an OUT packet capacity without modifying its storage.
Explicit borrowed IRQ wake target and syscall-ceiling check.