sarmfsw: SMFSW Toolbox (for ARM & compatible with Arduino platform) 3.7
SMFSW collection of miscellaneous functions & macros (for ARM & compatible with Arduino platform)
|
Variables size conversion inlines. More...
Functions | |
BYTE | conv16to8Bits (const WORD val) |
convert 16bits variable to 8bits | |
WORD | conv8to16Bits (const BYTE val) |
convert 8bits variable to 16bits | |
WORD | conv32to16Bits (const DWORD val) |
convert 32bits variable to 16bits | |
DWORD | conv16to32Bits (const WORD val) |
convert 16bits variable to 32bits | |
DWORD | conv64to32Bits (const LWORD val) |
convert 64bits variable to 32bits | |
LWORD | conv32to64Bits (const DWORD val) |
convert 32bits variable to 64bits | |
WORD | conv8upto16Bits (const BYTE val, const BYTE nb) |
convert 8bits variable to 8+nb bits (16bits max) | |
DWORD | conv16upto32Bits (const WORD val, const BYTE nb) |
convert 16bits variable to 16+nb bits (32bits max) | |
LWORD | conv32upto64Bits (const DWORD val, const BYTE nb) |
convert 32bits variable to 32+nb bits (64bits max) | |
DWORD | convXtoYBits (const DWORD val, const BYTE from, const BYTE to) |
convert x bits variable to y bits (32bits max) | |
SLWORD | scaleValue (const SLWORD val, const SLWORD from_min, const SLWORD from_max, const SLWORD to_min, const SLWORD to_max) |
Scale value from one range to another. | |
Variables size conversion inlines.
convert 16bits variable to 32bits
[in] | val | - 16b value to convert |
convert 16bits variable to 8bits
[in] | val | - 16b value to convert |
convert 16bits variable to 16+nb bits (32bits max)
[in] | val | - 16b value to convert |
[in] | nb | - number of bits to add (16bits max) |
convert 32bits variable to 16bits
[in] | val | - 32b value to convert |
convert 32bits variable to 64bits
[in] | val | - 32b value to convert |
convert 32bits variable to 32+nb bits (64bits max)
[in] | val | - 32b value to convert |
[in] | nb | - number of bits to add (32bits max) |
convert 64bits variable to 32bits
[in] | val | - 64b value to convert |
convert 8bits variable to 16bits
[in] | val | - 8b value to convert |
convert 8bits variable to 8+nb bits (16bits max)
[in] | val | - 8b value to convert |
[in] | nb | - number of bits to add (8bits max) |
convert x bits variable to y bits (32bits max)
[in] | val | - x bits value to convert |
[in] | from | - number of bits from former variable |
[in] | to | - number of bits of output variable |
|
inline |
Scale value from one range to another.
[in] | val | - Value to scale |
[in] | from_min | - Minimal input range value |
[in] | from_max | - Maximal input range value |
[in] | to_min | - Minimal output range value |
[in] | to_max | - Maximal output range value |