sarmfsw: SMFSW Toolbox (for ARM & compatible with Arduino platform) 3.7
SMFSW collection of miscellaneous functions & macros (for ARM & compatible with Arduino platform)
Loading...
Searching...
No Matches
arm_inlines_endian.h File Reference

Endian conversion and testing inlines. More...

This graph shows which files directly or indirectly include this file:

Typedefs

typedef enum eEndian eEndian
 

Enumerations

enum  eEndian {
  Endian_little = 0 , Endian_big , Endian_mid_little , Endian_mid_big ,
  Endian_unknown
}
 Core endian. More...
 

Functions

WORD SWAP_END16B (const WORD w)
 Swap content endian of a 16b value (little -> big, big -> little)
 
DWORD SWAP_END32B (const DWORD d)
 Swap content endian of a 32b value (little -> big, big -> little)
 
LWORD SWAP_END64B (const LWORD l)
 Swap content endian of a 64b value (little -> big, big -> little)
 
void SWAP_END16B_TAB (WORD tab[], const WORD nb)
 Swap endian of a 16b tab (little -> big, big -> little)
 
void SWAP_END32B_TAB (DWORD tab[], const WORD nb)
 Swap endian of a 32b tab (little -> big, big -> little)
 
void SWAP_END64B_TAB (LWORD tab[], const WORD nb)
 Swap endian of a 64b tab (little -> big, big -> little)
 
eEndian testEndian_basic (void)
 Test Core endian.
 
eEndian testEndian_full (void)
 Test Core endian (full, recognizing mid endian too)
 

Detailed Description

Endian conversion and testing inlines.

Author
SMFSW

Typedef Documentation

◆ eEndian

typedef enum eEndian eEndian

Enumeration Type Documentation

◆ eEndian

enum eEndian

Core endian.

Enumerator
Endian_little 

Little endian configured MCU.

Endian_big 

Big endian configured MCU.

Endian_mid_little 

Middle little endian configured MCU (PDP-11)

Endian_mid_big 

Middle big endian configured MCU (Honeywell 316)

Endian_unknown 

Unknown endian MCU.

Function Documentation

◆ SWAP_END16B()

WORD SWAP_END16B ( const WORD w)
inline

Swap content endian of a 16b value (little -> big, big -> little)

Parameters
[in]w- 16b value
Returns
Swapped value
Here is the caller graph for this function:

◆ SWAP_END16B_TAB()

void SWAP_END16B_TAB ( WORD tab[],
const WORD nb )
inline

Swap endian of a 16b tab (little -> big, big -> little)

Parameters
[in]tab- tab of 16b values
[in]nb- nb of values in tab
Here is the call graph for this function:

◆ SWAP_END32B()

DWORD SWAP_END32B ( const DWORD d)
inline

Swap content endian of a 32b value (little -> big, big -> little)

Parameters
[in]d- 32b value
Returns
Swapped value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SWAP_END32B_TAB()

void SWAP_END32B_TAB ( DWORD tab[],
const WORD nb )
inline

Swap endian of a 32b tab (little -> big, big -> little)

Parameters
[in]tab- tab of 32b values
[in]nb- nb of values in tab
Here is the call graph for this function:

◆ SWAP_END64B()

LWORD SWAP_END64B ( const LWORD l)
inline

Swap content endian of a 64b value (little -> big, big -> little)

Parameters
[in]l- 64b value
Returns
Swapped value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SWAP_END64B_TAB()

void SWAP_END64B_TAB ( LWORD tab[],
const WORD nb )
inline

Swap endian of a 64b tab (little -> big, big -> little)

Parameters
[in]tab- tab of 64b values
[in]nb- nb of values in tab
Here is the call graph for this function:

◆ testEndian_basic()

eEndian testEndian_basic ( void )
inline

Test Core endian.

Returns
Endian type

◆ testEndian_full()

eEndian testEndian_full ( void )
inline

Test Core endian (full, recognizing mid endian too)

MISRA C:2012 Deviations
Function scope deviation granted for:
Rule-15.5 - Advisory: single point of exit (misra-c2012-15.5)
Rule-19.2 - Advisory: union keyword (misra-c2012-19.2)
Returns
Endian type