Subsections of Files

cdx_cal.h

Ginmake identity measurements and restored model calibration access.

CM7 owns XCP and persistence; live multi-value updates can tear.

Source code: View source

Contents

Macros

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.

Typedefs

Typedef Description
CDX_CAL_IDENTITY Read-only firmware identity measurement exposed by CM7 XCP.

Functions

Function Description
CDX_calibration_data_get Obtain the active shared calibration data without copying defaults.

Macros

CDX_CAL_IDENTITY_ADDRESS

1#define CDX_CAL_IDENTITY_ADDRESS 0x20200418u

Read-only XCP EPK address in CM7’s view of the model descriptor.

CDX_CAL_IDENTITY_SIZE

1#define CDX_CAL_IDENTITY_SIZE 160u

Identity span: EPK, IPC hash and model name, including zero padding.

CDX_CAL_PARAMETERS_ADDRESS

1#define CDX_CAL_PARAMETERS_ADDRESS 0xf000u

Virtual XCP base of the declared shared calibration span, not a C pointer.

Typedefs

CDX_CAL_IDENTITY

Read-only firmware identity measurement exposed by CM7 XCP.

1typedef struct CDX_CAL_IDENTITY_STRUCT CDX_CAL_IDENTITY

Note: 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.

Functions

CDX_calibration_data_get

Obtain the active shared calibration data without copying defaults.

1void * CDX_calibration_data_get(uint32_t *size)

Returns

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.

Parameters

  • uint32_t * size: Nonnull output receives the model-declared size, zero on failure.

Location: cdx_cal.h:81

cdx_can_bus_id.h

Model-local CAN bus identifiers for Model IPC.

Source code: View source

Contents

Macros

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.

Typedefs

Typedef Description
CDX_CAN_BUS_ID Model-local logical bus identifier, not a physical CM4 controller.

Macros

CDX_CAN_BUS_ID_IPC

1#define CDX_CAN_BUS_ID_IPC 1u

Sole supported bus, mapped to CM7’s Model IPC/CAN3 port.

CDX_CAN_BUS_ID_CAN1

1#define CDX_CAN_BUS_ID_CAN1 CDX_CAN_BUS_ID_IPC

Legacy numeric-port alias for the same Model IPC endpoint.

Typedefs

CDX_CAN_BUS_ID

Model-local logical bus identifier, not a physical CM4 controller.

1typedef uint8_t CDX_CAN_BUS_ID

cdx_can.h

Foreground model CAN/FD frame and Model IPC transmission API.

Source code: View source

Contents

Macros

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

Typedefs

Typedef Description
CDX_DATA_64
CDX_CAN_FRAME_FLAGS
CDX_CAN_FRAME
CDX_CAN_TX_PARAMS

Functions

Function Description
CDX_can_frame_flags_is_std
CDX_can_frame_flags_is_ext
CDX_can_frame_flags_is_fd_std
CDX_can_frame_flags_is_fd_ext
CDX_can_tx_enqueue_copy
CDX_can_is_timed_out_ms
CDX_can_read_signal_u32_le
CDX_can_read_signal_u64_le
CDX_can_read_signal_u32_be
CDX_can_read_signal_u64_be

Macros

CDX_CAN_FRAME_FLAG_NONE

1#define CDX_CAN_FRAME_FLAG_NONE

CDX_CAN_FRAME_FLAG_IDE

1#define CDX_CAN_FRAME_FLAG_IDE

CDX_CAN_FRAME_FLAG_EDL

1#define CDX_CAN_FRAME_FLAG_EDL

CDX_CAN_FRAME_FLAG_BRS

1#define CDX_CAN_FRAME_FLAG_BRS

CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE

1#define CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE

Typedefs

CDX_DATA_64

CDX_CAN_FRAME_FLAGS

CDX_CAN_FRAME

CDX_CAN_TX_PARAMS

Functions

CDX_can_frame_flags_is_std

1 CDX_can_frame_flags_is_std

CDX_can_frame_flags_is_ext

1 CDX_can_frame_flags_is_ext

CDX_can_frame_flags_is_fd_std

1 CDX_can_frame_flags_is_fd_std

CDX_can_frame_flags_is_fd_ext

