cpu_endian.c File Reference

Byte order conversion. More...

#include "cpu_endian.h"

Go to the source code of this file.

Functions

uint16_t swapInt16 (uint16_t value)
 Reverse the byte order of a 16-bit word. More...
 
uint32_t swapInt32 (uint32_t value)
 Reverse the byte order of a 32-bit word. More...
 
uint64_t swapInt64 (uint64_t value)
 Reverse the byte order of a 64-bit word. More...
 
uint8_t reverseInt4 (uint8_t value)
 Reverse bit order in a 4-bit word. More...
 
uint8_t reverseInt8 (uint8_t value)
 Reverse bit order in a byte. More...
 
uint16_t reverseInt16 (uint16_t value)
 Reverse bit order in a 16-bit word. More...
 
uint32_t reverseInt32 (uint32_t value)
 Reverse bit order in a 32-bit word. More...
 
uint64_t reverseInt64 (uint64_t value)
 Reverse bit order in a 64-bit word. More...
 

Detailed Description

Byte order conversion.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file cpu_endian.c.

Function Documentation

◆ reverseInt16()

uint16_t reverseInt16 ( uint16_t  value)

Reverse bit order in a 16-bit word.

Parameters
[in]value16-bit value
Returns
16-bit value with bit order reversed

Definition at line 104 of file cpu_endian.c.

◆ reverseInt32()

uint32_t reverseInt32 ( uint32_t  value)

Reverse bit order in a 32-bit word.

Parameters
[in]value32-bit value
Returns
32-bit value with bit order reversed

Definition at line 121 of file cpu_endian.c.

◆ reverseInt4()

uint8_t reverseInt4 ( uint8_t  value)

Reverse bit order in a 4-bit word.

Parameters
[in]value4-bit value
Returns
4-bit value with bit order reversed

Definition at line 73 of file cpu_endian.c.

◆ reverseInt64()

uint64_t reverseInt64 ( uint64_t  value)

Reverse bit order in a 64-bit word.

Parameters
[in]value64-bit value
Returns
64-bit value with bit order reversed

Definition at line 139 of file cpu_endian.c.

◆ reverseInt8()

uint8_t reverseInt8 ( uint8_t  value)

Reverse bit order in a byte.

Parameters
[in]value8-bit value
Returns
8-bit value with bit order reversed

Definition at line 88 of file cpu_endian.c.

◆ swapInt16()

uint16_t swapInt16 ( uint16_t  value)

Reverse the byte order of a 16-bit word.

Parameters
[in]value16-bit value
Returns
16-bit value with byte order swapped

Definition at line 37 of file cpu_endian.c.

◆ swapInt32()

uint32_t swapInt32 ( uint32_t  value)

Reverse the byte order of a 32-bit word.

Parameters
[in]value32-bit value
Returns
32-bit value with byte order swapped

Definition at line 49 of file cpu_endian.c.

◆ swapInt64()

uint64_t swapInt64 ( uint64_t  value)

Reverse the byte order of a 64-bit word.

Parameters
[in]value64-bit value
Returns
64-bit value with byte order swapped

Definition at line 61 of file cpu_endian.c.