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.

roundUp() returns a rounded-up value based on a modulo.

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

Text

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

formatString() returns an array of characters or a string from a text and a format specifier. The format uses the standard printf() specifier characters .

trimString() removes from a text the starting and ending special characters such as Enter (0x0d and 0x0a), Tab (0x09) and Space (0x20).

Miscellaneous

configurationDebug() lists the options set for the current configuration defined in hV_List_Boards.

debugOTP() details the content of the OTP memory when the trace is activated as described in the technical note Generate a trace.