openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
woz_bytes.h File Reference

Byte-order utilities: read/write 16-bit and 32-bit integers in little-endian or big-endian order. More...

#include <stdint.h>
Include dependency graph for woz_bytes.h:

Go to the source code of this file.

Functions

static uint16_t sys_get_le16 (const uint8_t *p)
 Read a 16-bit little-endian value from a byte buffer.
 
static uint32_t sys_get_le32 (const uint8_t *p)
 Read a 32-bit little-endian value from a byte buffer.
 
static uint16_t sys_get_be16 (const uint8_t *p)
 Read a 16-bit big-endian value from a byte buffer.
 
static uint32_t sys_get_be32 (const uint8_t *p)
 Read a 32-bit big-endian value from a byte buffer.
 
static void sys_put_le16 (uint16_t v, uint8_t *p)
 Write a 16-bit value to a byte buffer in little-endian order.
 
static void sys_put_le32 (uint32_t v, uint8_t *p)
 Write a 32-bit value to a byte buffer in little-endian order.
 
static void sys_put_be16 (uint16_t v, uint8_t *p)
 Write a 16-bit value to a byte buffer in big-endian order.
 
static void sys_put_be32 (uint32_t v, uint8_t *p)
 Write a 32-bit value to a byte buffer in big-endian order.
 

Detailed Description

Byte-order utilities: read/write 16-bit and 32-bit integers in little-endian or big-endian order.

Function Documentation

◆ sys_get_be16()

static uint16_t sys_get_be16 ( const uint8_t *  p)
inlinestatic

Read a 16-bit big-endian value from a byte buffer.

Parameters
pPointer to the byte buffer.
Returns
The 16-bit value in native byte order.

◆ sys_get_be32()

static uint32_t sys_get_be32 ( const uint8_t *  p)
inlinestatic

Read a 32-bit big-endian value from a byte buffer.

Parameters
pPointer to the byte buffer.
Returns
The 32-bit value in native byte order.

◆ sys_get_le16()

static uint16_t sys_get_le16 ( const uint8_t *  p)
inlinestatic

Read a 16-bit little-endian value from a byte buffer.

Parameters
pPointer to the byte buffer.
Returns
The 16-bit value in native byte order.

◆ sys_get_le32()

static uint32_t sys_get_le32 ( const uint8_t *  p)
inlinestatic

Read a 32-bit little-endian value from a byte buffer.

Parameters
pPointer to the byte buffer.
Returns
The 32-bit value in native byte order.

◆ sys_put_be16()

static void sys_put_be16 ( uint16_t  v,
uint8_t *  p 
)
inlinestatic

Write a 16-bit value to a byte buffer in big-endian order.

Parameters
vThe value to write.
pPointer to the byte buffer.

◆ sys_put_be32()

static void sys_put_be32 ( uint32_t  v,
uint8_t *  p 
)
inlinestatic

Write a 32-bit value to a byte buffer in big-endian order.

Parameters
vThe value to write.
pPointer to the byte buffer.

◆ sys_put_le16()

static void sys_put_le16 ( uint16_t  v,
uint8_t *  p 
)
inlinestatic

Write a 16-bit value to a byte buffer in little-endian order.

Parameters
vThe value to write.
pPointer to the byte buffer.

◆ sys_put_le32()

static void sys_put_le32 ( uint32_t  v,
uint8_t *  p 
)
inlinestatic

Write a 32-bit value to a byte buffer in little-endian order.

Parameters
vThe value to write.
pPointer to the byte buffer.