nl:: Weave:: Encoding
This namespace provides functions for:
Summary
- Performing byte reordering by value for 16-, 32-, and 64-bit types.
- Safely performing simple, efficient memory-mapped accesses, potentially to unaligned memory locations, with or without byte reordering, to 8-, 16-, 32-, and 64-bit quantities, both with and without pointer management.
Functions |
|
---|---|
Get8(const uint8_t *p)
|
uint8_t
Perform a, potentially unaligned, memory read of the 8-bit value from the specified pointer address.
|
Put8(uint8_t *p, uint8_t v)
|
void
Perform a, potentially unaligned, memory write of the target system byte ordered 8-bit value to the specified pointer address.
|
Read8(uint8_t *& p)
|
uint8_t
Perform a, potentially unaligned, memory read of the 16-bit value from the specified pointer address and increment the pointer by 8-bits (1 byte).
|
Read8(const uint8_t *& p)
|
uint8_t
Perform a, potentially unaligned, memory read of the 16-bit value from the specified pointer address and increment the pointer by 8-bits (1 byte).
|
Swap16(uint16_t v)
|
uint16_t
This unconditionally performs a byte order swap by value of the specified 16-bit value.
|
Swap32(uint32_t v)
|
uint32_t
This unconditionally performs a byte order swap by value of the specified 32-bit value.
|
Swap64(uint64_t v)
|
uint64_t
This unconditionally performs a byte order swap by value of the specified 64-bit value.
|
Write8(uint8_t *& p, uint8_t v)
|
void
Perform a, potentially unaligned, memory write of the 8-bit value to the specified pointer address and increment the pointer by 8-bits (1 byte).
|
Namespaces |
|
---|---|
nl:: |
This namespace provides functions for: |
nl:: |
This namespace provides functions for: |
Functions
Get8
uint8_t Get8( const uint8_t *p )
Perform a, potentially unaligned, memory read of the 8-bit value from the specified pointer address.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The 8-bit value at the specified pointer address.
|
Put8
void Put8( uint8_t *p, uint8_t v )
Perform a, potentially unaligned, memory write of the target system byte ordered 8-bit value to the specified pointer address.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Read8
uint8_t Read8( uint8_t *& p )
Perform a, potentially unaligned, memory read of the 16-bit value from the specified pointer address and increment the pointer by 8-bits (1 byte).
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The 8-bit value at the specified pointer address.
|
Read8
uint8_t Read8( const uint8_t *& p )
Perform a, potentially unaligned, memory read of the 16-bit value from the specified pointer address and increment the pointer by 8-bits (1 byte).
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The 8-bit value at the specified pointer address.
|
Swap16
uint16_t Swap16( uint16_t v )
This unconditionally performs a byte order swap by value of the specified 16-bit value.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The input value, byte order swapped.
|
Swap32
uint32_t Swap32( uint32_t v )
This unconditionally performs a byte order swap by value of the specified 32-bit value.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The input value, byte order swapped.
|
Swap64
uint64_t Swap64( uint64_t v )
This unconditionally performs a byte order swap by value of the specified 64-bit value.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The input value, byte order swapped.
|
Write8
void Write8( uint8_t *& p, uint8_t v )
Perform a, potentially unaligned, memory write of the 8-bit value to the specified pointer address and increment the pointer by 8-bits (1 byte).
Details | |||||
---|---|---|---|---|---|
Parameters |
|