Using ST HAL or SPL with JSAPI

JSAPI and ST’s libraries (either the newer HAL or the older Standard Peripheral Library SPL) can inter-operate without problems. You may use ST’s libraries to access peripheral functions or I/O registers not visible through JSAPI functions. The following caveats apply:

·         You have to be careful when you are using JSAPI and ST calls that work on the same peripheral I/O registers, and

·         JSAPI functions are C++ functions and must be called by C++ functions, and ST libraries are written in C. However, it is easy to mix C and C++ code (see here).




[1]Probably an exaggeration, but perhaps not too far off from the mark.

[2]Our V8 C compiler supports “C with Classes”, required for the JSAPI member function abstraction.

[3] You may search for “name mangling” on the web, if you want to know more details.

[4]You may also create a library project, where the output is a binary library file that other projects may link with to use the functions within that library file.

[5]Silicon device usually gives meaning names to the IRQx, e.g. TIMER1_OVERFLOW