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

Static EXTI line bindings, bounded event storage and drain. More...

#include "nexus/core/time.h"
#include "nexus/io/wake.h"

Go to the source code of this file.

Data Structures

struct  nx_exti_event_t
 Edge facts; timestamp precision and coalescing are provider-specific. More...
struct  nx_exti_ops_t
 Shared read-only methods using one provider state. More...
struct  nx_exti_port
 Immutable interface pointing to caller-owned state. More...

Macros

#define NX_EXTI_EVENT_LOSS   1u
#define NX_EXTI_EVENT_COALESCED   2u

Typedefs

typedef struct nx_exti_port nx_exti_port_t

Enumerations

enum  nx_exti_edge_t { NX_EXTI_RISING = 1 , NX_EXTI_FALLING = 2 , NX_EXTI_BOTH = 3 }

Functions

nx_result_t nx_exti_port_read (const nx_exti_port_t *port, nx_exti_event_t *events, size_t capacity, size_t *count)
 Read queued EXTI events from an exact static line binding.
nx_result_t nx_exti_port_stop (const nx_exti_port_t *port)
 Disable the line source, clear pending and drain its handler.
nx_result_t nx_exti_port_attach_wake (const nx_exti_port_t *port, const nx_irq_wake_t *wake, uint8_t syscall_ceiling)
 Attach or detach an explicit event/loss IRQ wake target.

Detailed Description

Static EXTI line bindings, bounded event storage and drain.

Author
Nexus Team

Definition in file exti.h.

Macro Definition Documentation

◆ NX_EXTI_EVENT_COALESCED

#define NX_EXTI_EVENT_COALESCED   2u

Definition at line 23 of file exti.h.

◆ NX_EXTI_EVENT_LOSS

#define NX_EXTI_EVENT_LOSS   1u

Definition at line 22 of file exti.h.

Typedef Documentation

◆ nx_exti_port_t

typedef struct nx_exti_port nx_exti_port_t

Definition at line 16 of file exti.h.

Enumeration Type Documentation

◆ nx_exti_edge_t

Enumerator
NX_EXTI_RISING 
NX_EXTI_FALLING 
NX_EXTI_BOTH 

Definition at line 17 of file exti.h.

Function Documentation

◆ nx_exti_port_attach_wake()

nx_result_t nx_exti_port_attach_wake ( const nx_exti_port_t * port,
const nx_irq_wake_t * wake,
uint8_t syscall_ceiling )

Attach or detach an explicit event/loss IRQ wake target.

Parameters
[in]portInitialized line, controlled by one task executor.
[in]wakeImmutable live target, or NULL to detach.
[in]syscall_ceilingOptional additional unshifted kernel-safe priority floor; cannot weaken generated policy. PRIMASK kernel targets require zero. Ignored without kernel calls.
Returns
Success or CONTEXT/STATE/PERMISSION/UNSUPPORTED.
Note
Actual shared-vector priority must satisfy the target. Stop and join publishers before freeing old target storage. Wake callbacks observe already-latched event or loss facts.

◆ nx_exti_port_read()

nx_result_t nx_exti_port_read ( const nx_exti_port_t * port,
nx_exti_event_t * events,
size_t capacity,
size_t * count )

Read queued EXTI events from an exact static line binding.

Parameters
[in,out]portOne consumer; bounded configured IRQ-producer storage.
[out]eventsCaller destination, never retained.
[in]capacityDestination event count.
[out]countCopied events; loss is observable via event flags.
Returns
Success, EMPTY or INVALID. No debounce policy or callbacks.

◆ nx_exti_port_stop()

nx_result_t nx_exti_port_stop ( const nx_exti_port_t * port)

Disable the line source, clear pending and drain its handler.

Parameters
[in,out]portExecution owner; consumer/writers must quiesce first.
Returns
Success proves no remaining accesses to event storage; BUSY or IO retains storage, wake targets and cleanup responsibility. Shared vectors preserve other lines.
Note
Failed withdrawal may already have disabled part of the source. Retry and observe success before reclaiming event or wake storage. Face and state remain live while a shared dispatch domain still refers to them.