Modules
Modules Documentation
The following modules are available:
The following modules are available:
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.
| 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. |
Initialize application resources once during CM4 startup.
1CDX_STATUS CDX_app_system_init(void)CDX_STATUS_OK: Application setup succeeded.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.
Location: cdx_app_functions.h:45
Return the fixed execution period after application system setup.
1uint32_t CDX_app_model_period_us_get(void)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.
Location: cdx_app_functions.h:52
Initialize the model before the runtime publishes READY.
1CDX_STATUS CDX_app_model_init(void)CDX_STATUS_OK: Initialization succeeded.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.
Location: cdx_app_functions.h:60
Execute one due model step after queued RX callbacks.
1CDX_STATUS CDX_app_model_step(void)CDX_STATUS_OK: Step completed successfully.Any other status faults the model and discards queued TX frames.
Note: Called only while RUNNING; missed periods are counted, not replayed.
Location: cdx_app_functions.h:67
Process one received CAN/FD frame before the next model step.
1CDX_STATUS CDX_app_can_rx_handle(CDX_CAN_FRAME const *frame)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.Any other status faults the model; implement an ignored result if the application does not handle received frames. Copy data to retain it.
Location: cdx_app_functions.h:78
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.
| 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. |
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)CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.Location: cdx_dbc_copy.h:49
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)CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.Location: cdx_dbc_copy.h:61
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)CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.Location: cdx_dbc_copy.h:73
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)CDX_STATUS_OK: Signal copied; surrounding destination bits preserved.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; nothing written.Location: cdx_dbc_copy.h:85
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.
| 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. |
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)CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.Location: cdx_dbc_pack.h:48
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)CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.Location: cdx_dbc_pack.h:59
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)CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.Location: cdx_dbc_pack.h:70
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)CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.Location: cdx_dbc_pack.h:81
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.
| 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. |
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)Raw value, or zero for an invalid pointer, width or range.
Note: Invalid input is indistinguishable from a valid zero-valued signal.
Location: cdx_dbc_unpack.h:46
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_dbc_unpack.h:55
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_dbc_unpack.h:64
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_dbc_unpack.h:73
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.
| 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. |
| 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. |
| 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. |
Aligned eight-byte payload chunk with unsigned access views.
1typedef union CDX_DATA_64_UNION CDX_DATA_64CDX flags; these values are not the Model IPC wire flag encoding.
1typedef uint16_t CDX_CAN_FRAME_FLAGSReceived frame; the frame and data are valid only during RX callback.
1typedef struct CDX_CAN_FRAME_STRUCT CDX_CAN_FRAMETX request copied during enqueue; zero-initialize before filling it.
1typedef struct CDX_CAN_TX_PARAMS_STRUCT CDX_CAN_TX_PARAMSTest for a classic standard-ID frame.
1int CDX_can_frame_flags_is_std(CDX_CAN_FRAME_FLAGS flags)Nonzero if both IDE and EDL are clear.
Location: cdx_can.h:101
Test for a classic extended-ID frame.
1int CDX_can_frame_flags_is_ext(CDX_CAN_FRAME_FLAGS flags)Nonzero if IDE is set and EDL is clear.
Location: cdx_can.h:109
Test for a CAN-FD standard-ID frame.
1int CDX_can_frame_flags_is_fd_std(CDX_CAN_FRAME_FLAGS flags)Nonzero if EDL is set and IDE is clear.
Location: cdx_can.h:117
Test for a CAN-FD extended-ID frame.
1int CDX_can_frame_flags_is_fd_ext(CDX_CAN_FRAME_FLAGS flags)Nonzero if both IDE and EDL are set.
Location: cdx_can.h:125
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)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.
Location: cdx_can.h:150
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)Nonzero if elapsed milliseconds are at least timeout_ms.
Note: The timestamp must be less than one millisecond-counter wrap old.
Location: cdx_can.h:159
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)Raw value, or zero for an invalid pointer, width or range.
Note: Invalid input is indistinguishable from a valid zero-valued signal.
Location: cdx_can.h:163
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_can.h:167
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_can.h:171
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)Raw value, or zero for an invalid pointer, width or range.
Location: cdx_can.h:175
1#define CDX_CAN_FRAME_FLAG_NONE 0uClassic frame with a standard 11-bit identifier.
1#define CDX_CAN_FRAME_FLAG_IDE 0x0001uExtended 29-bit identifier.
1#define CDX_CAN_FRAME_FLAG_EDL 0x0008uCAN-FD payload, up to 64 bytes instead of the classic 8-byte limit.
1#define CDX_CAN_FRAME_FLAG_BRS 0x0010uCAN-FD bit-rate switch; valid only with EDL.
1#define CDX_CAN_FRAME_FLAG_DISABLE_DEADLINE 0x0100uIgnore deadline_ticks when enqueueing and publishing this TX frame.
Received frame; the frame and data are valid only during RX callback.
| 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. |
Raw 11-bit or 29-bit CAN identifier.
1uint32_t idCDX_CAN_BUS_ID_IPC for Model IPC.
1CDX_CAN_BUS_ID busZero; error frames are not supported.
1uint8_t error_typeIDE, EDL and BRS frame attributes.
1CDX_CAN_FRAME_FLAGS flagsReceiver-local arrival microseconds.
1CDX_TICKS_32 timestamp_ticksZero; no physical CAN timestamp.
1uint32_t hw_timestampPayload bytes: classic 0..8, FD 0..64.
1uint16_t length_bytesNumber of chunks, ceil(length_bytes/8).
1uint8_t data_chunksZero; reserved for future API use.
1uint8_t reservedBorrowed aligned chunks; copy to retain.
1CDX_DATA_64 const * dataTX request copied during enqueue; zero-initialize before filling it.
| 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. |
Raw 11-bit or 29-bit CAN identifier.
1uint32_t idFrame attributes and TX policy flags.
1CDX_CAN_FRAME_FLAGS flagsPayload bytes: classic 0..8, FD 0..64.
1uint16_t length_bytesAbsolute local ticks; zero disables expiry.
1CDX_TICKS_32 deadline_ticksAligned eight-byte payload chunk with unsigned access views.
| 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. |
Native-endian 64-bit view of the chunk.
1uint64_t u64Two native-endian 32-bit words in storage order.
1uint32_t u32Four native-endian 16-bit words in storage order.
1uint16_t u16Eight bytes in payload order; u8[0] is first.
1uint8_t u8Foreground-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.
| 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. |
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)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.Location: cdx_memory.h:47
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)CDX_STATUS_OK: Bytes copied.CDX_STATUS_BAD_PARAM: Unsupported extension, null data or invalid range.Location: cdx_memory.h:57
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)CDX_STATUS_OK: Bytes copied.CDX_STATUS_BAD_PARAM: Invalid extension, source, range or write permission.Location: cdx_memory.h:67
Read an 8-bit scalar through address extension zero.
1uint8_t CDX_memory_read_u8(uint32_t address)Native-endian value, or zero on failure; use CDX_memory_read for status.
Location: cdx_memory.h:73
Read a 16-bit scalar through address extension zero.
1uint16_t CDX_memory_read_u16(uint32_t address)Native-endian value, or zero on failure; use CDX_memory_read for status.
Location: cdx_memory.h:79
Read a 32-bit scalar through address extension zero.
1uint32_t CDX_memory_read_u32(uint32_t address)Native-endian value, or zero on failure; use CDX_memory_read for status.
Location: cdx_memory.h:85
Read a 64-bit scalar through address extension zero.
1uint64_t CDX_memory_read_u64(uint32_t address)Native-endian value, or zero on failure; use CDX_memory_read for status.
Location: cdx_memory.h:91
Write an 8-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u8(uint32_t address, uint8_t value)CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Location: cdx_memory.h:98
Write a 16-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u16(uint32_t address, uint16_t value)CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Location: cdx_memory.h:105
Write a 32-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u32(uint32_t address, uint32_t value)CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Location: cdx_memory.h:112
Write a 64-bit scalar through address extension zero.
1CDX_STATUS CDX_memory_write_u64(uint32_t address, uint64_t value)CDX_STATUS_OK on success, CDX_STATUS_BAD_PARAM on invalid range/permission.
Location: cdx_memory.h:119
| Typedef | Description |
|---|---|
| bool8_t | 8-bit boolean type. |
| real32_t | Ginmake-facing IEEE-754 binary32 scalar. |
| real64_t | Ginmake-facing IEEE-754 binary64 scalar. |
| 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. |
8-bit boolean type.
1typedef uint8_t bool8_tGinmake-facing IEEE-754 binary32 scalar.
1typedef float real32_tGinmake-facing IEEE-754 binary64 scalar.
1typedef double real64_tReverse the byte order of a 16-bit integer.
1uint16_t CDX_byteswap16(uint16_t value)Integer with its bytes reversed.
Location: cdx_utils.h:50
Reverse the byte order of a 32-bit integer.
1uint32_t CDX_byteswap32(uint32_t value)Integer with its bytes reversed.
Location: cdx_utils.h:58
Reverse the byte order of a 64-bit integer.
1uint64_t CDX_byteswap64(uint64_t value)Integer with its bytes reversed.
Location: cdx_utils.h:67
Return the IEEE-754 binary32 representation of a float.
1uint32_t CDX_reinterpret_cast_u32(float value)The same bit pattern as an unsigned 32-bit integer.
Location: cdx_utils.h:76
Return the IEEE-754 binary64 representation of a double.
1uint64_t CDX_reinterpret_cast_u64(double value)The same bit pattern as an unsigned 64-bit integer.
Location: cdx_utils.h:86
Interpret an unsigned 32-bit integer as IEEE-754 binary32 bits.
1float CDX_reinterpret_cast_f32(uint32_t value)The float with that bit pattern, including NaNs and infinities.
Location: cdx_utils.h:96
Interpret an unsigned 64-bit integer as IEEE-754 binary64 bits.
1double CDX_reinterpret_cast_f64(uint64_t value)The double with that bit pattern, including NaNs and infinities.
Location: cdx_utils.h:106
Sign-extend a raw signal to an 8-bit signed integer.
1int8_t CDX_sign_extend_u8(uint8_t bits, uint8_t value)Signed value using the selected width’s most significant bit as sign.
Location: cdx_utils.h:121
Sign-extend a raw signal to a 16-bit signed integer.
1int16_t CDX_sign_extend_u16(uint8_t bits, uint16_t value)Signed value using the selected width’s most significant bit as sign.
Location: cdx_utils.h:128
Sign-extend a raw signal to a 32-bit signed integer.
1int32_t CDX_sign_extend_u32(uint8_t bits, uint32_t value)Signed value using the selected width’s most significant bit as sign.
Location: cdx_utils.h:135
Sign-extend a raw signal to a 64-bit signed integer.
1int64_t CDX_sign_extend_u64(uint8_t bits, uint64_t value)Signed value using the selected width’s most significant bit as sign.
Location: cdx_utils.h:142
Test whether rounding to the nearest integer gives zero.
1uint8_t CDX_f32_rounds_to_zero(float value)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.
Location: cdx_utils.h:149
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.
| 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. |
Read the current wrapping microsecond tick counter.
1CDX_TICKS_32 CDX_ticks_now(void)Local ticks, or zero when no runtime clock is bound.
Location: cdx_time.h:56
Read the local microsecond counter modulo 2^32.
1CDX_MICROSEC_32 CDX_microsec_32_now(void)Local microseconds, or zero when no runtime clock is bound.
Location: cdx_time.h:61
Read local microseconds with foreground-maintained wrap extension.
1CDX_MICROSEC_64 CDX_microsec_64_now(void)Extended microsecond count, or zero when no runtime is bound.
Location: cdx_time.h:66
Read local milliseconds modulo 2^32.
1CDX_MILLISEC_32 CDX_millisec_32_now(void)Extended microseconds divided by 1000, truncated to 32 bits.
Location: cdx_time.h:71
Convert a recent past microsecond timestamp to local milliseconds.
1CDX_MILLISEC_32 CDX_millisec_32_from_ticks(CDX_TICKS_32 ticks)Timestamp in wrapping milliseconds, accounting for a recent tick wrap.
Location: cdx_time.h:77
Calculate microseconds remaining to a local absolute deadline.
1CDX_MICROSEC_32 CDX_microsec_deadline_remain(CDX_MICROSEC_32 deadline)Remaining microseconds, or zero if due, expired or beyond half-range.
Note: This helper does not interpret zero as a disabled CAN deadline.
Location: cdx_time.h:84
Form a nonzero CAN deadline relative to the current local ticks.
1CDX_TICKS_32 CDX_ticks_deadline_from_millisec(CDX_MILLISEC_32 interval_ms)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.
Location: cdx_time.h:91