|
Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
|
Address endpoints, repeated START and explicit STOP settlement. More...
Go to the source code of this file.
Data Structures | |
| One message; a new message starts with repeated START, final with STOP. More... | |
| struct | nx_i2c_request_t |
| Caller-owned finite message sequence. More... | |
| struct | nx_i2c_ops_t |
| Shared read-only methods using one provider state. More... | |
| struct | nx_i2c_port |
| Immutable interface pointing to caller-owned state. More... | |
| struct | nx_i2c_endpoint_ops_t |
| Shared read-only methods using one provider state. More... | |
| struct | nx_i2c_endpoint |
| Immutable interface pointing to caller-owned state. More... | |
Macros | |
| #define | NX_I2C_MAX_MESSAGES 8U |
| Maintained finite-message admission bounds, checked before hardware access. | |
| #define | NX_I2C_MAX_MESSAGE_BYTES 256U |
Typedefs | |
| typedef struct nx_i2c_port | nx_i2c_port_t |
| typedef struct nx_i2c_endpoint | nx_i2c_endpoint_t |
Functions | |
| nx_result_t | nx_i2c_endpoint_transaction (const nx_i2c_endpoint_t *endpoint, nx_i2c_message_t *messages, size_t count, nx_time_us_t deadline, size_t *transferred) |
| Execute a polling 7-bit-address message transaction. | |
| nx_result_t | nx_i2c_port_recover (const nx_i2c_port_t *port) |
| Recover an idle controller after a bus fault. | |
| nx_result_t | nx_i2c_request_prepare (nx_i2c_request_t *request, nx_i2c_message_t *messages, size_t count, nx_time_us_t deadline) |
| Prepare an unborrowed request without copying payload. | |
| nx_result_t | nx_i2c_request_validate (const nx_i2c_request_t *request) |
| Validate finite descriptors and payload/control separation. | |
| nx_result_t | nx_i2c_endpoint_submit (const nx_i2c_endpoint_t *endpoint, nx_i2c_request_t *request) |
| Admit one finite asynchronous repeated-START transaction. | |
| nx_result_t | nx_i2c_endpoint_start_admitted (const nx_i2c_endpoint_t *endpoint, nx_i2c_request_t *request) |
| Start an already borrowed QUEUED request without readmission. | |
| bool | nx_i2c_endpoint_on_port (const nx_i2c_endpoint_t *endpoint, const nx_i2c_port_t *port) |
| Prove controller identity without hardware effects. | |
| nx_result_t | nx_i2c_port_cancel (const nx_i2c_port_t *port, nx_i2c_request_t *request) |
| Request cancellation without reclaiming any storage. | |
| void | nx_i2c_port_service (const nx_i2c_port_t *port) |
| Advance deadline and STOP/DMA drain in bounded task context. | |
| nx_result_t | nx_i2c_port_stop (const nx_i2c_port_t *port) |
| Close admission and stop only after every borrower drains. | |
| nx_result_t | nx_i2c_port_attach_wake (const nx_i2c_port_t *port, const nx_irq_wake_t *wake, uint8_t syscall_ceiling) |
| Attach one optional hint sink after actual IRQ policy checks. | |
Address endpoints, repeated START and explicit STOP settlement.
Definition in file i2c.h.
| #define NX_I2C_MAX_MESSAGES 8U |
| typedef struct nx_i2c_endpoint nx_i2c_endpoint_t |
| typedef struct nx_i2c_port nx_i2c_port_t |
| bool nx_i2c_endpoint_on_port | ( | const nx_i2c_endpoint_t * | endpoint, |
| const nx_i2c_port_t * | port ) |
Prove controller identity without hardware effects.
| [in] | endpoint | Immutable addressed child |
| [in] | port | Exact execution controller |
| nx_result_t nx_i2c_endpoint_start_admitted | ( | const nx_i2c_endpoint_t * | endpoint, |
| nx_i2c_request_t * | request ) |
Start an already borrowed QUEUED request without readmission.
| [in] | endpoint | Fixed address on the adapter's exact controller |
| [in,out] | request | Adapter-admitted QUEUED storage |
| nx_result_t nx_i2c_endpoint_submit | ( | const nx_i2c_endpoint_t * | endpoint, |
| nx_i2c_request_t * | request ) |
Admit one finite asynchronous repeated-START transaction.
| [in] | endpoint | Initialized fixed address and single executor |
| [in,out] | request | READY descriptor and all referenced storage |
| nx_result_t nx_i2c_endpoint_transaction | ( | const nx_i2c_endpoint_t * | endpoint, |
| nx_i2c_message_t * | messages, | ||
| size_t | count, | ||
| nx_time_us_t | deadline, | ||
| size_t * | transferred ) |
Execute a polling 7-bit-address message transaction.
| [in] | endpoint | Fixed address/controller binding. |
| [in,out] | messages | Message buffers; write data are not modified. |
| [in] | count | One through NX_I2C_MAX_MESSAGES. |
| [in] | deadline | Finite absolute provider-clock deadline. |
| [out] | transferred | Completed byte prefix across messages, including error returns. |
| nx_result_t nx_i2c_port_attach_wake | ( | const nx_i2c_port_t * | port, |
| const nx_irq_wake_t * | wake, | ||
| uint8_t | syscall_ceiling ) |
Attach one optional hint sink after actual IRQ policy checks.
| [in] | port | Initialized asynchronous controller |
| [in] | wake | Borrowed sink or NULL to detach after publisher exit |
| [in] | syscall_ceiling | Cannot weaken selected kernel policy |
| nx_result_t nx_i2c_port_cancel | ( | const nx_i2c_port_t * | port, |
| nx_i2c_request_t * | request ) |
Request cancellation without reclaiming any storage.
| [in] | port | Same single executor as submit/service |
| [in,out] | request | Exact active descriptor, never a stale raw pointer |
| nx_result_t nx_i2c_port_recover | ( | const nx_i2c_port_t * | port | ) |
Recover an idle controller after a bus fault.
| [in,out] | port | Single executor, no live transaction/buffer borrow. |
| void nx_i2c_port_service | ( | const nx_i2c_port_t * | port | ) |
Advance deadline and STOP/DMA drain in bounded task context.
| [in] | port | Live single executor, serviced throughout stop |
| nx_result_t nx_i2c_port_stop | ( | const nx_i2c_port_t * | port | ) |
Close admission and stop only after every borrower drains.
| [in] | port | Controller with external producers quiesced |
| nx_result_t nx_i2c_request_prepare | ( | nx_i2c_request_t * | request, |
| nx_i2c_message_t * | messages, | ||
| size_t | count, | ||
| nx_time_us_t | deadline ) |
Prepare an unborrowed request without copying payload.
| [in,out] | request | Initialized READY or consumed SETTLED storage |
| [in,out] | messages | One through eight complete descriptors |
| [in] | count | Exact descriptor count |
| [in] | deadline | Absolute provider-clock deadline |
| nx_result_t nx_i2c_request_validate | ( | const nx_i2c_request_t * | request | ) |
Validate finite descriptors and payload/control separation.
| [in] | request | Complete caller-owned request, not retained |