Skip to content

Utilities

The utilities library provides number and text utilities for all the different libraries.

Number

cos32x100() and sin32x100() are the trigonometric cosinus and sinus functions, performed with integers. Both the parameter in degrees and the result are multiplied by 100.

checkRange() checks whether a value is in range, and returns the value or, if the value is outside the range, the lower or upper limit of the range. The function is available for signed and unsigned, 16-bit and 32-bit, integers.

setMinMax() updates the minimum and maximum with the value.

Text

utf2iso() converts a string coded in UTF-8 into a string coded in ISO-8859-1.

formatChar() and formatString() returns an array of characters or a string from a text following the format. Both relies on the printf() parameters for the format.

htoa() returns a number as a string with an hexadecimal format.

btoa() returns a number as a string with a binary format.

ttoa() returns a number as a string with a time format.

i32toa() returns a number as a string with an integer format.

Miscellaneous

delay_ms() is a blocking delay and shouldn't be used if the targeted platform uses an RTOS.

configurationDebug() lists the options set for the current configuration in hV_Configuration.h.

Back to top