Low-overhead Arduino compatibility library for STM8 microcontrollers.
This project tries to lower the bar when writing code for STM8. It’s for you if:
- you are familiar with Arduino APIs and don't want to bother reading the STM8 datasheet
- you want to port an existing Arduino library to work with STM8
NOTE: sdcc doesn’t support C++ and there are a few constraints, so the APIs don't match 100%.
- GPIO:
digitalRead,digitalWrite,pinMode,attachInterrupt - UART: serial output, use
puts,putcharor evenprintfnatively - ADC:
analogRead - SPI:
spi_transfer
sudo apt-get install sdcc make- Put your code into
example/demo.c - Adjust
example/Makefilewith yourstm8flashcommand. I recommend to use stm8flash with the ESP8266-based esp-stlink. - Run:
make flash
Please file bugs if you run into any issues.