firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
can_codec_utils.h File Reference

CAN codegen utilities. More...

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for can_codec_utils.h:

Go to the source code of this file.

Macros

#define __always_inline   __inline__ __attribute__((__always_inline__))

Functions

static __always_inline uint8_t swap_byte_order_8 (uint8_t x)
 Swaps the byte order of a uint8_t.
static __always_inline uint16_t swap_byte_order_16 (uint16_t x)
 Swaps the byte order of a uint16_t.
static __always_inline uint32_t swap_byte_order_32 (uint32_t x)
 Swaps the byte order of a uint32_t.
static __always_inline uint32_t swap_byte_order_ftou (float x)
 Swaps the byte order of a float and returns its big-endian representation as a uint32_t.
static __always_inline float swap_byte_order_utof (uint32_t x)
 Swaps the byte order of a big-endian float represented as a uint32_t.
static __always_inline uint64_t swap_byte_order_64 (uint64_t x)
 Swaps the byte order of a uint64_t.
static __always_inline uint64_t swap_byte_order_dtou (double x)
 Swaps the byte order of a double and returns its big-endian representation as a uint64_t.
static __always_inline double swap_byte_order_utod (uint64_t x)
 Swaps the byte order of a big-endian double represented as a uint64_t.

Detailed Description

CAN codegen utilities.

Author
Jamie Pruett :)
Version
0.1
Date
2025-05-02

Macro Definition Documentation

◆ __always_inline

#define __always_inline   __inline__ __attribute__((__always_inline__))

Function Documentation

◆ swap_byte_order_16()

__always_inline uint16_t swap_byte_order_16 ( uint16_t x)
static

Swaps the byte order of a uint16_t.

Parameters
x
Returns
uint16_t x with the byte order swapped

◆ swap_byte_order_32()

__always_inline uint32_t swap_byte_order_32 ( uint32_t x)
static

Swaps the byte order of a uint32_t.

Parameters
x
Returns
uint32_t x with the byte order swapped

◆ swap_byte_order_64()

__always_inline uint64_t swap_byte_order_64 ( uint64_t x)
static

Swaps the byte order of a uint64_t.

Parameters
x
Returns
uint64_t x with the byte order swapped

◆ swap_byte_order_8()

__always_inline uint8_t swap_byte_order_8 ( uint8_t x)
static

Swaps the byte order of a uint8_t.

Parameters
x
Returns
uint8_t x with the byte order swapped

◆ swap_byte_order_dtou()

__always_inline uint64_t swap_byte_order_dtou ( double x)
static

Swaps the byte order of a double and returns its big-endian representation as a uint64_t.

Parameters
x
Returns
uint64_t IEEE 64-bit double with swapped byte order (to big endian)

◆ swap_byte_order_ftou()

__always_inline uint32_t swap_byte_order_ftou ( float x)
static

Swaps the byte order of a float and returns its big-endian representation as a uint32_t.

Parameters
x
Returns
uint32_t IEEE 32-bit float with swapped byte order (to big endian)

◆ swap_byte_order_utod()

__always_inline double swap_byte_order_utod ( uint64_t x)
static

Swaps the byte order of a big-endian double represented as a uint64_t.

Parameters
x
Returns
double IEEE 64-bit double with swapped byte order (to little-endian)

◆ swap_byte_order_utof()

__always_inline float swap_byte_order_utof ( uint32_t x)
static

Swaps the byte order of a big-endian float represented as a uint32_t.

Parameters
x
Returns
float IEEE 32-bit float with swapped byte order (to little-endian)