1 CDX_can_frame_flags_is_fd_ext

CDX_can_tx_enqueue_copy

1 CDX_can_tx_enqueue_copy

CDX_can_is_timed_out_ms

1 CDX_can_is_timed_out_ms

CDX_can_read_signal_u32_le

1 CDX_can_read_signal_u32_le

CDX_can_read_signal_u64_le

1 CDX_can_read_signal_u64_le

CDX_can_read_signal_u32_be

1 CDX_can_read_signal_u32_be

CDX_can_read_signal_u64_be

1 CDX_can_read_signal_u64_be

cdx_fast_io.h

Foreground model access to low-latency ADC snapshots and physical CAN.

Source code: View source

Contents

Typedefs

Typedef Description
CDX_ADC_SNAPSHOT Completed external ADC scan; channels are sequentially sampled.

Variables

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.

Functions

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.

CDX_get_adc_1_raw

Read cached external input 1 in raw ADC counts.

Returns

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.

CDX_get_adc_2_raw

Read cached external input 2 in raw ADC counts.

Returns

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.

CDX_get_adc_3_raw

Read cached external input 3 in raw ADC counts.

Returns

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.

CDX_get_adc_4_raw

Read cached external input 4 in raw ADC counts.

Returns

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.

CDX_get_adc_5_raw

Read cached external input 5 in raw ADC counts.

Returns

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.

CDX_get_adc_6_raw

Read cached external input 6 in raw ADC counts.

Returns

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.

CDX_get_adc_7_raw

Read cached external input 7 in raw ADC counts.

Returns

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.

CDX_get_adc_8_raw

Read cached external input 8 in raw ADC counts.

Returns

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.

CDX_get_adc_1_voltage

Read cached external input 1 in nominal volts without calibration.

Returns

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.

CDX_get_adc_2_voltage

Read cached external input 2 in nominal volts without calibration.

Returns

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.

CDX_get_adc_3_voltage

Read cached external input 3 in nominal volts without calibration.

Returns

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.

CDX_get_adc_4_voltage

Read cached external input 4 in nominal volts without calibration.

Returns

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.

CDX_get_adc_5_voltage

Read cached external input 5 in nominal volts without calibration.

Returns

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.

CDX_get_adc_6_voltage

Read cached external input 6 in nominal volts without calibration.

Returns

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.

CDX_get_adc_7_voltage

Read cached external input 7 in nominal volts without calibration.

Returns

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.

CDX_get_adc_8_voltage

Read cached external input 8 in nominal volts without calibration.

Returns

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.

CDX_get_adc_1_valid

Test whether cached external input 1 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_2_valid

Test whether cached external input 2 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_3_valid

Test whether cached external input 3 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_4_valid

Test whether cached external input 4 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_5_valid

Test whether cached external input 5 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_6_valid

Test whether cached external input 6 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_7_valid

Test whether cached external input 7 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

CDX_get_adc_8_valid

Test whether cached external input 8 is valid.

Returns

1 for valid cached data, otherwise 0, including stale/offline scans.

Note: Foreground only; no acquisition. Refresh the cache once before step.

Typedefs

CDX_ADC_SNAPSHOT

Completed external ADC scan; channels are sequentially sampled.

1typedef struct CDX_ADC_SNAPSHOT_STRUCT CDX_ADC_SNAPSHOT

Variables

CDX_model_adc_raw

Model-owned ADC raw input cache, refreshed once before each model step.

1uint16_t CDX_model_adc_raw

Note: Bind read-only Simulink ImportedExtern data stores to these symbols. These values should not be modified by the model.

CDX_model_adc_valid_mask

Validity mask for the ADC raw input cache. Each bit corresponds to one channel.

1uint32_t CDX_model_adc_valid_mask

Each 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.

CDX_model_adc_sequence

Sequence number for the ADC snapshot.

1uint32_t CDX_model_adc_sequence

Note: Incremented on each new snapshot.

CDX_model_adc_timestamp_us

Timestamp of the ADC snapshot in microseconds.

1uint32_t CDX_model_adc_timestamp_us

Note: Wraps at 2^32 microseconds.

CDX_model_adc_fresh

Indicates whether the ADC snapshot is fresh for this session.

1uint8_t CDX_model_adc_fresh

CDX_model_adc_fresh is true if the ADC snapshot was updated by the Dash processor.

Functions

CDX_adc_snapshot_read

Copy a consistent external ADC scan without waiting for the Dash loop.

1CDX_STATUS CDX_adc_snapshot_read(CDX_ADC_SNAPSHOT *snapshot)

Returns

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().

Parameters

  • CDX_ADC_SNAPSHOT * snapshot: Nonnull output; unchanged on failure. Copy once at step entry.

Location: cdx_fast_io.h:70

CDX_model_inputs_refresh

Refresh the input cache with one bounded snapshot read.

1CDX_STATUS CDX_model_inputs_refresh(uint32_t now_us, uint32_t max_stale_us)

Returns

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.

Parameters

  • uint32_t now_us: Current CM4-local microseconds, sampled once at step entry.
  • uint32_t max_stale_us: Maximum time without a new scan, 1..1000000 us.

Location: cdx_fast_io.h:79

CDX_can_tx_urgent_enqueue

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)

Returns

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.

Parameters

  • uint32_t port: Physical CAN port: 0 for CAN1, 1 for CAN2 (not logical IPC).
  • CDX_CAN_TX_PARAMS const * params: Nonnull frame description; deadline_ticks must be zero and only IDE, EDL and BRS flags are supported. FD lengths must match a CAN-FD DLC. Use lifetime_us for expiry instead.
  • CDX_DATA_64 const * data: Copied aligned payload; NULL only when length_bytes is zero.
  • uint32_t lifetime_us: Maximum age, 1..1000000 us, from the latest CM7 fast clock publication. Expiry is conservative by clock-publication age, not extended.

Location: cdx_fast_io.h:212

cdx_memory.h

Bounded access to explicitly registered model-owned memory.

Source code: View source

Contents

Functions

Function Description
CDX_memory_region_register
CDX_memory_read
CDX_memory_write
CDX_memory_read_u8
CDX_memory_read_u16
CDX_memory_read_u32
CDX_memory_read_u64
CDX_memory_write_u8
CDX_memory_write_u16
CDX_memory_write_u32
CDX_memory_write_u64

Functions

CDX_memory_region_register

1 CDX_memory_region_register

CDX_memory_read

1 CDX_memory_read

CDX_memory_write

1 CDX_memory_write

CDX_memory_read_u8

1 CDX_memory_read_u8

CDX_memory_read_u16

1 CDX_memory_read_u16

CDX_memory_read_u32

1 CDX_memory_read_u32

CDX_memory_read_u64

1 CDX_memory_read_u64

CDX_memory_write_u8

1 CDX_memory_write_u8

CDX_memory_write_u16

1 CDX_memory_write_u16

CDX_memory_write_u32

1 CDX_memory_write_u32

CDX_memory_write_u64

1 CDX_memory_write_u64

cdx_status.h

CDX API status values compatible with generated model code.

Source code: View source

Contents

Macros

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.

Typedefs

Typedef Description
CDX_STATUS API result code; zero means success, nonzero values are call-specific.

Macros

CDX_STATUS_OK

1#define CDX_STATUS_OK 0u

Operation succeeded.

CDX_STATUS_IN_PROGRESS

1#define CDX_STATUS_IN_PROGRESS 1u

Operation accepted but not yet complete.

CDX_STATUS_TIMEOUT

1#define CDX_STATUS_TIMEOUT 2u

Deadline or timeout expired.

CDX_STATUS_QUEUE_FULL

1#define CDX_STATUS_QUEUE_FULL 3u

Bounded queue or registry is full; new request was not accepted.

CDX_STATUS_NO_DATA

1#define CDX_STATUS_NO_DATA 4u

No data available; also a non-faulting RX callback result.

CDX_STATUS_NOT_IMPLEMENTED

1#define CDX_STATUS_NOT_IMPLEMENTED 5u

Requested API feature is not implemented.

CDX_STATUS_MESSAGE_IGNORED

1#define CDX_STATUS_MESSAGE_IGNORED 6u

RX message intentionally ignored without faulting the runtime.

CDX_STATUS_BAD_PARAM

1#define CDX_STATUS_BAD_PARAM 7u

Invalid pointer, value, identifier, permission or range.

CDX_STATUS_BAD_LENGTH

1#define CDX_STATUS_BAD_LENGTH 8u

Invalid data length; not interchangeable with BAD_PARAM for all APIs.

CDX_STATUS_CASE_NOT_HANDLED

1#define CDX_STATUS_CASE_NOT_HANDLED 12u

Generated decoder has no matching case; faults a runtime RX callback.

CDX_STATUS_MULTIPLEX_IGNORED

1#define CDX_STATUS_MULTIPLEX_IGNORED 13u

Unselected multiplexed signal ignored without faulting the runtime.

CDX_STATUS_IPC_OFFLINE

1#define CDX_STATUS_IPC_OFFLINE 41u

Model IPC is not RUNNING or its session is unavailable.

Typedefs

CDX_STATUS

API result code; zero means success, nonzero values are call-specific.

1typedef uint16_t CDX_STATUS

cdx_time.h

Receiver-local runtime timestamps and wrap-safe deadline helpers.

Source code: View source

Contents

Macros

Macro Description
CDX_MICROSEC_32_DEADLINE_MAX Largest unambiguous future deadline interval in microseconds.

Typedefs

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.

Functions

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

Macros

CDX_MICROSEC_32_DEADLINE_MAX

1#define CDX_MICROSEC_32_DEADLINE_MAX 0x7fffffffu

Largest unambiguous future deadline interval in microseconds.

Typedefs

CDX_TICKS_32

Wrapping microsecond ticks; one tick is one microsecond, not one ms.

1typedef uint32_t CDX_TICKS_32

CDX_MILLISEC_32

Wrapping 32-bit milliseconds.

1typedef uint32_t CDX_MILLISEC_32

CDX_MICROSEC_32

Wrapping 32-bit microseconds.

1typedef uint32_t CDX_MICROSEC_32

CDX_MICROSEC_64

Extended 64-bit microseconds, maintained by foreground polling.

1typedef uint64_t CDX_MICROSEC_64

Functions

CDX_ticks_now

1 CDX_ticks_now

CDX_microsec_32_now

1 CDX_microsec_32_now

CDX_microsec_64_now

1 CDX_microsec_64_now

CDX_millisec_32_now

1 CDX_millisec_32_now

CDX_millisec_32_from_ticks

1 CDX_millisec_32_from_ticks

CDX_microsec_deadline_remain

1 CDX_microsec_deadline_remain

CDX_ticks_deadline_from_millisec

1 CDX_ticks_deadline_from_millisec

cdx_utils.h

Byte ordering, sign extension and floating-point bit conversions.

Source code: View source

Contents

Typedefs

Typedef Description
bool8_t
real32_t
real64_t

Functions

Function Description
CDX_byteswap16
CDX_byteswap32
CDX_byteswap64
CDX_reinterpret_cast_u32
CDX_reinterpret_cast_u64
CDX_reinterpret_cast_f32
CDX_reinterpret_cast_f64
CDX_sign_extend_u8
CDX_sign_extend_u16
CDX_sign_extend_u32
CDX_sign_extend_u64
CDX_f32_rounds_to_zero

Typedefs

bool8_t

real32_t

real64_t

Functions

CDX_byteswap16

1 CDX_byteswap16

CDX_byteswap32

1 CDX_byteswap32

CDX_byteswap64

1 CDX_byteswap64

CDX_reinterpret_cast_u32

1 CDX_reinterpret_cast_u32

CDX_reinterpret_cast_u64

1 CDX_reinterpret_cast_u64

CDX_reinterpret_cast_f32

1 CDX_reinterpret_cast_f32

CDX_reinterpret_cast_f64

1 CDX_reinterpret_cast_f64

CDX_sign_extend_u8

1 CDX_sign_extend_u8

CDX_sign_extend_u16

1 CDX_sign_extend_u16

CDX_sign_extend_u32

1 CDX_sign_extend_u32

CDX_sign_extend_u64

1 CDX_sign_extend_u64

CDX_f32_rounds_to_zero

1 CDX_f32_rounds_to_zero