Application Callbacks
Functions that the client model must implement with C linkage.
Called serially in foreground, never from an interrupt. Simulation implementations may forward these entry points to dynamically bound models.
Contents
Functions
| Function | Description |
|---|---|
| CDX_app_system_init | Initialize application resources once during CM4 startup. |
| CDX_app_model_period_us_get | Return the fixed execution period after application system setup. |
| CDX_app_model_init | Initialize the model before the runtime publishes READY. |
| CDX_app_model_step | Execute one due model step after queued RX callbacks. |
| CDX_app_can_rx_handle | Process one received CAN/FD frame before the next model step. |
Functions
CDX_app_system_init
Initialize application resources once during CM4 startup.
1CDX_STATUS CDX_app_system_init(void)retval
CDX_STATUS_OK: Application setup succeeded.
Returns
Any other status faults the runtime before period/model initialization and prevents READY. A model without system setup must return CDX_STATUS_OK.
Note: Called after platform setup, runtime binding and IPC validation, before CDX_app_model_period_us_get and CDX_app_model_init. Time and memory APIs are available; TX enqueue remains offline. Do not initialize runtime-owned MU, PIT, cache or shared IPC resources here. A CM4 reset/reload calls it again.
Parameters
- void
Location: cdx_app_functions.h:45
CDX_app_model_period_us_get
Return the fixed execution period after application system setup.
1uint32_t CDX_app_model_period_us_get(void)Returns
Period in microseconds, in the range 1..INT32_MAX.
Note: Called after CDX_app_system_init and before CDX_app_model_init. The runtime is bound; configuration loaded by system initialization may be used.
Parameters
- void
Location: cdx_app_functions.h:52
CDX_app_model_init
Initialize the model before the runtime publishes READY.
1CDX_STATUS CDX_app_model_init(void)retval
CDX_STATUS_OK: Initialization succeeded.
Returns
Any other status faults the model and prevents RUNNING.
Note: System initialization and period validation have succeeded before this call. The runtime is bound; TX enqueue remains offline.
Parameters
- void
Location: cdx_app_functions.h:60
CDX_app_model_step
Execute one due model step after queued RX callbacks.
1CDX_STATUS CDX_app_model_step(void)retval
CDX_STATUS_OK: Step completed successfully.
Returns
Any other status faults the model and discards queued TX frames.
Note: Called only while RUNNING; missed periods are counted, not replayed.
Parameters
- void
Location: cdx_app_functions.h:67
CDX_app_can_rx_handle
Process one received CAN/FD frame before the next model step.
1CDX_STATUS CDX_app_can_rx_handle(CDX_CAN_FRAME const *frame)retval
CDX_STATUS_OK: Frame handled.CDX_STATUS_MESSAGE_IGNORED: Frame intentionally ignored.CDX_STATUS_MULTIPLEX_IGNORED: Multiplexed frame not selected.CDX_STATUS_NO_DATA: No applicable data.
Returns
Any other status faults the model; implement an ignored result if the application does not handle received frames. Copy data to retain it.
Parameters
- CDX_CAN_FRAME const * frame: Nonnull borrowed frame; its payload is valid only in this call.
Location: cdx_app_functions.h:78