ZEDA  1.6.18
Macros | Functions
endian operations.

Macros

#define Z_ENDIAN_UNKNOWN   9999
 
#define Z_ENDIAN_LITTLE   1234
 
#define Z_ENDIAN_BIG   4321
 

Functions

int endian_check (void)
 check type of endian of the current architecture. More...
 
uint16_t endian_reverse16 (uint16_t val)
 convert 16-bit little/big endian to big/little endian. More...
 
uint32_t endian_reverse32 (uint32_t val)
 convert 32-bit little/big endian to big/little endian. More...
 
uint64_t endian_reverse64 (uint64_t val)
 convert 64-bit little/big endian to big/little endian. More...
 

Detailed Description

Macro Definition Documentation

◆ Z_ENDIAN_UNKNOWN

#define Z_ENDIAN_UNKNOWN   9999

◆ Z_ENDIAN_LITTLE

#define Z_ENDIAN_LITTLE   1234

◆ Z_ENDIAN_BIG

#define Z_ENDIAN_BIG   4321

Function Documentation

◆ endian_check()

int endian_check ( void  )

check type of endian of the current architecture.

endian_check() checks the type of endian of the current architecture.

Returns
It returns any of the following identifiers with respect to the detected type: Z_ENDIAN_UNKNOWN ... unknown endian type (incl. middle endian) Z_ENDIAN_LITTLE ... little endian Z_ENDIAN_BIG ... big endian

◆ endian_reverse16()

uint16_t endian_reverse16 ( uint16_t  val)

convert 16-bit little/big endian to big/little endian.

endian_reverse16() converts a little endian 16-bit value to a bit endian value, and vice versa.

Returns
a value converted.
Note
PDP endian is not dealt with.

◆ endian_reverse32()

uint32_t endian_reverse32 ( uint32_t  val)

convert 32-bit little/big endian to big/little endian.

endian_reverse32() converts a little endian 32-bit value to a bit endian value, and vice versa.

Returns
a value converted.
Note
PDP endian is not dealt with.

◆ endian_reverse64()

uint64_t endian_reverse64 ( uint64_t  val)

convert 64-bit little/big endian to big/little endian.

endian_reverse64() converts a little endian 64-bit value to a bit endian value, and vice versa.

Returns
a value converted.
Note
PDP endian is not dealt with.