stm32js
is a framework which gives you a way to write scripts for STM32 in JavaScript.
stm32js
provides a hardware abstraction layer (HAL) to common STM32F4 peripheral in a set of two-way C++ ↔ JS bindings.
In other words, now you can program your STM32F4Discovery using JS, and ready-to-use libraries is also available.
stm32js
is lying in between web technologies and embedded development, and trying to get the best from two worlds.
It consists of several parts:
Currently you cannot build the framework through gcc, but I'm working on it. I provide binary image built on IAR now.
stm32js
is very easy to use for those who have an experience with JS, so I'll show you some particular framework use cases.
For example, let's ask the system timer to tick every 500 milliseconds. Didn't you forget about ES6 support? You can use arrow functions in here.
const SysTick = require('../peripheral/systick');
var sysTick = new SysTick(500);
sysTick.on('tick', () => {
print('tick');
});
print()
function will output its argument to SWO so you can see it in "Terminal I/O" window in IAR or appropriate tool in other IDE or ST-Link Utility.