|
Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
|
Explicit host-model fixtures; no physical MCU qualification. More...
#include "nexus/io/adc.h"#include "nexus/io/exti.h"#include "nexus/io/flash.h"#include "nexus/io/gpio.h"#include "nexus/io/i2c.h"#include "nexus/io/spi.h"#include "nexus/io/timer.h"#include "nexus/io/uart.h"#include "nexus/io/watchdog.h"Go to the source code of this file.
Data Structures | |
| struct | nx_native_uart_config_t |
| UART storage belongs to the fixture until port stop and IRQ quiescence. More... | |
Functions | |
| nx_result_t | nx_native_clock_configure (bool enabled, nx_time_us_t now) |
| Switch host model to a deterministic clock domain. | |
| nx_result_t | nx_native_clock_advance (uint64_t duration_us) |
| Advance deterministic time without an implicit hardware IRQ. | |
| nx_result_t | nx_native_gpio_configure (uint32_t mask, uint32_t initial) |
| Configure the fixed GPIO model after writer quiescence. | |
| void | nx_native_gpio_input (uint32_t value) |
| Inject one GPIO input snapshot in the deterministic model. | |
| uint32_t | nx_native_gpio_output (void) |
| Observe output state for a host behavioral assertion. | |
| nx_result_t | nx_native_uart_configure (const nx_native_uart_config_t *config) |
| Configure exact RX/TX fixture capacities on the fixed UART. | |
| nx_result_t | nx_native_uart_tx_validate (void *context, const nx_uart_tx_request_t *request) |
| Validate exact Native TX context for selected RS485 binding. | |
| nx_result_t | nx_native_uart_model_irq_configure (const nx_uart_port_t *binding, const nx_irq_policy_t *policy, const nx_irq_source_t *source) |
| Copy explicit IRQ facts into a quiescent host UART model. | |
| void | nx_native_uart_irq_step (void) |
| Execute one deterministic TX IRQ byte/TC event. | |
| nx_result_t | nx_native_uart_receive (uint8_t byte, uint32_t flags) |
| Inject one RX IRQ fact into bounded selected-profile storage. | |
| void | nx_native_uart_fault (bool start_failure, bool hold_drain) |
| Configure start failure or inability to prove hardware drain. | |
| size_t | nx_native_uart_transmitted (void) |
| Observe captured TX bytes. | |
| nx_result_t | nx_native_spi_configure (uint8_t *registers, size_t length) |
| Configure a fixed SPI echo or register-file model. | |
| void | nx_native_spi_fault (size_t fail_after, bool busy) |
| Inject bounded SPI partial failure or controller occupancy. | |
| bool | nx_native_spi_cs_active (void) |
| Check the modeled CS level after a transaction. | |
| nx_result_t | nx_native_i2c_configure (uint8_t *memory, size_t length, uint8_t address) |
| Configure one 7-bit-address register-file I2C model. | |
| void | nx_native_i2c_fault (nx_result_t result, bool stuck) |
| Inject NACK, arbitration loss or a stuck bus. | |
| nx_result_t | nx_native_flash_configure (uint8_t *memory, const nx_flash_geometry_t *geometry) |
| Configure physical-geometry RAM model, clearly nonpersistent. | |
| void | nx_native_flash_fault (size_t pulse_count) |
| Inject program/erase failure after complete modeled pulses. | |
| void | nx_native_watchdog_boot (uint32_t causes) |
| Reset the watchdog fixture as a simulated new boot. | |
| bool | nx_native_watchdog_expired (void) |
| Observe expiration of the enabled deterministic IWDG. | |
| nx_result_t | nx_native_exti_configure (uint8_t line, nx_exti_edge_t edge, nx_exti_event_t *events, size_t capacity) |
| Configure exact storage for one static EXTI line. | |
| nx_result_t | nx_native_exti_emit (uint8_t line, nx_exti_edge_t edge) |
| Inject a timestamped selected edge fact. | |
| nx_result_t | nx_native_pwm_configure (uint32_t tick_hz, uint32_t period_ticks) |
| Configure fixed PWM model timer facts after writer quiescence. | |
| nx_result_t | nx_native_adc_configure (const uint16_t *samples, size_t count, uint8_t resolution_bits, uint32_t reference_mv) |
| Configure fixed ADC raw-count sequence and format. | |
| void | nx_native_adc_fault (size_t sample_count) |
| Inject ADC failure after a prefix of complete samples. | |
| void | nx_native_gpio_model_input (const nx_gpio_port_t *binding, uint32_t value) |
| Operate on the selected Native model face only. | |
| uint32_t | nx_native_gpio_model_output (const nx_gpio_port_t *binding) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_uart_model_configure (const nx_uart_port_t *binding, const nx_native_uart_config_t *config) |
| Operate on the selected Native model face only. | |
| void | nx_native_uart_model_irq_step (const nx_uart_port_t *binding) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_uart_model_receive (const nx_uart_port_t *binding, uint8_t byte, uint32_t flags) |
| Operate on the selected Native model face only. | |
| void | nx_native_uart_model_fault (const nx_uart_port_t *binding, bool start_failure, bool hold_drain) |
| Operate on the selected Native model face only. | |
| size_t | nx_native_uart_model_transmitted (const nx_uart_port_t *binding) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_spi_model_configure (const nx_spi_endpoint_t *binding, uint8_t *registers, size_t length) |
| Operate on the selected Native model face only. | |
| void | nx_native_spi_model_fault (const nx_spi_port_t *binding, size_t fail_after, bool busy) |
| Operate on the selected Native model face only. | |
| bool | nx_native_spi_model_cs_active (const nx_spi_endpoint_t *binding) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_i2c_model_configure (const nx_i2c_endpoint_t *binding, uint8_t *memory, size_t length, uint8_t address) |
| Operate on the selected Native model face only. | |
| void | nx_native_i2c_model_fault (const nx_i2c_port_t *binding, nx_result_t result, bool stuck) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_flash_model_configure (const nx_flash_port_t *binding, uint8_t *memory, const nx_flash_geometry_t *geometry) |
| Operate on the selected Native model face only. | |
| void | nx_native_flash_model_fault (const nx_flash_port_t *binding, size_t pulse_count) |
| Operate on the selected Native model face only. | |
| void | nx_native_watchdog_model_boot (const nx_watchdog_port_t *binding, uint32_t causes) |
| Operate on the selected Native model face only. | |
| bool | nx_native_watchdog_model_expired (const nx_watchdog_port_t *binding) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_exti_model_configure (const nx_exti_port_t *binding, uint8_t line, nx_exti_edge_t edge, nx_exti_event_t *events, size_t capacity) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_exti_model_emit (const nx_exti_port_t *binding, uint8_t line, nx_exti_edge_t edge) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_pwm_model_configure (const nx_pwm_port_t *binding, uint32_t tick_hz, uint32_t period_ticks) |
| Operate on the selected Native model face only. | |
| nx_result_t | nx_native_adc_model_configure (const nx_adc_port_t *binding, const uint16_t *samples, size_t count, uint8_t resolution_bits, uint32_t reference_mv) |
| Operate on the selected Native model face only. | |
| void | nx_native_adc_model_fault (const nx_adc_port_t *binding, size_t sample_count) |
| Operate on the selected Native model face only. | |
| void | nx_native_spi_model_async_configure (const nx_spi_port_t *binding, bool automatic_irq) |
| Choose explicit or automatic modeled SPI IRQ stepping. | |
| void | nx_native_spi_model_irq_step (const nx_spi_port_t *binding) |
| Inject one bounded SPI byte/idle event on the exact Native bus. | |
| void | nx_native_spi_model_drain_hold (const nx_spi_port_t *binding, bool hold) |
| Inject inability to prove SPI hardware drain. | |
| nx_result_t | nx_native_uart_model_idle (const nx_uart_port_t *binding) |
| Inject UART IDLE and publish its current valid byte prefix. | |
| nx_result_t | nx_native_adc_model_trigger (const nx_adc_port_t *binding) |
| Inject one ADC timer-trigger scan into a free selected block. | |
Variables | |
| const nx_gpio_port_t *const | nx_native_gpio |
| Fixed model bindings; no allocation, lookup, probe or construction. | |
| const nx_uart_port_t *const | nx_native_uart |
| const nx_spi_endpoint_t *const | nx_native_spi |
| const nx_spi_port_t *const | nx_native_spi_port |
| const nx_i2c_port_t *const | nx_native_i2c_port |
| const nx_i2c_endpoint_t *const | nx_native_i2c |
| const nx_flash_port_t *const | nx_native_flash |
| const nx_watchdog_port_t *const | nx_native_watchdog |
| const nx_exti_port_t *const | nx_native_exti |
| const nx_pwm_port_t *const | nx_native_pwm |
| const nx_adc_port_t *const | nx_native_adc |
Explicit host-model fixtures; no physical MCU qualification.
Definition in file model.h.
| nx_result_t nx_native_adc_configure | ( | const uint16_t * | samples, |
| size_t | count, | ||
| uint8_t | resolution_bits, | ||
| uint32_t | reference_mv ) |
Configure fixed ADC raw-count sequence and format.
| [in] | samples | Fixture-owned nominal sample sequence. |
| [in] | count | Positive channel count. |
| [in] | resolution_bits | One through sixteen. |
| [in] | reference_mv | Positive nominal reference voltage. |
| void nx_native_adc_fault | ( | size_t | sample_count | ) |
Inject ADC failure after a prefix of complete samples.
| [in] | sample_count | Complete samples allowed; SIZE_MAX disables. |
| nx_result_t nx_native_adc_model_configure | ( | const nx_adc_port_t * | binding, |
| const uint16_t * | samples, | ||
| size_t | count, | ||
| uint8_t | resolution_bits, | ||
| uint32_t | reference_mv ) |
Operate on the selected Native model face only.
| void nx_native_adc_model_fault | ( | const nx_adc_port_t * | binding, |
| size_t | sample_count ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_adc_model_trigger | ( | const nx_adc_port_t * | binding | ) |
Inject one ADC timer-trigger scan into a free selected block.
| nx_result_t nx_native_clock_advance | ( | uint64_t | duration_us | ) |
Advance deterministic time without an implicit hardware IRQ.
| [in] | duration_us | Positive or zero microsecond increment. |
| nx_result_t nx_native_clock_configure | ( | bool | enabled, |
| nx_time_us_t | now ) |
Switch host model to a deterministic clock domain.
| [in] | enabled | True selects manual clock, false real monotonic. |
| [in] | now | Initial manual microsecond value, below UINT64_MAX. |
| nx_result_t nx_native_exti_configure | ( | uint8_t | line, |
| nx_exti_edge_t | edge, | ||
| nx_exti_event_t * | events, | ||
| size_t | capacity ) |
Configure exact storage for one static EXTI line.
| [in] | line | Zero through fifteen. |
| [in] | edge | RISING/FALLING/BOTH selection. |
| [in,out] | events | Fixture-owned queue storage. |
| [in] | capacity | Positive event capacity. |
| nx_result_t nx_native_exti_emit | ( | uint8_t | line, |
| nx_exti_edge_t | edge ) |
Inject a timestamped selected edge fact.
| [in] | line | Configured static line. |
| [in] | edge | RISING or FALLING occurrence. |
| nx_result_t nx_native_exti_model_configure | ( | const nx_exti_port_t * | binding, |
| uint8_t | line, | ||
| nx_exti_edge_t | edge, | ||
| nx_exti_event_t * | events, | ||
| size_t | capacity ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_exti_model_emit | ( | const nx_exti_port_t * | binding, |
| uint8_t | line, | ||
| nx_exti_edge_t | edge ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_flash_configure | ( | uint8_t * | memory, |
| const nx_flash_geometry_t * | geometry ) |
Configure physical-geometry RAM model, clearly nonpersistent.
| [in,out] | memory | Caller-owned geometry-sized bytes; erased to 0xff. |
| [in] | geometry | Caller-owned immutable contiguous sector geometry. |
| void nx_native_flash_fault | ( | size_t | pulse_count | ) |
Inject program/erase failure after complete modeled pulses.
| [in] | pulse_count | Complete pulses allowed; SIZE_MAX disables fault. |
| nx_result_t nx_native_flash_model_configure | ( | const nx_flash_port_t * | binding, |
| uint8_t * | memory, | ||
| const nx_flash_geometry_t * | geometry ) |
Operate on the selected Native model face only.
| void nx_native_flash_model_fault | ( | const nx_flash_port_t * | binding, |
| size_t | pulse_count ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_gpio_configure | ( | uint32_t | mask, |
| uint32_t | initial ) |
Configure the fixed GPIO model after writer quiescence.
| [in] | mask | Authorized input/output bit mask. |
| [in] | initial | Initial output snapshot within mask. |
| void nx_native_gpio_input | ( | uint32_t | value | ) |
Inject one GPIO input snapshot in the deterministic model.
| [in] | value | Physical-port snapshot; read masks unauthorized bits. |
| void nx_native_gpio_model_input | ( | const nx_gpio_port_t * | binding, |
| uint32_t | value ) |
Operate on the selected Native model face only.
| uint32_t nx_native_gpio_model_output | ( | const nx_gpio_port_t * | binding | ) |
Operate on the selected Native model face only.
| uint32_t nx_native_gpio_output | ( | void | ) |
Observe output state for a host behavioral assertion.
| nx_result_t nx_native_i2c_configure | ( | uint8_t * | memory, |
| size_t | length, | ||
| uint8_t | address ) |
Configure one 7-bit-address register-file I2C model.
| [in,out] | memory | Caller-owned register bytes retained by fixture. |
| [in] | length | Positive register capacity, at most 256. |
| [in] | address | Valid nonreserved 7-bit address. |
| void nx_native_i2c_fault | ( | nx_result_t | result, |
| bool | stuck ) |
Inject NACK, arbitration loss or a stuck bus.
| [in] | result | Success disables fault; NACK/ARBITRATION/IO supported. |
| [in] | stuck | True makes explicit recovery fail until released. |
| nx_result_t nx_native_i2c_model_configure | ( | const nx_i2c_endpoint_t * | binding, |
| uint8_t * | memory, | ||
| size_t | length, | ||
| uint8_t | address ) |
Operate on the selected Native model face only.
| void nx_native_i2c_model_fault | ( | const nx_i2c_port_t * | binding, |
| nx_result_t | result, | ||
| bool | stuck ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_pwm_configure | ( | uint32_t | tick_hz, |
| uint32_t | period_ticks ) |
Configure fixed PWM model timer facts after writer quiescence.
| [in] | tick_hz | Positive post-prescaler frequency. |
| [in] | period_ticks | Fixed shared-base positive period. |
| nx_result_t nx_native_pwm_model_configure | ( | const nx_pwm_port_t * | binding, |
| uint32_t | tick_hz, | ||
| uint32_t | period_ticks ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_spi_configure | ( | uint8_t * | registers, |
| size_t | length ) |
Configure a fixed SPI echo or register-file model.
| [in,out] | registers | Optional caller-owned register bytes; NULL is echo. |
| [in] | length | Register capacity; zero only for echo mode. |
| bool nx_native_spi_cs_active | ( | void | ) |
Check the modeled CS level after a transaction.
| void nx_native_spi_fault | ( | size_t | fail_after, |
| bool | busy ) |
Inject bounded SPI partial failure or controller occupancy.
| [in] | fail_after | Byte index to fail at, SIZE_MAX disables fault. |
| [in] | busy | True rejects transactions without CS/buffer access. |
| void nx_native_spi_model_async_configure | ( | const nx_spi_port_t * | binding, |
| bool | automatic_irq ) |
Choose explicit or automatic modeled SPI IRQ stepping.
| nx_result_t nx_native_spi_model_configure | ( | const nx_spi_endpoint_t * | binding, |
| uint8_t * | registers, | ||
| size_t | length ) |
Operate on the selected Native model face only.
| bool nx_native_spi_model_cs_active | ( | const nx_spi_endpoint_t * | binding | ) |
Operate on the selected Native model face only.
| void nx_native_spi_model_drain_hold | ( | const nx_spi_port_t * | binding, |
| bool | hold ) |
Inject inability to prove SPI hardware drain.
| void nx_native_spi_model_fault | ( | const nx_spi_port_t * | binding, |
| size_t | fail_after, | ||
| bool | busy ) |
Operate on the selected Native model face only.
| void nx_native_spi_model_irq_step | ( | const nx_spi_port_t * | binding | ) |
Inject one bounded SPI byte/idle event on the exact Native bus.
| nx_result_t nx_native_uart_configure | ( | const nx_native_uart_config_t * | config | ) |
Configure exact RX/TX fixture capacities on the fixed UART.
| [in] | config | Caller-owned selected-profile storage description. |
| void nx_native_uart_fault | ( | bool | start_failure, |
| bool | hold_drain ) |
Configure start failure or inability to prove hardware drain.
| [in] | start_failure | Fail after direct admission, not as rejection. |
| [in] | hold_drain | Retain QUARANTINED request until explicitly released. |
| void nx_native_uart_irq_step | ( | void | ) |
Execute one deterministic TX IRQ byte/TC event.
| nx_result_t nx_native_uart_model_configure | ( | const nx_uart_port_t * | binding, |
| const nx_native_uart_config_t * | config ) |
Operate on the selected Native model face only.
| void nx_native_uart_model_fault | ( | const nx_uart_port_t * | binding, |
| bool | start_failure, | ||
| bool | hold_drain ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_uart_model_idle | ( | const nx_uart_port_t * | binding | ) |
Inject UART IDLE and publish its current valid byte prefix.
| nx_result_t nx_native_uart_model_irq_configure | ( | const nx_uart_port_t * | binding, |
| const nx_irq_policy_t * | policy, | ||
| const nx_irq_source_t * | source ) |
Copy explicit IRQ facts into a quiescent host UART model.
| [in] | binding | Configured Native UART face with no IRQ users. |
| [in] | policy | Immutable CPU/kernel facts copied during this call. |
| [in] | source | Actual modeled publisher facts copied during call. |
| void nx_native_uart_model_irq_step | ( | const nx_uart_port_t * | binding | ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_uart_model_receive | ( | const nx_uart_port_t * | binding, |
| uint8_t | byte, | ||
| uint32_t | flags ) |
Operate on the selected Native model face only.
| size_t nx_native_uart_model_transmitted | ( | const nx_uart_port_t * | binding | ) |
Operate on the selected Native model face only.
| nx_result_t nx_native_uart_receive | ( | uint8_t | byte, |
| uint32_t | flags ) |
Inject one RX IRQ fact into bounded selected-profile storage.
| [in] | byte | Received byte; ignored for NO_BYTE status facts. |
| [in] | flags | NX_UART_EVENT_* error facts; zero for normal reception. |
| size_t nx_native_uart_transmitted | ( | void | ) |
Observe captured TX bytes.
| nx_result_t nx_native_uart_tx_validate | ( | void * | context, |
| const nx_uart_tx_request_t * | request ) |
Validate exact Native TX context for selected RS485 binding.
| [in] | context | Configured Native UART face's exact context. |
| [in] | request | Live READY/QUEUED descriptor, never retained. |
| void nx_native_watchdog_boot | ( | uint32_t | causes | ) |
Reset the watchdog fixture as a simulated new boot.
| [in] | causes | Latched reset cause mask. |
| bool nx_native_watchdog_expired | ( | void | ) |
Observe expiration of the enabled deterministic IWDG.
| void nx_native_watchdog_model_boot | ( | const nx_watchdog_port_t * | binding, |
| uint32_t | causes ) |
Operate on the selected Native model face only.
| bool nx_native_watchdog_model_expired | ( | const nx_watchdog_port_t * | binding | ) |
Operate on the selected Native model face only.
|
extern |
|
extern |
|
extern |
|
extern |
Fixed model bindings; no allocation, lookup, probe or construction.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |