Subsections of CD6x Model API Reference
CDX_ADC_SNAPSHOT_STRUCT
Completed external ADC scan; channels are sequentially sampled.
Contents
Public Attributes
| Attribute | Description |
|---|---|
| sequence | Publication counter; wraps modulo 2^32. |
| timestamp_us | CM7-local (dash) scan-completion time, not CM4 (model) ticks. |
| valid_mask | Bit per available external input, zero on fault. |
| raw | External inputs 1..8, unsigned 12-bit averaged ADC. |
Public Attributes
Field: sequence
Publication counter; wraps modulo 2^32.
1uint32_t sequenceField: timestamp_us
CM7-local (dash) scan-completion time, not CM4 (model) ticks.
1uint32_t timestamp_usField: valid_mask
Bit per available external input, zero on fault.
1uint32_t valid_maskField: raw
External inputs 1..8, unsigned 12-bit averaged ADC.
1uint16_t rawCDX_CAL_IDENTITY_STRUCT
Read-only firmware identity measurement exposed by CM7 XCP.
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.
Contents
Public Attributes
| Attribute | Description |
|---|---|
| epk | Null-terminated read-only model EPK; unused bytes are zero. |
| ipc_dbc_hash | IPC DBC hash: 20 raw SHA-1 bytes then 12 zero bytes; all zero means absent. |
| name | User-selected model station name; defaults to the model/project name. |
Public Attributes
Field: epk
Null-terminated read-only model EPK; unused bytes are zero.
1uint8_t epkField: ipc_dbc_hash
IPC DBC hash: 20 raw SHA-1 bytes then 12 zero bytes; all zero means absent.
1uint8_t ipc_dbc_hashField: name
User-selected model station name; defaults to the model/project name.
1uint8_t nameFiles
Files Documentation
The following files are available:
Subsections of Files
cdx_app_functions.h
Statically linked callbacks required from the client model.
Source code: View source
Contents
Functions
| 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 |
Functions
CDX_app_system_init
1 CDX_app_system_initCDX_app_model_period_us_get
1 CDX_app_model_period_us_getCDX_app_model_init
1 CDX_app_model_initCDX_app_model_step
1 CDX_app_model_stepCDX_app_can_rx_handle
1 CDX_app_can_rx_handlecdx_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 0x20200418uRead-only XCP EPK address in CM7’s view of the model descriptor.
CDX_CAL_IDENTITY_SIZE
1#define CDX_CAL_IDENTITY_SIZE 160uIdentity span: EPK, IPC hash and model name, including zero padding.
CDX_CAL_PARAMETERS_ADDRESS
1#define CDX_CAL_PARAMETERS_ADDRESS 0xf000uVirtual 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_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.
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 1uSole 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_IPCLegacy 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_IDcdx_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
Macros
CDX_CAN_FRAME_FLAG_NONE
1#define CDX_CAN_FRAME_FLAG_NONECDX_CAN_FRAME_FLAG_IDE
1#define CDX_CAN_FRAME_FLAG_IDECDX_CAN_FRAME_FLAG_EDL
1#define CDX_CAN_FRAME_FLAG_EDLCDX_CAN_FRAME_FLAG_BRS
1#define CDX_CAN_FRAME_FLAG_BRSCDX_CAN_FRAME_FLAG_DISABLE_DEADLINE
1#define CDX_CAN_FRAME_FLAG_DISABLE_DEADLINETypedefs
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_stdCDX_can_frame_flags_is_ext
1 CDX_can_frame_flags_is_extCDX_can_frame_flags_is_fd_std
1 CDX_can_frame_flags_is_fd_stdCDX_can_frame_flags_is_fd_ext
1 CDX_can_frame_flags_is_fd_extCDX_can_tx_enqueue_copy
1 CDX_can_tx_enqueue_copyCDX_can_is_timed_out_ms
1 CDX_can_is_timed_out_msCDX_can_read_signal_u32_le
1 CDX_can_read_signal_u32_leCDX_can_read_signal_u64_le
1 CDX_can_read_signal_u64_leCDX_can_read_signal_u32_be
1 CDX_can_read_signal_u32_beCDX_can_read_signal_u64_be
1 CDX_can_read_signal_u64_becdx_dbc_copy.h
Copy individual DBC signals while preserving surrounding payload bits.
Source code: View source
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_copy_u32_le | |
| CDX_dbc_copy_u64_le | |
| CDX_dbc_copy_u32_be | |
| CDX_dbc_copy_u64_be |
Functions
CDX_dbc_copy_u32_le
1 CDX_dbc_copy_u32_leCDX_dbc_copy_u64_le
1 CDX_dbc_copy_u64_leCDX_dbc_copy_u32_be
1 CDX_dbc_copy_u32_beCDX_dbc_copy_u64_be
1 CDX_dbc_copy_u64_becdx_dbc_pack.h
Unsigned DBC signal packing for classic CAN and CAN-FD buffers.
Source code: View source
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_pack_u32_le | |
| CDX_dbc_pack_u64_le | |
| CDX_dbc_pack_u32_be | |
| CDX_dbc_pack_u64_be |
Functions
CDX_dbc_pack_u32_le
1 CDX_dbc_pack_u32_leCDX_dbc_pack_u64_le
1 CDX_dbc_pack_u64_leCDX_dbc_pack_u32_be
1 CDX_dbc_pack_u32_beCDX_dbc_pack_u64_be
1 CDX_dbc_pack_u64_becdx_dbc_unpack.h
Unsigned DBC signal unpacking from classic CAN and CAN-FD buffers.
Source code: View source
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_unpack_u32_le | |
| CDX_dbc_unpack_u64_le | |
| CDX_dbc_unpack_u32_be | |
| CDX_dbc_unpack_u64_be |
Functions
CDX_dbc_unpack_u32_le
1 CDX_dbc_unpack_u32_leCDX_dbc_unpack_u64_le
1 CDX_dbc_unpack_u64_leCDX_dbc_unpack_u32_be
1 CDX_dbc_unpack_u32_beCDX_dbc_unpack_u64_be
1 CDX_dbc_unpack_u64_becdx_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_SNAPSHOTVariables
CDX_model_adc_raw
Model-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.
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_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.
CDX_model_adc_sequence
Sequence number for the ADC snapshot.
1uint32_t CDX_model_adc_sequenceNote: Incremented on each new snapshot.
CDX_model_adc_timestamp_us
Timestamp of the ADC snapshot in microseconds.
1uint32_t CDX_model_adc_timestamp_usNote: Wraps at 2^32 microseconds.
CDX_model_adc_fresh
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.
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
Functions
CDX_memory_region_register
1 CDX_memory_region_registerCDX_memory_read
1 CDX_memory_readCDX_memory_write
1 CDX_memory_writeCDX_memory_read_u8
1 CDX_memory_read_u8CDX_memory_read_u16
1 CDX_memory_read_u16CDX_memory_read_u32
1 CDX_memory_read_u32CDX_memory_read_u64
1 CDX_memory_read_u64CDX_memory_write_u8
1 CDX_memory_write_u8CDX_memory_write_u16
1 CDX_memory_write_u16CDX_memory_write_u32
1 CDX_memory_write_u32CDX_memory_write_u64
1 CDX_memory_write_u64cdx_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 0uOperation succeeded.
CDX_STATUS_IN_PROGRESS
1#define CDX_STATUS_IN_PROGRESS 1uOperation accepted but not yet complete.
CDX_STATUS_TIMEOUT
1#define CDX_STATUS_TIMEOUT 2uDeadline or timeout expired.
CDX_STATUS_QUEUE_FULL
1#define CDX_STATUS_QUEUE_FULL 3uBounded queue or registry is full; new request was not accepted.
CDX_STATUS_NO_DATA
1#define CDX_STATUS_NO_DATA 4uNo data available; also a non-faulting RX callback result.
CDX_STATUS_NOT_IMPLEMENTED
1#define CDX_STATUS_NOT_IMPLEMENTED 5uRequested API feature is not implemented.
CDX_STATUS_MESSAGE_IGNORED
1#define CDX_STATUS_MESSAGE_IGNORED 6uRX message intentionally ignored without faulting the runtime.
CDX_STATUS_BAD_PARAM
1#define CDX_STATUS_BAD_PARAM 7uInvalid pointer, value, identifier, permission or range.
CDX_STATUS_BAD_LENGTH
1#define CDX_STATUS_BAD_LENGTH 8uInvalid data length; not interchangeable with BAD_PARAM for all APIs.
CDX_STATUS_CASE_NOT_HANDLED
1#define CDX_STATUS_CASE_NOT_HANDLED 12uGenerated decoder has no matching case; faults a runtime RX callback.
CDX_STATUS_MULTIPLEX_IGNORED
1#define CDX_STATUS_MULTIPLEX_IGNORED 13uUnselected multiplexed signal ignored without faulting the runtime.
CDX_STATUS_IPC_OFFLINE
1#define CDX_STATUS_IPC_OFFLINE 41uModel 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_STATUScdx_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 0x7fffffffuLargest 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_32CDX_MILLISEC_32
Wrapping 32-bit milliseconds.
1typedef uint32_t CDX_MILLISEC_32CDX_MICROSEC_32
Wrapping 32-bit microseconds.
1typedef uint32_t CDX_MICROSEC_32CDX_MICROSEC_64
Extended 64-bit microseconds, maintained by foreground polling.
1typedef uint64_t CDX_MICROSEC_64Functions
CDX_ticks_now
1 CDX_ticks_nowCDX_microsec_32_now
1 CDX_microsec_32_nowCDX_microsec_64_now
1 CDX_microsec_64_nowCDX_millisec_32_now
1 CDX_millisec_32_nowCDX_millisec_32_from_ticks
1 CDX_millisec_32_from_ticksCDX_microsec_deadline_remain
1 CDX_microsec_deadline_remainCDX_ticks_deadline_from_millisec
1 CDX_ticks_deadline_from_milliseccdx_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
Typedefs
bool8_t
real32_t
real64_t
Functions
CDX_byteswap16
1 CDX_byteswap16CDX_byteswap32
1 CDX_byteswap32CDX_byteswap64
1 CDX_byteswap64CDX_reinterpret_cast_u32
1 CDX_reinterpret_cast_u32CDX_reinterpret_cast_u64
1 CDX_reinterpret_cast_u64CDX_reinterpret_cast_f32
1 CDX_reinterpret_cast_f32CDX_reinterpret_cast_f64
1 CDX_reinterpret_cast_f64CDX_sign_extend_u8
1 CDX_sign_extend_u8CDX_sign_extend_u16
1 CDX_sign_extend_u16CDX_sign_extend_u32
1 CDX_sign_extend_u32CDX_sign_extend_u64
1 CDX_sign_extend_u64CDX_f32_rounds_to_zero
1 CDX_f32_rounds_to_zeroFunctions
Functions
Browse the API reference by owner or alphabetically.
Subsections of Functions
Functions (Alphabetical)
Functions (Alphabetical)
Total functions: 61
Functions by API
Total functions: 61
Application Callbacks
| Function | Description |
|---|---|
| CDX_app_can_rx_handle(CDX_CAN_FRAME const *frame) | Process one received CAN/FD frame before the next model step. |
| CDX_app_model_init(void) | Initialize the model before the runtime publishes READY. |
| CDX_app_model_period_us_get(void) | Return the fixed execution period after application system setup. |
| CDX_app_model_step(void) | Execute one due model step after queued RX callbacks. |
| CDX_app_system_init(void) | Initialize application resources once during CM4 startup. |
cdx_cal.h
| Function | Description |
|---|---|
| CDX_calibration_data_get(uint32_t *size) | Obtain the active shared calibration data without copying defaults. |
CDX Model CAN API
CDX DBC Signal Copying
| Function | Description |
|---|---|
| CDX_dbc_copy_u32_be(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits) | Copy a big-endian signal of up to 32 bits. |
| CDX_dbc_copy_u32_le(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits) | Copy a little-endian signal of up to 32 bits. |
| CDX_dbc_copy_u64_be(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits) | Copy a big-endian signal of up to 64 bits. |
| CDX_dbc_copy_u64_le(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits) | Copy a little-endian signal of up to 64 bits. |
CDX DBC Signal Packing
| Function | Description |
|---|---|
| CDX_dbc_pack_u32_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value) | Pack an unsigned, big-endian signal of up to 32 bits. |
| CDX_dbc_pack_u32_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value) | Pack an unsigned, little-endian signal of up to 32 bits. |
| CDX_dbc_pack_u64_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value) | Pack an unsigned, big-endian signal of up to 64 bits. |
| CDX_dbc_pack_u64_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value) | Pack an unsigned, little-endian signal of up to 64 bits. |
CDX DBC Signal Unpacking
| Function | Description |
|---|---|
| CDX_dbc_unpack_u32_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits) | Read an unsigned, big-endian signal of up to 32 bits. |
| CDX_dbc_unpack_u32_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits) | Read an unsigned, little-endian signal of up to 32 bits. |
| CDX_dbc_unpack_u64_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits) | Read an unsigned, big-endian signal of up to 64 bits. |
| CDX_dbc_unpack_u64_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits) | Read an unsigned, little-endian signal of up to 64 bits. |
cdx_fast_io.h
| Function | Description |
|---|---|
| CDX_adc_snapshot_read(CDX_ADC_SNAPSHOT *snapshot) | Copy a consistent external ADC scan without waiting for the Dash loop. |
| CDX_can_tx_urgent_enqueue(uint32_t port, CDX_CAN_TX_PARAMS const *params, CDX_DATA_64 const *data, uint32_t lifetime_us) | Copy an urgent physical CAN frame, bypassing Dash Output processing. |
| CDX_model_inputs_refresh(uint32_t now_us, uint32_t max_stale_us) | Refresh the input cache with one bounded snapshot read. |
CDX Model Memory Access
| Function | Description |
|---|---|
| CDX_memory_read(uint32_t address, uint8_t extension, uint32_t size, void *data) | Copy bytes from one registered region to caller-owned storage. |
| CDX_memory_read_u16(uint32_t address) | Read a 16-bit scalar through address extension zero. |
| CDX_memory_read_u32(uint32_t address) | Read a 32-bit scalar through address extension zero. |
| CDX_memory_read_u64(uint32_t address) | Read a 64-bit scalar through address extension zero. |
| CDX_memory_read_u8(uint32_t address) | Read an 8-bit scalar through address extension zero. |
| CDX_memory_region_register(uint32_t address, void *data, uint32_t size, int writable) | Register a non-overlapping model memory region during initialization. |
| CDX_memory_write(uint32_t address, uint8_t extension, uint32_t size, void const *data) | Copy bytes into one registered, writable model region. |
| CDX_memory_write_u16(uint32_t address, uint16_t value) | Write a 16-bit scalar through address extension zero. |
| CDX_memory_write_u32(uint32_t address, uint32_t value) | Write a 32-bit scalar through address extension zero. |
| CDX_memory_write_u64(uint32_t address, uint64_t value) | Write a 64-bit scalar through address extension zero. |
| CDX_memory_write_u8(uint32_t address, uint8_t value) | Write an 8-bit scalar through address extension zero. |
CDX Runtime Time
| Function | Description |
|---|---|
| CDX_microsec_32_now(void) | Read the local microsecond counter modulo 2^32. |
| CDX_microsec_64_now(void) | Read local microseconds with foreground-maintained wrap extension. |
| CDX_microsec_deadline_remain(CDX_MICROSEC_32 deadline) | Calculate microseconds remaining to a local absolute deadline. |
| CDX_millisec_32_from_ticks(CDX_TICKS_32 ticks) | Convert a recent past microsecond timestamp to local milliseconds. |
| CDX_millisec_32_now(void) | Read local milliseconds modulo 2^32. |
| CDX_ticks_deadline_from_millisec(CDX_MILLISEC_32 interval_ms) | Form a nonzero CAN deadline relative to the current local ticks. |
| CDX_ticks_now(void) | Read the current wrapping microsecond tick counter. |
CDX Numeric Utilities
| Function | Description |
|---|---|
| CDX_byteswap16(uint16_t value) | Reverse the byte order of a 16-bit integer. |
| CDX_byteswap32(uint32_t value) | Reverse the byte order of a 32-bit integer. |
| CDX_byteswap64(uint64_t value) | Reverse the byte order of a 64-bit integer. |
| CDX_f32_rounds_to_zero(float value) | Test whether rounding to the nearest integer gives zero. |
| CDX_reinterpret_cast_f32(uint32_t value) | Interpret an unsigned 32-bit integer as IEEE-754 binary32 bits. |
| CDX_reinterpret_cast_f64(uint64_t value) | Interpret an unsigned 64-bit integer as IEEE-754 binary64 bits. |
| CDX_reinterpret_cast_u32(float value) | Return the IEEE-754 binary32 representation of a float. |
| CDX_reinterpret_cast_u64(double value) | Return the IEEE-754 binary64 representation of a double. |
| CDX_sign_extend_u16(uint8_t bits, uint16_t value) | Sign-extend a raw signal to a 16-bit signed integer. |
| CDX_sign_extend_u32(uint8_t bits, uint32_t value) | Sign-extend a raw signal to a 32-bit signed integer. |
| CDX_sign_extend_u64(uint8_t bits, uint64_t value) | Sign-extend a raw signal to a 64-bit signed integer. |
| CDX_sign_extend_u8(uint8_t bits, uint8_t value) | Sign-extend a raw signal to an 8-bit signed integer. |
Modules
Modules Documentation
The following modules are available:
Subsections of Modules
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
CDX DBC Signal Copying
The same internal start-LSB offset is used in both buffers. Bit zero is the first byte’s least significant bit. Intel signals continue into increasing byte indices; Motorola signals continue into decreasing indices. Motorola offsets are not the external DBC start-MSB notation. Buffers may overlap: the complete signal is read before any destination bits change.
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_copy_u32_le | Copy a little-endian signal of up to 32 bits. |
| CDX_dbc_copy_u64_le | Copy a little-endian signal of up to 64 bits. |
| CDX_dbc_copy_u32_be | Copy a big-endian signal of up to 32 bits. |
| CDX_dbc_copy_u64_be | Copy a big-endian signal of up to 64 bits. |
Functions
CDX_dbc_copy_u32_le
Copy a little-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_copy_u32_le(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits)retval
CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.
Parameters
- void * dst: Nonnull writable destination buffer.
- uint32_t dst_size: Destination size in bytes.
- void const * src: Nonnull source buffer.
- uint32_t src_size: Source size in bytes.
- uint16_t offset: Internal least significant bit position in both buffers.
- uint8_t bits: Signal width, 1 through 32; must fit in both buffers.
Location: cdx_dbc_copy.h:49
CDX_dbc_copy_u64_le
Copy a little-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_copy_u64_le(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits)retval
CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.
Parameters
- void * dst: Nonnull writable destination buffer.
- uint32_t dst_size: Destination size in bytes.
- void const * src: Nonnull source buffer.
- uint32_t src_size: Source size in bytes.
- uint16_t offset: Internal least significant bit position in both buffers.
- uint8_t bits: Signal width, 1 through 64; must fit in both buffers.
Location: cdx_dbc_copy.h:61
CDX_dbc_copy_u32_be
Copy a big-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_copy_u32_be(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits)retval
CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.
Parameters
- void * dst: Nonnull writable destination buffer.
- uint32_t dst_size: Destination size in bytes.
- void const * src: Nonnull source buffer.
- uint32_t src_size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 32; must fit in both buffers.
Location: cdx_dbc_copy.h:73
CDX_dbc_copy_u64_be
Copy a big-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_copy_u64_be(void *dst, uint32_t dst_size, void const *src, uint32_t src_size, uint16_t offset, uint8_t bits)retval
CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.
Parameters
- void * dst: Nonnull writable destination buffer.
- uint32_t dst_size: Destination size in bytes.
- void const * src: Nonnull source buffer.
- uint32_t src_size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 64; must fit in both buffers.
Location: cdx_dbc_copy.h:85
CDX DBC Signal Packing
Offsets identify the signal’s least significant bit using the internal DBC numbering: bit zero is the first byte’s least significant bit. Intel signals continue into increasing byte indices; Motorola signals continue into decreasing byte indices. Motorola offsets are not the DBC file’s external start-MSB notation. Surrounding bits are preserved.
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_pack_u32_le | Pack an unsigned, little-endian signal of up to 32 bits. |
| CDX_dbc_pack_u64_le | Pack an unsigned, little-endian signal of up to 64 bits. |
| CDX_dbc_pack_u32_be | Pack an unsigned, big-endian signal of up to 32 bits. |
| CDX_dbc_pack_u64_be | Pack an unsigned, big-endian signal of up to 64 bits. |
Functions
CDX_dbc_pack_u32_le
Pack an unsigned, little-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_pack_u32_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes, including CAN-FD data if present.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
- uint32_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:48
CDX_dbc_pack_u64_le
Pack an unsigned, little-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_pack_u64_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
- uint64_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:59
CDX_dbc_pack_u32_be
Pack an unsigned, big-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_pack_u32_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
- uint32_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:70
CDX_dbc_pack_u64_be
Pack an unsigned, big-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_pack_u64_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
- uint64_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:81
CDX DBC Signal Unpacking
Results are raw unsigned values without scaling or sign extension. Bit zero is the first byte’s least significant bit. Intel signals continue into increasing byte indices; Motorola signals continue into decreasing byte indices. Use internal start-LSB offsets, not external Motorola start-MSB.
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_unpack_u32_le | Read an unsigned, little-endian signal of up to 32 bits. |
| CDX_dbc_unpack_u64_le | Read an unsigned, little-endian signal of up to 64 bits. |
| CDX_dbc_unpack_u32_be | Read an unsigned, big-endian signal of up to 32 bits. |
| CDX_dbc_unpack_u64_be | Read an unsigned, big-endian signal of up to 64 bits. |
Functions
CDX_dbc_unpack_u32_le
Read an unsigned, little-endian signal of up to 32 bits.
1uint32_t CDX_dbc_unpack_u32_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Note: Invalid input is indistinguishable from a valid zero-valued signal.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes, including CAN-FD data if present.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
Location: cdx_dbc_unpack.h:46
CDX_dbc_unpack_u64_le
Read an unsigned, little-endian signal of up to 64 bits.
1uint64_t CDX_dbc_unpack_u64_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
Location: cdx_dbc_unpack.h:55
CDX_dbc_unpack_u32_be
Read an unsigned, big-endian signal of up to 32 bits.
1uint32_t CDX_dbc_unpack_u32_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
Location: cdx_dbc_unpack.h:64
CDX_dbc_unpack_u64_be
Read an unsigned, big-endian signal of up to 64 bits.
1uint64_t CDX_dbc_unpack_u64_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
Location: cdx_dbc_unpack.h:73
CDX Model CAN API
Foreground-only access to the model’s sole logical IPC bus.
IPC maps to CM7’s Model IPC/CAN3 port, not a physical CM4 CAN controller. Call from model callbacks, not interrupts or concurrent threads.
Contents
Typedefs
| Typedef | Description |
|---|---|
| CDX_DATA_64 | Aligned eight-byte payload chunk with unsigned access views. |
| CDX_CAN_FRAME_FLAGS | CDX flags; these values are not the Model IPC wire flag encoding. |
| CDX_CAN_FRAME | Received frame; the frame and data are valid only during RX callback. |
| CDX_CAN_TX_PARAMS | TX request copied during enqueue; zero-initialize before filling it. |
Functions
| Function | Description |
|---|---|
| CDX_can_frame_flags_is_std | Test for a classic standard-ID frame. |
| CDX_can_frame_flags_is_ext | Test for a classic extended-ID frame. |
| CDX_can_frame_flags_is_fd_std | Test for a CAN-FD standard-ID frame. |
| CDX_can_frame_flags_is_fd_ext | Test for a CAN-FD extended-ID frame. |
| CDX_can_tx_enqueue_copy | Copy a TX request and payload into the nonblocking Model IPC queue. |
| CDX_can_is_timed_out_ms | Test elapsed local milliseconds using unsigned wrap-safe subtraction. |
| CDX_can_read_signal_u32_le | Read an unsigned, little-endian signal of up to 32 bits. |
| CDX_can_read_signal_u64_le | Read an unsigned, little-endian signal of up to 64 bits. |
| CDX_can_read_signal_u32_be | Read an unsigned, big-endian signal of up to 32 bits. |
| CDX_can_read_signal_u64_be | Read an unsigned, big-endian signal of up to 64 bits. |
Macros
| Macro | Description |
|---|---|
| CDX_CAN_FRAME_FLAG_NONE | Classic frame with a standard 11-bit identifier. |
| CDX_CAN_FRAME_FLAG_IDE | Extended 29-bit identifier. |
| CDX_CAN_FRAME_FLAG_EDL | CAN-FD payload, up to 64 bytes instead of the classic 8-byte limit. |
| CDX_CAN_FRAME_FLAG_BRS | CAN-FD bit-rate switch; valid only with EDL. |
| CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE | Ignore deadline_ticks when enqueueing and publishing this TX frame. |
Typedefs
CDX_DATA_64
Aligned eight-byte payload chunk with unsigned access views.
1typedef union CDX_DATA_64_UNION CDX_DATA_64CDX_CAN_FRAME_FLAGS
CDX flags; these values are not the Model IPC wire flag encoding.
1typedef uint16_t CDX_CAN_FRAME_FLAGSCDX_CAN_FRAME
Received frame; the frame and data are valid only during RX callback.
1typedef struct CDX_CAN_FRAME_STRUCT CDX_CAN_FRAMECDX_CAN_TX_PARAMS
TX request copied during enqueue; zero-initialize before filling it.
1typedef struct CDX_CAN_TX_PARAMS_STRUCT CDX_CAN_TX_PARAMSFunctions
CDX_can_frame_flags_is_std
Test for a classic standard-ID frame.
1int CDX_can_frame_flags_is_std(CDX_CAN_FRAME_FLAGS flags)Returns
Nonzero if both IDE and EDL are clear.
Parameters
- CDX_CAN_FRAME_FLAGS flags: Frame flags; policy and other attribute bits are ignored.
Location: cdx_can.h:101
CDX_can_frame_flags_is_ext
Test for a classic extended-ID frame.
1int CDX_can_frame_flags_is_ext(CDX_CAN_FRAME_FLAGS flags)Returns
Nonzero if IDE is set and EDL is clear.
Parameters
- CDX_CAN_FRAME_FLAGS flags: Frame flags; policy and other attribute bits are ignored.
Location: cdx_can.h:109
CDX_can_frame_flags_is_fd_std
Test for a CAN-FD standard-ID frame.
1int CDX_can_frame_flags_is_fd_std(CDX_CAN_FRAME_FLAGS flags)Returns
Nonzero if EDL is set and IDE is clear.
Parameters
- CDX_CAN_FRAME_FLAGS flags: Frame flags; policy and other attribute bits are ignored.
Location: cdx_can.h:117
CDX_can_frame_flags_is_fd_ext
Test for a CAN-FD extended-ID frame.
1int CDX_can_frame_flags_is_fd_ext(CDX_CAN_FRAME_FLAGS flags)Returns
Nonzero if both IDE and EDL are set.
Parameters
- CDX_CAN_FRAME_FLAGS flags: Frame flags; policy and other attribute bits are ignored.
Location: cdx_can.h:125
CDX_can_tx_enqueue_copy
Copy a TX request and payload into the nonblocking Model IPC queue.
1CDX_STATUS CDX_can_tx_enqueue_copy(CDX_CAN_BUS_ID bus, CDX_CAN_TX_PARAMS const *params, CDX_DATA_64 const *data)retval
CDX_STATUS_OK: Copied and accepted; not yet delivered to the peer.CDX_STATUS_BAD_PARAM: Invalid bus, pointer, flags, ID or length.CDX_STATUS_IPC_OFFLINE: No bound RUNNING runtime or IPC session lost.CDX_STATUS_TIMEOUT: Nonzero, enabled deadline has already expired.CDX_STATUS_QUEUE_FULL: Newest frame rejected; runtime drop count rises.
Note: There are no TX completion callbacks. Acceptance does not guarantee publication, physical CAN delivery or model execution. Queued frames may expire or be discarded on IPC fault. Published batches remain owned by the peer until acknowledgement; they cannot be cancelled by expiry.
Parameters
- CDX_CAN_BUS_ID bus: Sole logical bus: CDX_CAN_BUS_ID_IPC (legacy CAN1 is an alias).
- CDX_CAN_TX_PARAMS const * params: Nonnull request, with supported flags, ID and byte length.
- CDX_DATA_64 const * data: Aligned payload chunks containing length_bytes bytes; may be NULL only for an empty payload. Storage may be reused after this call.
Location: cdx_can.h:150
CDX_can_is_timed_out_ms
Test elapsed local milliseconds using unsigned wrap-safe subtraction.
1int CDX_can_is_timed_out_ms(CDX_MILLISEC_32 received_ms, CDX_MILLISEC_32 timeout_ms)Returns
Nonzero if elapsed milliseconds are at least timeout_ms.
Note: The timestamp must be less than one millisecond-counter wrap old.
Parameters
- CDX_MILLISEC_32 received_ms: Recent past timestamp from the local millisecond clock.
- CDX_MILLISEC_32 timeout_ms: Timeout interval; zero always times out.
Location: cdx_can.h:159
CDX_can_read_signal_u32_le
Read an unsigned, little-endian signal of up to 32 bits.
1uint32_t CDX_can_read_signal_u32_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Note: Invalid input is indistinguishable from a valid zero-valued signal.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes, including CAN-FD data if present.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
Location: cdx_can.h:163
CDX_can_read_signal_u64_le
Read an unsigned, little-endian signal of up to 64 bits.
1uint64_t CDX_can_read_signal_u64_le(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
Location: cdx_can.h:167
CDX_can_read_signal_u32_be
Read an unsigned, big-endian signal of up to 32 bits.
1uint32_t CDX_can_read_signal_u32_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
Location: cdx_can.h:171
CDX_can_read_signal_u64_be
Read an unsigned, big-endian signal of up to 64 bits.
1uint64_t CDX_can_read_signal_u64_be(void const *buffer, uint32_t size, uint16_t offset, uint8_t bits)Returns
Raw value, or zero for an invalid pointer, width or range.
Parameters
- void const * buffer: Nonnull source buffer; never modified.
- uint32_t size: Source size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
Location: cdx_can.h:175
Macros
CDX_CAN_FRAME_FLAG_NONE
1#define CDX_CAN_FRAME_FLAG_NONE 0uClassic frame with a standard 11-bit identifier.
CDX_CAN_FRAME_FLAG_IDE
1#define CDX_CAN_FRAME_FLAG_IDE 0x0001uExtended 29-bit identifier.
CDX_CAN_FRAME_FLAG_EDL
1#define CDX_CAN_FRAME_FLAG_EDL 0x0008uCAN-FD payload, up to 64 bytes instead of the classic 8-byte limit.
CDX_CAN_FRAME_FLAG_BRS
1#define CDX_CAN_FRAME_FLAG_BRS 0x0010uCAN-FD bit-rate switch; valid only with EDL.
CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE
1#define CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE 0x0100uIgnore deadline_ticks when enqueueing and publishing this TX frame.
Subsections of CDX Model CAN API
CDX_CAN_FRAME_STRUCT
Received frame; the frame and data are valid only during RX callback.
Contents
Public Attributes
| Attribute | Description |
|---|---|
| id | Raw 11-bit or 29-bit CAN identifier. |
| bus | CDX_CAN_BUS_ID_IPC for Model IPC. |
| error_type | Zero; error frames are not supported. |
| flags | IDE, EDL and BRS frame attributes. |
| timestamp_ticks | Receiver-local arrival microseconds. |
| hw_timestamp | Zero; no physical CAN timestamp. |
| length_bytes | Payload bytes: classic 0..8, FD 0..64. |
| data_chunks | Number of chunks, ceil(length_bytes/8). |
| reserved | Zero; reserved for future API use. |
| data | Borrowed aligned chunks; copy to retain. |
Public Attributes
Field: id
Raw 11-bit or 29-bit CAN identifier.
1uint32_t idField: bus
CDX_CAN_BUS_ID_IPC for Model IPC.
1CDX_CAN_BUS_ID busField: error_type
Zero; error frames are not supported.
1uint8_t error_typeField: flags
IDE, EDL and BRS frame attributes.
1CDX_CAN_FRAME_FLAGS flagsField: timestamp_ticks
Receiver-local arrival microseconds.
1CDX_TICKS_32 timestamp_ticksField: hw_timestamp
Zero; no physical CAN timestamp.
1uint32_t hw_timestampField: length_bytes
Payload bytes: classic 0..8, FD 0..64.
1uint16_t length_bytesField: data_chunks
Number of chunks, ceil(length_bytes/8).
1uint8_t data_chunksField: reserved
Zero; reserved for future API use.
1uint8_t reservedField: data
Borrowed aligned chunks; copy to retain.
1CDX_DATA_64 const * dataCDX_CAN_TX_PARAMS_STRUCT
TX request copied during enqueue; zero-initialize before filling it.
Contents
Public Attributes
| Attribute | Description |
|---|---|
| id | Raw 11-bit or 29-bit CAN identifier. |
| flags | Frame attributes and TX policy flags. |
| length_bytes | Payload bytes: classic 0..8, FD 0..64. |
| deadline_ticks | Absolute local ticks; zero disables expiry. |
Public Attributes
Field: id
Raw 11-bit or 29-bit CAN identifier.
1uint32_t idField: flags
Frame attributes and TX policy flags.
1CDX_CAN_FRAME_FLAGS flagsField: length_bytes
Payload bytes: classic 0..8, FD 0..64.
1uint16_t length_bytesField: deadline_ticks
Absolute local ticks; zero disables expiry.
1CDX_TICKS_32 deadline_ticksCDX_DATA_64_UNION
Aligned eight-byte payload chunk with unsigned access views.
Contents
Public Attributes
| Attribute | Description |
|---|---|
| u64 | Native-endian 64-bit view of the chunk. |
| u32 | Two native-endian 32-bit words in storage order. |
| u16 | Four native-endian 16-bit words in storage order. |
| u8 | Eight bytes in payload order; u8[0] is first. |
Public Attributes
Field: u64
Native-endian 64-bit view of the chunk.
1uint64_t u64Field: u32
Two native-endian 32-bit words in storage order.
1uint32_t u32Field: u16
Four native-endian 16-bit words in storage order.
1uint16_t u16Field: u8
Eight bytes in payload order; u8[0] is first.
1uint8_t u8CDX Model Memory Access
Foreground-only access to at most eight registered model regions.
Register only model-owned storage, not peripherals or IPC buffers. The caller is responsible for pointer validity and storage lifetime. Registration is reset when the runtime is bound, not by model stepping.
Contents
Functions
| Function | Description |
|---|---|
| CDX_memory_region_register | Register a non-overlapping model memory region during initialization. |
| CDX_memory_read | Copy bytes from one registered region to caller-owned storage. |
| CDX_memory_write | Copy bytes into one registered, writable model region. |
| CDX_memory_read_u8 | Read an 8-bit scalar through address extension zero. |
| CDX_memory_read_u16 | Read a 16-bit scalar through address extension zero. |
| CDX_memory_read_u32 | Read a 32-bit scalar through address extension zero. |
| CDX_memory_read_u64 | Read a 64-bit scalar through address extension zero. |
| CDX_memory_write_u8 | Write an 8-bit scalar through address extension zero. |
| CDX_memory_write_u16 | Write a 16-bit scalar through address extension zero. |
| CDX_memory_write_u32 | Write a 32-bit scalar through address extension zero. |
| CDX_memory_write_u64 | Write a 64-bit scalar through address extension zero. |
Functions
CDX_memory_region_register
Register a non-overlapping model memory region during initialization.
1CDX_STATUS CDX_memory_region_register(uint32_t address, void *data, uint32_t size, int writable)retval
CDX_STATUS_OK: Region registered.CDX_STATUS_BAD_PARAM: Null storage, zero size, overlap or address overflow.CDX_STATUS_QUEUE_FULL: All eight registration slots are in use.
Parameters
- uint32_t address: Logical 32-bit base address exposed through this API.
- void * data: Backing storage; must remain valid until runtime rebinding.
- uint32_t size: Region length in bytes; must be nonzero and not overflow address.
- int writable: Nonzero permits writes; zero makes the region read-only.
Location: cdx_memory.h:47
CDX_memory_read
Copy bytes from one registered region to caller-owned storage.
1CDX_STATUS CDX_memory_read(uint32_t address, uint8_t extension, uint32_t size, void *data)retval
CDX_STATUS_OK: Bytes copied.CDX_STATUS_BAD_PARAM: Unsupported extension, null data or invalid range.
Parameters
- uint32_t address: Logical starting address of the bytes to read.
- uint8_t extension: Address extension; only zero is supported.
- uint32_t size: Byte count; the entire range must fit in a single region.
- void * data: Nonnull destination with room for size bytes; overlap is permitted.
Location: cdx_memory.h:57
CDX_memory_write
Copy bytes into one registered, writable model region.
1CDX_STATUS CDX_memory_write(uint32_t address, uint8_t extension, uint32_t size, void const *data)retval
CDX_STATUS_OK: Bytes copied.CDX_STATUS_BAD_PARAM: Invalid extension, source, range or write permission.
Parameters
- uint32_t address: Logical starting address of the bytes to write.
- uint8_t extension: Address extension; only zero is supported.
- uint32_t size: Byte count; the entire range must fit in a single region.
- void const * data: Nonnull source containing size bytes; overlap is permitted.
Location: cdx_memory.h:67
CDX_memory_read_u8
Read an 8-bit scalar through address extension zero.
1uint8_t CDX_memory_read_u8(uint32_t address)Returns
Native-endian value, or zero on failure; use CDX_memory_read for status.
Parameters
- uint32_t address: Logical address in a registered region; no alignment required.
Location: cdx_memory.h:73
CDX_memory_read_u16
Read a 16-bit scalar through address extension zero.
1uint16_t CDX_memory_read_u16(uint32_t address)Returns
Native-endian value, or zero on failure; use CDX_memory_read for status.
Parameters
- uint32_t address: Logical address in a registered region; no alignment required.
Location: cdx_memory.h:79
CDX_memory_read_u32
Read a 32-bit scalar through address extension zero.
1uint32_t CDX_memory_read_u32(uint32_t address)Returns
Native-endian value, or zero on failure; use CDX_memory_read for status.
Parameters
- uint32_t address: Logical address in a registered region; no alignment required.
Location: cdx_memory.h:85
CDX_memory_read_u64
Read a 64-bit scalar through address extension zero.
1uint64_t CDX_memory_read_u64(uint32_t address)Returns
Native-endian value, or zero on failure; use CDX_memory_read for status.
Parameters
- uint32_t address: Logical address in a registered region; no alignment required.
Location: cdx_memory.h:91
CDX_memory_write_u8
Write an 8-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u8(uint32_t address, uint8_t value)Returns
CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Parameters
- uint32_t address: Logical address in a registered writable region.
- uint8_t value: Native-endian value to store; no alignment is required.
Location: cdx_memory.h:98
CDX_memory_write_u16
Write a 16-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u16(uint32_t address, uint16_t value)Returns
CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Parameters
- uint32_t address: Logical address in a registered writable region.
- uint16_t value: Native-endian value to store; no alignment is required.
Location: cdx_memory.h:105
CDX_memory_write_u32
Write a 32-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u32(uint32_t address, uint32_t value)Returns
CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Parameters
- uint32_t address: Logical address in a registered writable region.
- uint32_t value: Native-endian value to store; no alignment is required.
Location: cdx_memory.h:112
CDX_memory_write_u64
Write a 64-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u64(uint32_t address, uint64_t value)Returns
CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Parameters
- uint32_t address: Logical address in a registered writable region.
- uint64_t value: Native-endian value to store; no alignment is required.
Location: cdx_memory.h:119
CDX Numeric Utilities
Contents
Typedefs
| Typedef | Description |
|---|---|
| bool8_t | 8-bit boolean type. |
| real32_t | Ginmake-facing IEEE-754 binary32 scalar. |
| real64_t | Ginmake-facing IEEE-754 binary64 scalar. |
Functions
| Function | Description |
|---|---|
| CDX_byteswap16 | Reverse the byte order of a 16-bit integer. |
| CDX_byteswap32 | Reverse the byte order of a 32-bit integer. |
| CDX_byteswap64 | Reverse the byte order of a 64-bit integer. |
| CDX_reinterpret_cast_u32 | Return the IEEE-754 binary32 representation of a float. |
| CDX_reinterpret_cast_u64 | Return the IEEE-754 binary64 representation of a double. |
| CDX_reinterpret_cast_f32 | Interpret an unsigned 32-bit integer as IEEE-754 binary32 bits. |
| CDX_reinterpret_cast_f64 | Interpret an unsigned 64-bit integer as IEEE-754 binary64 bits. |
| CDX_sign_extend_u8 | Sign-extend a raw signal to an 8-bit signed integer. |
| CDX_sign_extend_u16 | Sign-extend a raw signal to a 16-bit signed integer. |
| CDX_sign_extend_u32 | Sign-extend a raw signal to a 32-bit signed integer. |
| CDX_sign_extend_u64 | Sign-extend a raw signal to a 64-bit signed integer. |
| CDX_f32_rounds_to_zero | Test whether rounding to the nearest integer gives zero. |
Typedefs
bool8_t
8-bit boolean type.
1typedef uint8_t bool8_treal32_t
Ginmake-facing IEEE-754 binary32 scalar.
1typedef float real32_treal64_t
Ginmake-facing IEEE-754 binary64 scalar.
1typedef double real64_tFunctions
CDX_byteswap16
Reverse the byte order of a 16-bit integer.
1uint16_t CDX_byteswap16(uint16_t value)Returns
Integer with its bytes reversed.
Parameters
- uint16_t value: Integer to convert.
Location: cdx_utils.h:50
CDX_byteswap32
Reverse the byte order of a 32-bit integer.
1uint32_t CDX_byteswap32(uint32_t value)Returns
Integer with its bytes reversed.
Parameters
- uint32_t value: Integer to convert.
Location: cdx_utils.h:58
CDX_byteswap64
Reverse the byte order of a 64-bit integer.
1uint64_t CDX_byteswap64(uint64_t value)Returns
Integer with its bytes reversed.
Parameters
- uint64_t value: Integer to convert.
Location: cdx_utils.h:67
CDX_reinterpret_cast_u32
Return the IEEE-754 binary32 representation of a float.
1uint32_t CDX_reinterpret_cast_u32(float value)Returns
The same bit pattern as an unsigned 32-bit integer.
Parameters
- float value: Floating-point value; no numeric conversion is performed.
Location: cdx_utils.h:76
CDX_reinterpret_cast_u64
Return the IEEE-754 binary64 representation of a double.
1uint64_t CDX_reinterpret_cast_u64(double value)Returns
The same bit pattern as an unsigned 64-bit integer.
Parameters
- double value: Floating-point value; no numeric conversion is performed.
Location: cdx_utils.h:86
CDX_reinterpret_cast_f32
Interpret an unsigned 32-bit integer as IEEE-754 binary32 bits.
1float CDX_reinterpret_cast_f32(uint32_t value)Returns
The float with that bit pattern, including NaNs and infinities.
Parameters
- uint32_t value: Bit pattern; no numeric conversion is performed.
Location: cdx_utils.h:96
CDX_reinterpret_cast_f64
Interpret an unsigned 64-bit integer as IEEE-754 binary64 bits.
1double CDX_reinterpret_cast_f64(uint64_t value)Returns
The double with that bit pattern, including NaNs and infinities.
Parameters
- uint64_t value: Bit pattern; no numeric conversion is performed.
Location: cdx_utils.h:106
CDX_sign_extend_u8
Sign-extend a raw signal to an 8-bit signed integer.
1int8_t CDX_sign_extend_u8(uint8_t bits, uint8_t value)Returns
Signed value using the selected width’s most significant bit as sign.
Parameters
- uint8_t bits: Signal width; zero returns zero, widths above 8 are clamped to 8.
- uint8_t value: Raw signal; bits above the selected width are discarded.
Location: cdx_utils.h:121
CDX_sign_extend_u16
Sign-extend a raw signal to a 16-bit signed integer.
1int16_t CDX_sign_extend_u16(uint8_t bits, uint16_t value)Returns
Signed value using the selected width’s most significant bit as sign.
Parameters
- uint8_t bits: Signal width; zero returns zero, widths above 16 are clamped to 16.
- uint16_t value: Raw signal; bits above the selected width are discarded.
Location: cdx_utils.h:128
CDX_sign_extend_u32
Sign-extend a raw signal to a 32-bit signed integer.
1int32_t CDX_sign_extend_u32(uint8_t bits, uint32_t value)Returns
Signed value using the selected width’s most significant bit as sign.
Parameters
- uint8_t bits: Signal width; zero returns zero, widths above 32 are clamped to 32.
- uint32_t value: Raw signal; bits above the selected width are discarded.
Location: cdx_utils.h:135
CDX_sign_extend_u64
Sign-extend a raw signal to a 64-bit signed integer.
1int64_t CDX_sign_extend_u64(uint8_t bits, uint64_t value)Returns
Signed value using the selected width’s most significant bit as sign.
Parameters
- uint8_t bits: Signal width; zero returns zero, widths above 64 are clamped to 64.
- uint64_t value: Raw signal; bits above the selected width are discarded.
Location: cdx_utils.h:142
CDX_f32_rounds_to_zero
Test whether rounding to the nearest integer gives zero.
1uint8_t CDX_f32_rounds_to_zero(float value)Returns
Nonzero only for -0.5 < value < 0.5; false for NaN and either boundary.
Note: Half-way values are treated as rounding away from zero.
Parameters
- float value: Floating-point value to test.
Location: cdx_utils.h:149
CDX Runtime Time
Foreground time helpers; CM4 and CM7 clocks are not synchronized.
The runtime must poll at least once per 32-bit microsecond wrap (about 71 minutes) to extend time correctly. Deadline comparisons require intervals within the half-range limit. These APIs are not ISR-safe.
Contents
Functions
| Function | Description |
|---|---|
| CDX_ticks_now | Read the current wrapping microsecond tick counter. |
| CDX_microsec_32_now | Read the local microsecond counter modulo 2^32. |
| CDX_microsec_64_now | Read local microseconds with foreground-maintained wrap extension. |
| CDX_millisec_32_now | Read local milliseconds modulo 2^32. |
| CDX_millisec_32_from_ticks | Convert a recent past microsecond timestamp to local milliseconds. |
| CDX_microsec_deadline_remain | Calculate microseconds remaining to a local absolute deadline. |
| CDX_ticks_deadline_from_millisec | Form a nonzero CAN deadline relative to the current local ticks. |
Functions
CDX_ticks_now
Read the current wrapping microsecond tick counter.
1CDX_TICKS_32 CDX_ticks_now(void)Returns
Local ticks, or zero when no runtime clock is bound.
Parameters
- void
Location: cdx_time.h:56
CDX_microsec_32_now
Read the local microsecond counter modulo 2^32.
1CDX_MICROSEC_32 CDX_microsec_32_now(void)Returns
Local microseconds, or zero when no runtime clock is bound.
Parameters
- void
Location: cdx_time.h:61
CDX_microsec_64_now
Read local microseconds with foreground-maintained wrap extension.
1CDX_MICROSEC_64 CDX_microsec_64_now(void)Returns
Extended microsecond count, or zero when no runtime is bound.
Parameters
- void
Location: cdx_time.h:66
CDX_millisec_32_now
Read local milliseconds modulo 2^32.
1CDX_MILLISEC_32 CDX_millisec_32_now(void)Returns
Extended microseconds divided by 1000, truncated to 32 bits.
Parameters
- void
Location: cdx_time.h:71
CDX_millisec_32_from_ticks
Convert a recent past microsecond timestamp to local milliseconds.
1CDX_MILLISEC_32 CDX_millisec_32_from_ticks(CDX_TICKS_32 ticks)Returns
Timestamp in wrapping milliseconds, accounting for a recent tick wrap.
Parameters
- CDX_TICKS_32 ticks: Past local timestamp less than one microsecond-counter wrap old.
Location: cdx_time.h:77
CDX_microsec_deadline_remain
Calculate microseconds remaining to a local absolute deadline.
1CDX_MICROSEC_32 CDX_microsec_deadline_remain(CDX_MICROSEC_32 deadline)Returns
Remaining microseconds, or zero if due, expired or beyond half-range.
Note: This helper does not interpret zero as a disabled CAN deadline.
Parameters
- CDX_MICROSEC_32 deadline: Wrapping microsecond deadline within the half-range limit.
Location: cdx_time.h:84
CDX_ticks_deadline_from_millisec
Form a nonzero CAN deadline relative to the current local ticks.
1CDX_TICKS_32 CDX_ticks_deadline_from_millisec(CDX_MILLISEC_32 interval_ms)Returns
Absolute wrapping deadline; a computed zero is changed to one tick.
Note: Zero in CDX_CAN_TX_PARAMS means no deadline, so this result avoids zero.
Parameters
- CDX_MILLISEC_32 interval_ms: Milliseconds ahead; clamped to the half-range limit / 1000.
Location: cdx_time.h:91
Types
Types
Total documented types: 5
Structures
| Type | Description |
|---|---|
| CDX_ADC_SNAPSHOT_STRUCT | |
| CDX_CAL_IDENTITY_STRUCT | |
| CDX_CAN_FRAME_STRUCT | |
| CDX_CAN_TX_PARAMS_STRUCT |
Unions
| Type | Description |
|---|---|
| CDX_DATA_64_UNION |