Open Lighting Architecture  Latest Git
Functions
ola::utils Namespace Reference

Detailed Description

General numeric helper functions.

Functions

void SplitUInt16 (uint16_t input, uint8_t *high, uint8_t *low)
 Convert a uint16_t to two uint8_t's. More...
 
uint16_t JoinUInt8 (uint8_t high, uint8_t low)
 Convert two uint8_t's to a uint16_t. More...
 
uint32_t JoinUInt8 (uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3)
 Convert four uint8_t's to a uint32_t. More...
 

Function Documentation

◆ JoinUInt8() [1/2]

uint16_t ola::utils::JoinUInt8 ( uint8_t  high,
uint8_t  low 
)
inline

Convert two uint8_t's to a uint16_t.

Parameters
highthe high byte
lowthe low byte
Returns
the combined uint16_t

◆ JoinUInt8() [2/2]

uint32_t ola::utils::JoinUInt8 ( uint8_t  byte0,
uint8_t  byte1,
uint8_t  byte2,
uint8_t  byte3 
)
inline

Convert four uint8_t's to a uint32_t.

Parameters
byte0the highest byte
byte1the high middle byte
byte2the low middle byte
byte3the lowest byte
Returns
the combined uint32_t

◆ SplitUInt16()

void ola::utils::SplitUInt16 ( uint16_t  input,
uint8_t *  high,
uint8_t *  low 
)
inline

Convert a uint16_t to two uint8_t's.

Parameters
[in]inputthe uint16_t to split
[out]highthe high byte
[out]lowthe low byte