Files
Files Documentation
The following files are available:
The following files are available:
Statically linked callbacks required from the client model.
Source code: View source
| Function | Description |
|---|---|
| CDX_app_system_init | |
| CDX_app_model_period_us_get | |
| CDX_app_model_init | |
| CDX_app_model_step | |
| CDX_app_can_rx_handle |
1 CDX_app_system_init1 CDX_app_model_period_us_get1 CDX_app_model_init1 CDX_app_model_step1 CDX_app_can_rx_handleGinmake identity measurements and restored model calibration access.
CM7 owns XCP and persistence; live multi-value updates can tear.
Source code: View source
| Macro | Description |
|---|---|
| CDX_CAL_IDENTITY_ADDRESS | Read-only XCP EPK address in CM7’s view of the model descriptor. |
| CDX_CAL_IDENTITY_SIZE | Identity span: EPK, IPC hash and model name, including zero padding. |
| CDX_CAL_PARAMETERS_ADDRESS | Virtual XCP base of the declared shared calibration span, not a C pointer. |
| Typedef | Description |
|---|---|
| CDX_CAL_IDENTITY | Read-only firmware identity measurement exposed by CM7 XCP. |
| Function | Description |
|---|---|
| CDX_calibration_data_get | Obtain the active shared calibration data without copying defaults. |
1#define CDX_CAL_IDENTITY_ADDRESS 0x20200418uRead-only XCP EPK address in CM7’s view of the model descriptor.
1#define CDX_CAL_IDENTITY_SIZE 160uIdentity span: EPK, IPC hash and model name, including zero padding.
1#define CDX_CAL_PARAMETERS_ADDRESS 0xf000uVirtual XCP base of the declared shared calibration span, not a C pointer.
Read-only firmware identity measurement exposed by CM7 XCP.
1typedef struct CDX_CAL_IDENTITY_STRUCT CDX_CAL_IDENTITYNote: This is a Ginmake description, not an additional allocated object. Model-specific writable persistent parameters belong in the model’s own annotated header or Simulink.Parameter inputs, not in this API header.
Obtain the active shared calibration data without copying defaults.
1void * CDX_calibration_data_get(uint32_t *size)Pointer into noncacheable shared RAM, or NULL without valid calibration.
Note: Available during CDX_app_system_init and model initialization after CM7 restores compatible stored values. Valid only for the current model session. The same span is registered with CDX_memory_* at its actual 32-bit address. Do not overwrite it with model defaults during initialization. No inter-core mutex or model pause is provided; grouped writes and snapshots may tear.
Location: cdx_cal.h:81
Model-local CAN bus identifiers for Model IPC.
Source code: View source
| Macro | Description |
|---|---|
| CDX_CAN_BUS_ID_IPC | Sole supported bus, mapped to CM7’s Model IPC/CAN3 port. |
| CDX_CAN_BUS_ID_CAN1 | Legacy numeric-port alias for the same Model IPC endpoint. |
| Typedef | Description |
|---|---|
| CDX_CAN_BUS_ID | Model-local logical bus identifier, not a physical CM4 controller. |
1#define CDX_CAN_BUS_ID_IPC 1uSole supported bus, mapped to CM7’s Model IPC/CAN3 port.
1#define CDX_CAN_BUS_ID_CAN1 CDX_CAN_BUS_ID_IPCLegacy numeric-port alias for the same Model IPC endpoint.
Model-local logical bus identifier, not a physical CM4 controller.
1typedef uint8_t CDX_CAN_BUS_IDForeground model CAN/FD frame and Model IPC transmission API.
Source code: View source
| Macro | Description |
|---|---|
| CDX_CAN_FRAME_FLAG_NONE | |
| CDX_CAN_FRAME_FLAG_IDE | |
| CDX_CAN_FRAME_FLAG_EDL | |
| CDX_CAN_FRAME_FLAG_BRS | |
| CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE |
| Typedef | Description |
|---|---|
| CDX_DATA_64 | |
| CDX_CAN_FRAME_FLAGS | |
| CDX_CAN_FRAME | |
| CDX_CAN_TX_PARAMS |
1#define CDX_CAN_FRAME_FLAG_NONE1#define CDX_CAN_FRAME_FLAG_IDE1#define CDX_CAN_FRAME_FLAG_EDL1#define CDX_CAN_FRAME_FLAG_BRS1#define CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE1 CDX_can_frame_flags_is_std1 CDX_can_frame_flags_is_ext1 CDX_can_frame_flags_is_fd_std1 CDX_can_frame_flags_is_fd_ext1 CDX_can_tx_enqueue_copy1 CDX_can_is_timed_out_ms1 CDX_can_read_signal_u32_le1 CDX_can_read_signal_u64_le1 CDX_can_read_signal_u32_be1 CDX_can_read_signal_u64_beCopy individual DBC signals while preserving surrounding payload bits.
Source code: View source
| Function | Description |
|---|---|
| CDX_dbc_copy_u32_le | |
| CDX_dbc_copy_u64_le | |
| CDX_dbc_copy_u32_be | |
| CDX_dbc_copy_u64_be |
1 CDX_dbc_copy_u32_le1 CDX_dbc_copy_u64_le1 CDX_dbc_copy_u32_be1 CDX_dbc_copy_u64_beUnsigned DBC signal packing for classic CAN and CAN-FD buffers.
Source code: View source
| Function | Description |
|---|---|
| CDX_dbc_pack_u32_le | |
| CDX_dbc_pack_u64_le | |
| CDX_dbc_pack_u32_be | |
| CDX_dbc_pack_u64_be |
1 CDX_dbc_pack_u32_le1 CDX_dbc_pack_u64_le1 CDX_dbc_pack_u32_be1 CDX_dbc_pack_u64_beUnsigned DBC signal unpacking from classic CAN and CAN-FD buffers.
Source code: View source
| Function | Description |
|---|---|
| CDX_dbc_unpack_u32_le | |
| CDX_dbc_unpack_u64_le | |
| CDX_dbc_unpack_u32_be | |
| CDX_dbc_unpack_u64_be |
1 CDX_dbc_unpack_u32_le1 CDX_dbc_unpack_u64_le1 CDX_dbc_unpack_u32_be1 CDX_dbc_unpack_u64_beForeground model access to low-latency ADC snapshots and physical CAN.
Source code: View source
| Typedef | Description |
|---|---|
| CDX_ADC_SNAPSHOT | Completed external ADC scan; channels are sequentially sampled. |
| Variable | Description |
|---|---|
| CDX_model_adc_raw | Model-owned ADC raw input cache, refreshed once before each model step. |
| CDX_model_adc_valid_mask | Validity mask for the ADC raw input cache. Each bit corresponds to one channel. |
| CDX_model_adc_sequence | Sequence number for the ADC snapshot. |
| CDX_model_adc_timestamp_us | Timestamp of the ADC snapshot in microseconds. |
| CDX_model_adc_fresh | Indicates whether the ADC snapshot is fresh for this session. |
| Function | Description |
|---|---|
| CDX_adc_snapshot_read | Copy a consistent external ADC scan without waiting for the Dash loop. |
| CDX_model_inputs_refresh | Refresh the input cache with one bounded snapshot read. |
| CDX_can_tx_urgent_enqueue | Copy an urgent physical CAN frame, bypassing Dash Output processing. |
Read cached external input 1 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_1_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 2 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_2_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 3 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_3_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 4 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_4_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 5 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_5_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 6 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_6_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 7 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_7_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 8 in raw ADC counts.
Held 12-bit ADC counts; check CDX_get_adc_8_valid() before use.
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 1 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_1_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 2 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_2_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 3 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_3_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 4 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_4_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 5 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_5_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 6 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_6_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 7 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_7_valid().
Note: Foreground only; refresh the input cache once before the model step.
Read cached external input 8 in nominal volts without calibration.
Held ADC counts times 0.001421 V/count; check CDX_get_adc_8_valid().
Note: Foreground only; refresh the input cache once before the model step.
Test whether cached external input 1 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 2 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 3 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 4 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 5 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 6 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 7 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Test whether cached external input 8 is valid.
1 for valid cached data, otherwise 0, including stale/offline scans.
Note: Foreground only; no acquisition. Refresh the cache once before step.
Completed external ADC scan; channels are sequentially sampled.
1typedef struct CDX_ADC_SNAPSHOT_STRUCT CDX_ADC_SNAPSHOTModel-owned ADC raw input cache, refreshed once before each model step.
1uint16_t CDX_model_adc_rawNote: Bind read-only Simulink ImportedExtern data stores to these symbols. These values should not be modified by the model.
Validity mask for the ADC raw input cache. Each bit corresponds to one channel.
1uint32_t CDX_model_adc_valid_maskEach bit in CDX_model_adc_valid_mask corresponds to one channel in CDX_model_adc_raw. A set bit indicates that the corresponding ADC value is valid. > Note: Values are held on failure but the valid_mask is cleared.
Sequence number for the ADC snapshot.
1uint32_t CDX_model_adc_sequenceNote: Incremented on each new snapshot.
Timestamp of the ADC snapshot in microseconds.
1uint32_t CDX_model_adc_timestamp_usNote: Wraps at 2^32 microseconds.
Indicates whether the ADC snapshot is fresh for this session.
1uint8_t CDX_model_adc_freshCDX_model_adc_fresh is true if the ADC snapshot was updated by the Dash processor.
Copy a consistent external ADC scan without waiting for the Dash loop.
1CDX_STATUS CDX_adc_snapshot_read(CDX_ADC_SNAPSHOT *snapshot)OK, BAD_PARAM, IPC_OFFLINE for absent/stale fast extension, or NO_DATA for an invalid scan or concurrent publication after two bounded attempts.
Note: Model callbacks only; no concurrent callers. Repeated reads can return the same sequence. No engineering scaling is applied. Timestamp wraps at 2^32 microseconds and is not directly comparable with CDX_ticks_now().
Location: cdx_fast_io.h:70
Refresh the input cache with one bounded snapshot read.
1CDX_STATUS CDX_model_inputs_refresh(uint32_t now_us, uint32_t max_stale_us)OK for usable cached data, TIMEOUT for stale data, or snapshot error.
Note: Foreground only. Timestamp remains CM7-local; staleness is measured independently using now_us. Rebinding the runtime resets this cache.
Location: cdx_fast_io.h:79
Copy an urgent physical CAN frame, bypassing Dash Output processing.
1CDX_STATUS CDX_can_tx_urgent_enqueue(uint32_t port, CDX_CAN_TX_PARAMS const *params, CDX_DATA_64 const *data, uint32_t lifetime_us)OK, BAD_PARAM, IPC_OFFLINE or QUEUE_FULL (newest request rejected).
Note: Model callbacks only, never interrupts or concurrent threads. Four frames per physical port. Acceptance is not delivery; unavailable ports, expiry, bus errors, stop/reset and session changes can discard requests. No completion callback or cancellation; an in-progress CAN frame cannot be preempted. Configured bus mode and CAN arbitration still apply.
Location: cdx_fast_io.h:212
Bounded access to explicitly registered model-owned memory.
Source code: View source
1 CDX_memory_region_register1 CDX_memory_read1 CDX_memory_write1 CDX_memory_read_u81 CDX_memory_read_u161 CDX_memory_read_u321 CDX_memory_read_u641 CDX_memory_write_u81 CDX_memory_write_u161 CDX_memory_write_u321 CDX_memory_write_u64CDX API status values compatible with generated model code.
Source code: View source
| Macro | Description |
|---|---|
| CDX_STATUS_OK | Operation succeeded. |
| CDX_STATUS_IN_PROGRESS | Operation accepted but not yet complete. |
| CDX_STATUS_TIMEOUT | Deadline or timeout expired. |
| CDX_STATUS_QUEUE_FULL | Bounded queue or registry is full; new request was not accepted. |
| CDX_STATUS_NO_DATA | No data available; also a non-faulting RX callback result. |
| CDX_STATUS_NOT_IMPLEMENTED | Requested API feature is not implemented. |
| CDX_STATUS_MESSAGE_IGNORED | RX message intentionally ignored without faulting the runtime. |
| CDX_STATUS_BAD_PARAM | Invalid pointer, value, identifier, permission or range. |
| CDX_STATUS_BAD_LENGTH | Invalid data length; not interchangeable with BAD_PARAM for all APIs. |
| CDX_STATUS_CASE_NOT_HANDLED | Generated decoder has no matching case; faults a runtime RX callback. |
| CDX_STATUS_MULTIPLEX_IGNORED | Unselected multiplexed signal ignored without faulting the runtime. |
| CDX_STATUS_IPC_OFFLINE | Model IPC is not RUNNING or its session is unavailable. |
| Typedef | Description |
|---|---|
| CDX_STATUS | API result code; zero means success, nonzero values are call-specific. |
1#define CDX_STATUS_OK 0uOperation succeeded.
1#define CDX_STATUS_IN_PROGRESS 1uOperation accepted but not yet complete.
1#define CDX_STATUS_TIMEOUT 2uDeadline or timeout expired.
1#define CDX_STATUS_QUEUE_FULL 3uBounded queue or registry is full; new request was not accepted.
1#define CDX_STATUS_NO_DATA 4uNo data available; also a non-faulting RX callback result.
1#define CDX_STATUS_NOT_IMPLEMENTED 5uRequested API feature is not implemented.
1#define CDX_STATUS_MESSAGE_IGNORED 6uRX message intentionally ignored without faulting the runtime.
1#define CDX_STATUS_BAD_PARAM 7uInvalid pointer, value, identifier, permission or range.
1#define CDX_STATUS_BAD_LENGTH 8uInvalid data length; not interchangeable with BAD_PARAM for all APIs.
1#define CDX_STATUS_CASE_NOT_HANDLED 12uGenerated decoder has no matching case; faults a runtime RX callback.
1#define CDX_STATUS_MULTIPLEX_IGNORED 13uUnselected multiplexed signal ignored without faulting the runtime.
1#define CDX_STATUS_IPC_OFFLINE 41uModel IPC is not RUNNING or its session is unavailable.
API result code; zero means success, nonzero values are call-specific.
1typedef uint16_t CDX_STATUSReceiver-local runtime timestamps and wrap-safe deadline helpers.
Source code: View source
| Macro | Description |
|---|---|
| CDX_MICROSEC_32_DEADLINE_MAX | Largest unambiguous future deadline interval in microseconds. |
| Typedef | Description |
|---|---|
| CDX_TICKS_32 | Wrapping microsecond ticks; one tick is one microsecond, not one ms. |
| CDX_MILLISEC_32 | Wrapping 32-bit milliseconds. |
| CDX_MICROSEC_32 | Wrapping 32-bit microseconds. |
| CDX_MICROSEC_64 | Extended 64-bit microseconds, maintained by foreground polling. |
| Function | Description |
|---|---|
| CDX_ticks_now | |
| CDX_microsec_32_now | |
| CDX_microsec_64_now | |
| CDX_millisec_32_now | |
| CDX_millisec_32_from_ticks | |
| CDX_microsec_deadline_remain | |
| CDX_ticks_deadline_from_millisec |
1#define CDX_MICROSEC_32_DEADLINE_MAX 0x7fffffffuLargest unambiguous future deadline interval in microseconds.
Wrapping microsecond ticks; one tick is one microsecond, not one ms.
1typedef uint32_t CDX_TICKS_32Wrapping 32-bit milliseconds.
1typedef uint32_t CDX_MILLISEC_32Wrapping 32-bit microseconds.
1typedef uint32_t CDX_MICROSEC_32Extended 64-bit microseconds, maintained by foreground polling.
1typedef uint64_t CDX_MICROSEC_641 CDX_ticks_now1 CDX_microsec_32_now1 CDX_microsec_64_now1 CDX_millisec_32_now1 CDX_millisec_32_from_ticks1 CDX_microsec_deadline_remain1 CDX_ticks_deadline_from_millisecByte ordering, sign extension and floating-point bit conversions.
Source code: View source
| Typedef | Description |
|---|---|
| bool8_t | |
| real32_t | |
| real64_t |
1 CDX_byteswap161 CDX_byteswap321 CDX_byteswap641 CDX_reinterpret_cast_u321 CDX_reinterpret_cast_u641 CDX_reinterpret_cast_f321 CDX_reinterpret_cast_f641 CDX_sign_extend_u81 CDX_sign_extend_u161 CDX_sign_extend_u321 CDX_sign_extend_u641 CDX_f32_rounds_to_zero